# HG changeset patch # User Matt Johnston # Date 1502640010 -28800 # Node ID 5b25d86b865b66084f1253c2fd4ba0209dfab9b4 # Parent ea150e3e95a6a8d59cfdbb8dfb571a27bfb95775 check dss g range diff -r ea150e3e95a6 -r 5b25d86b865b dss.c --- a/dss.c Fri Jun 30 21:10:57 2017 +0800 +++ b/dss.c Mon Aug 14 00:00:10 2017 +0800 @@ -73,6 +73,18 @@ goto out; } + /* test 1 < g < p */ + if (mp_cmp_d(key->g, 1) != MP_GT) { + dropbear_log(LOG_WARNING, "Bad DSS g"); + ret = DROPBEAR_FAILURE; + goto out; + } + if (mp_cmp(key->g, key->p) != MP_LT) { + dropbear_log(LOG_WARNING, "Bad DSS g"); + ret = DROPBEAR_FAILURE; + goto out; + } + ret = DROPBEAR_SUCCESS; TRACE(("leave buf_get_dss_pub_key: success")) out: