summaryrefslogtreecommitdiffstats
path: root/engines
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2016-06-26 22:00:37 +0200
committerAndy Polyakov <appro@openssl.org>2016-06-27 23:32:09 +0200
commit7a53360031a505d4bb55f3c7877ded5d165bef5a (patch)
treee6a4180d6bc6adbd74765ef099026407fb949258 /engines
parentrsa/rsa_lib.c: const-ify RSA_get0_engine(). (diff)
downloadopenssl-7a53360031a505d4bb55f3c7877ded5d165bef5a.tar.xz
openssl-7a53360031a505d4bb55f3c7877ded5d165bef5a.zip
engines/e_capi.c: accommodate recent DSA_SIG_[get|set]0 changes.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'engines')
-rw-r--r--engines/e_capi.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/e_capi.c b/engines/e_capi.c
index f2d5c3e091..4923eefa55 100644
--- a/engines/e_capi.c
+++ b/engines/e_capi.c
@@ -1029,17 +1029,17 @@ static DSA_SIG *capi_dsa_do_sign(const unsigned char *digest, int dlen,
capi_addlasterror();
goto err;
} else {
- BIGNUM *r = NULL, *s = NULL;
- ret = DSA_SIG_new();
- if (ret == NULL)
- goto err;
- DSA_SIG_get0(&r, &s, ret);
- if (!lend_tobn(r, csigbuf, 20)
- || !lend_tobn(s, csigbuf + 20, 20)) {
- DSA_SIG_free(ret);
- ret = NULL;
+ BIGNUM *r = BN_new(), *s = BN_new();
+
+ if (r == NULL || s == NULL
+ || !lend_tobn(r, csigbuf, 20)
+ || !lend_tobn(s, csigbuf + 20, 20)
+ || (ret = DSA_SIG_new()) == NULL) {
+ BN_free(r); /* BN_free checks for BIGNUM * being NULL */
+ BN_free(s);
goto err;
}
+ DSA_SIG_set0(ret, r, s);
}
/* Now cleanup */