diff options
author | Matt Johnston <matt@ucc.asn.au> | 2017-06-16 22:35:18 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2017-06-16 22:35:18 +0800 |
commit | eb7ca203791f0b152227e8abb65f5109b7719f56 (patch) | |
tree | bf08460797eb04937c596a03ef0badbb92c51136 /dss.c | |
parent | af2caaab7279b14ea2ed92726086c9f8f2935e75 (diff) |
check p and q lengths
Diffstat (limited to 'dss.c')
-rw-r--r-- | dss.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -61,8 +61,15 @@ int buf_get_dss_pub_key(buffer* buf, dropbear_dss_key *key) { goto out; } - if (mp_count_bits(key->p) < MIN_DSS_KEYLEN) { - dropbear_log(LOG_WARNING, "DSS key too short"); + if (mp_count_bits(key->p) < DSS_P_BITS) { + dropbear_log(LOG_WARNING, "Bad DSS p"); + TRACE(("leave buf_get_dss_pub_key: short key")) + ret = DROPBEAR_FAILURE; + goto out; + } + + if (mp_count_bits(key->q) < DSS_Q_BITS) { + dropbear_log(LOG_WARNING, "Bad DSS q"); TRACE(("leave buf_get_dss_pub_key: short key")) ret = DROPBEAR_FAILURE; goto out; |