From: Dmitry Belyavskiy Date: Mon, 12 Dec 2016 13:47:46 +0000 (+0300) Subject: Fix signature processing X-Git-Tag: v1.1.0.2~16 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=d21d11ec8e5b8eb62dbe0d802a3c9bcee2d83159;p=openssl-gost%2Fengine.git Fix signature processing --- diff --git a/gost_ec_sign.c b/gost_ec_sign.c index 904b80c..03a2ba0 100644 --- a/gost_ec_sign.c +++ b/gost_ec_sign.c @@ -161,7 +161,7 @@ DSA_SIG *gost_ec_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey) BIGNUM *r = NULL, *s = NULL, *X = NULL, *tmp = NULL, *tmp2 = NULL, *k = NULL, *e = NULL; - const BIGNUM *new_r = NULL, *new_s = NULL; + BIGNUM *new_r = NULL, *new_s = NULL; EC_POINT *C = NULL; BN_CTX *ctx; @@ -276,13 +276,13 @@ DSA_SIG *gost_ec_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey) } while (BN_is_zero(s)); - DSA_SIG_get0(newsig, &new_r, &new_s); new_s = BN_dup(s); new_r = BN_dup(r); if (!new_s || !new_r) { GOSTerr(GOST_F_GOST_EC_SIGN, ERR_R_MALLOC_FAILURE); goto err; } + DSA_SIG_set0(newsig, new_r, new_s); ret = newsig; err: