Mercurial > dropbear
diff rsa.c @ 1512:b024f9695782 fuzz
limit rsa->e size to 64 bits
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 17 Feb 2018 19:41:44 +0800 |
parents | 5916af64acd4 |
children | bb8eaa26bc93 |
line wrap: on
line diff
--- a/rsa.c Sat Feb 17 19:29:51 2018 +0800 +++ b/rsa.c Sat Feb 17 19:41:44 2018 +0800 @@ -68,6 +68,12 @@ goto out; } + /* 64 bit is limit used by openssl, so we won't block any keys in the wild */ + if (mp_count_bits(key->e) > 64) { + dropbear_log(LOG_WARNING, "RSA key bad e"); + goto out; + } + TRACE(("leave buf_get_rsa_pub_key: success")) ret = DROPBEAR_SUCCESS; out: