aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Belyavskiy <beldmit@gmail.com>2016-12-12 16:47:46 +0300
committerDmitry Belyavskiy <beldmit@gmail.com>2016-12-12 16:47:46 +0300
commitd21d11ec8e5b8eb62dbe0d802a3c9bcee2d83159 (patch)
tree636ea699d82c06abdbab3283ea880a820e632967
parent18383fe5a0b32b22fb70e16177406ac777a98453 (diff)
downloadgost-engine-d21d11ec8e5b8eb62dbe0d802a3c9bcee2d83159.zip
gost-engine-d21d11ec8e5b8eb62dbe0d802a3c9bcee2d83159.tar.gz
gost-engine-d21d11ec8e5b8eb62dbe0d802a3c9bcee2d83159.tar.bz2
Fix signature processing
-rw-r--r--gost_ec_sign.c4
1 files changed, 2 insertions, 2 deletions
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: