summaryrefslogtreecommitdiffhomepage
path: root/dss.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2017-06-16 22:35:18 +0800
committerMatt Johnston <matt@ucc.asn.au>2017-06-16 22:35:18 +0800
commiteb7ca203791f0b152227e8abb65f5109b7719f56 (patch)
treebf08460797eb04937c596a03ef0badbb92c51136 /dss.c
parentaf2caaab7279b14ea2ed92726086c9f8f2935e75 (diff)
check p and q lengths
Diffstat (limited to 'dss.c')
-rw-r--r--dss.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/dss.c b/dss.c
index 60e97c1..a3b4dce 100644
--- a/dss.c
+++ b/dss.c
@@ -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;