X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=openssl-gost%2Fengine.git;a=blobdiff_plain;f=gost_ec_sign.c;h=a825dbabac64e0a6eb1dfa077954ba10ee14a1de;hp=47996e1666a4d3b4534d0db064dec59d07018582;hb=HEAD;hpb=365db29b4910660b4ac97b008d7b362a17d39c2d diff --git a/gost_ec_sign.c b/gost_ec_sign.c index 47996e1..a825dba 100644 --- a/gost_ec_sign.c +++ b/gost_ec_sign.c @@ -365,10 +365,10 @@ int gost_ec_verify(const unsigned char *dgst, int dgst_len, ECDSA_SIG_get0(sig, &sig_r, &sig_s); if (BN_is_zero(sig_s) || BN_is_zero(sig_r) || - (BN_cmp(sig_s, order) >= 1) || (BN_cmp(sig_r, order) >= 1)) { + BN_is_negative(sig_s) || BN_is_negative(sig_r) || + BN_ucmp(sig_s, order) >= 0 || BN_ucmp(sig_r, order) >= 0) { GOSTerr(GOST_F_GOST_EC_VERIFY, GOST_R_SIGNATURE_PARTS_GREATER_THAN_Q); goto err; - } OPENSSL_assert(dgst_len == 32 || dgst_len == 64);