comparison dss.c @ 1430:7aebe7da3a35

test dss key parameter lengths exactly
author Matt Johnston <matt@ucc.asn.au>
date Sat, 24 Jun 2017 10:32:33 +0800
parents 92717c0fec39
children 793c43cf523e 06d52bcb8094
comparison
equal deleted inserted replaced
1429:a097c9c9608a 1430:7aebe7da3a35
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) < DSS_P_BITS) { 64 if (mp_count_bits(key->p) != DSS_P_BITS) {
65 dropbear_log(LOG_WARNING, "Bad DSS p"); 65 dropbear_log(LOG_WARNING, "Bad DSS p");
66 TRACE(("leave buf_get_dss_pub_key: short key"))
67 ret = DROPBEAR_FAILURE; 66 ret = DROPBEAR_FAILURE;
68 goto out; 67 goto out;
69 } 68 }
70 69
71 if (mp_count_bits(key->q) < DSS_Q_BITS) { 70 if (mp_count_bits(key->q) != DSS_Q_BITS) {
72 dropbear_log(LOG_WARNING, "Bad DSS q"); 71 dropbear_log(LOG_WARNING, "Bad DSS q");
73 TRACE(("leave buf_get_dss_pub_key: short key"))
74 ret = DROPBEAR_FAILURE; 72 ret = DROPBEAR_FAILURE;
75 goto out; 73 goto out;
76 } 74 }
77 75
78 ret = DROPBEAR_SUCCESS; 76 ret = DROPBEAR_SUCCESS;