diff options
author | Matt Johnston <matt@ucc.asn.au> | 2018-02-17 19:41:44 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2018-02-17 19:41:44 +0800 |
commit | 67111efdad6c3fe499aaf39e7f0f0d97f9e3ac21 (patch) | |
tree | a593817c6c5ab5587c33d0fc3657558792c1671f /rsa.c | |
parent | 5fd677af765c0b4a623e6ba86c7207b7c6d9b47f (diff) |
limit rsa->e size to 64 bits
Diffstat (limited to 'rsa.c')
-rw-r--r-- | rsa.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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: |