comparison dss.c @ 1418:92717c0fec39

check p and q lengths
author Matt Johnston <matt@ucc.asn.au>
date Fri, 16 Jun 2017 22:35:18 +0800
parents a54b22f4058d
children 69862e8cc405 7aebe7da3a35
comparison
equal deleted inserted replaced
1416:33d90d219e03 1418:92717c0fec39
59 TRACE(("leave buf_get_dss_pub_key: failed reading mpints")) 59 TRACE(("leave buf_get_dss_pub_key: failed reading mpints"))
60 ret = DROPBEAR_FAILURE; 60 ret = DROPBEAR_FAILURE;
61 goto out; 61 goto out;
62 } 62 }
63 63
64 if (mp_count_bits(key->p) < MIN_DSS_KEYLEN) { 64 if (mp_count_bits(key->p) < DSS_P_BITS) {
65 dropbear_log(LOG_WARNING, "DSS key too short"); 65 dropbear_log(LOG_WARNING, "Bad DSS p");
66 TRACE(("leave buf_get_dss_pub_key: short key"))
67 ret = DROPBEAR_FAILURE;
68 goto out;
69 }
70
71 if (mp_count_bits(key->q) < DSS_Q_BITS) {
72 dropbear_log(LOG_WARNING, "Bad DSS q");
66 TRACE(("leave buf_get_dss_pub_key: short key")) 73 TRACE(("leave buf_get_dss_pub_key: short key"))
67 ret = DROPBEAR_FAILURE; 74 ret = DROPBEAR_FAILURE;
68 goto out; 75 goto out;
69 } 76 }
70 77