提交 7a533600 编写于 作者: A Andy Polyakov

engines/e_capi.c: accommodate recent DSA_SIG_[get|set]0 changes.

Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 e0685d24
...@@ -1029,17 +1029,17 @@ static DSA_SIG *capi_dsa_do_sign(const unsigned char *digest, int dlen, ...@@ -1029,17 +1029,17 @@ static DSA_SIG *capi_dsa_do_sign(const unsigned char *digest, int dlen,
capi_addlasterror(); capi_addlasterror();
goto err; goto err;
} else { } else {
BIGNUM *r = NULL, *s = NULL; BIGNUM *r = BN_new(), *s = BN_new();
ret = DSA_SIG_new();
if (ret == NULL) if (r == NULL || s == NULL
goto err; || !lend_tobn(r, csigbuf, 20)
DSA_SIG_get0(&r, &s, ret); || !lend_tobn(s, csigbuf + 20, 20)
if (!lend_tobn(r, csigbuf, 20) || (ret = DSA_SIG_new()) == NULL) {
|| !lend_tobn(s, csigbuf + 20, 20)) { BN_free(r); /* BN_free checks for BIGNUM * being NULL */
DSA_SIG_free(ret); BN_free(s);
ret = NULL;
goto err; goto err;
} }
DSA_SIG_set0(ret, r, s);
} }
/* Now cleanup */ /* Now cleanup */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册