summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2018-06-14 17:03:19 +0000
committerjsing <>2018-06-14 17:03:19 +0000
commite5b20cdab05d12e65e8a92db59c2a96ef66cce0a (patch)
tree966bdd6ef6f2d5bc0c4e4811b66e2f316c677d7c
parentd99af5ac127011aed8b51b3f98c4754ea0525934 (diff)
downloadopenbsd-e5b20cdab05d12e65e8a92db59c2a96ef66cce0a.tar.gz
openbsd-e5b20cdab05d12e65e8a92db59c2a96ef66cce0a.tar.bz2
openbsd-e5b20cdab05d12e65e8a92db59c2a96ef66cce0a.zip
Call DSA_SIG_new() instead of hand rolling the same.
ok beck@ tb@
-rw-r--r--src/lib/libcrypto/dsa/dsa_asn1.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_asn1.c b/src/lib/libcrypto/dsa/dsa_asn1.c
index aac67dbd03..23f08bb1f9 100644
--- a/src/lib/libcrypto/dsa/dsa_asn1.c
+++ b/src/lib/libcrypto/dsa/dsa_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_asn1.c,v 1.21 2018/02/20 17:48:35 tb Exp $ */ 1/* $OpenBSD: dsa_asn1.c,v 1.22 2018/06/14 17:03:19 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -71,13 +71,10 @@ sig_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
71 if (operation == ASN1_OP_NEW_PRE) { 71 if (operation == ASN1_OP_NEW_PRE) {
72 DSA_SIG *sig; 72 DSA_SIG *sig;
73 73
74 sig = malloc(sizeof(DSA_SIG)); 74 if ((sig = DSA_SIG_new()) == NULL) {
75 if (!sig) {
76 DSAerror(ERR_R_MALLOC_FAILURE); 75 DSAerror(ERR_R_MALLOC_FAILURE);
77 return 0; 76 return 0;
78 } 77 }
79 sig->r = NULL;
80 sig->s = NULL;
81 *pval = (ASN1_VALUE *)sig; 78 *pval = (ASN1_VALUE *)sig;
82 return 2; 79 return 2;
83 } 80 }