summaryrefslogtreecommitdiff
path: root/dss.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2017-06-24 10:32:33 +0800
committerMatt Johnston <matt@ucc.asn.au>2017-06-24 10:32:33 +0800
commitd514e0b9f44457895c550e8fcca5150239ed0a15 (patch)
tree43b0c18fb9422e7752b9da796a3296c58ea90f3b /dss.c
parentf90bfc3983f6b3d21a1782f61e412772835dc6d5 (diff)
downloaddropbear-d514e0b9f44457895c550e8fcca5150239ed0a15.tar.gz
test dss key parameter lengths exactly
Diffstat (limited to 'dss.c')
-rw-r--r--dss.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/dss.c b/dss.c
index a3b4dce..9024b80 100644
--- a/dss.c
+++ b/dss.c
@@ -61,16 +61,14 @@ int buf_get_dss_pub_key(buffer* buf, dropbear_dss_key *key) {
goto out;
}
- if (mp_count_bits(key->p) < DSS_P_BITS) {
+ 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) {
+ 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;
}