# HG changeset patch # User Matt Johnston # Date 1518867704 -28800 # Node ID 36ab6b091ad3b094469c4a488a1b6424b0e845f4 # Parent 10994a613a6b5ff728d1449418907ffb5dba1d05 limit rsa->e size to 64 bits diff -r 10994a613a6b -r 36ab6b091ad3 rsa.c --- a/rsa.c Tue Feb 20 19:30:34 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: