changeset 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 a097c9c9608a
children 793c43cf523e b19877938d6a
files dss.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/dss.c	Sat Jun 24 01:01:11 2017 +0800
+++ b/dss.c	Sat Jun 24 10:32:33 2017 +0800
@@ -61,16 +61,14 @@
 		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;
 	}