Skip to content

Commit

Permalink
limit rsa->e size to 64 bits
Browse files Browse the repository at this point in the history
--HG--
branch : fuzz
  • Loading branch information
mkj committed Feb 17, 2018
1 parent 7e8094d commit dcb41e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rsa.c
Expand Up @@ -68,6 +68,12 @@ int buf_get_rsa_pub_key(buffer* buf, dropbear_rsa_key *key) {
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:
Expand Down

0 comments on commit dcb41e9

Please sign in to comment.