comparison dss.c @ 1450:5b25d86b865b fuzz

check dss g range
author Matt Johnston <matt@ucc.asn.au>
date Mon, 14 Aug 2017 00:00:10 +0800
parents 41dca1e5ea34
children 5916af64acd4
comparison
equal deleted inserted replaced
1449:ea150e3e95a6 1450:5b25d86b865b
71 dropbear_log(LOG_WARNING, "Bad DSS q"); 71 dropbear_log(LOG_WARNING, "Bad DSS q");
72 ret = DROPBEAR_FAILURE; 72 ret = DROPBEAR_FAILURE;
73 goto out; 73 goto out;
74 } 74 }
75 75
76 /* test 1 < g < p */
77 if (mp_cmp_d(key->g, 1) != MP_GT) {
78 dropbear_log(LOG_WARNING, "Bad DSS g");
79 ret = DROPBEAR_FAILURE;
80 goto out;
81 }
82 if (mp_cmp(key->g, key->p) != MP_LT) {
83 dropbear_log(LOG_WARNING, "Bad DSS g");
84 ret = DROPBEAR_FAILURE;
85 goto out;
86 }
87
76 ret = DROPBEAR_SUCCESS; 88 ret = DROPBEAR_SUCCESS;
77 TRACE(("leave buf_get_dss_pub_key: success")) 89 TRACE(("leave buf_get_dss_pub_key: success"))
78 out: 90 out:
79 if (ret == DROPBEAR_FAILURE) { 91 if (ret == DROPBEAR_FAILURE) {
80 m_mp_free_multi(&key->p, &key->q, &key->g, &key->y, NULL); 92 m_mp_free_multi(&key->p, &key->q, &key->g, &key->y, NULL);