summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2018-06-14 17:01:49 +0000
committerjsing <>2018-06-14 17:01:49 +0000
commitd99af5ac127011aed8b51b3f98c4754ea0525934 (patch)
treef4f5a977e47705614445b32a8fc89aa3e3be6806 /src
parentf8bc598f2f2d6729a539d2a5e0e93bf4ceff4502 (diff)
downloadopenbsd-d99af5ac127011aed8b51b3f98c4754ea0525934.tar.gz
openbsd-d99af5ac127011aed8b51b3f98c4754ea0525934.tar.bz2
openbsd-d99af5ac127011aed8b51b3f98c4754ea0525934.zip
DSA_SIG_new() amounts to a single calloc() call.
ok beck@ tb@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/dsa/dsa_sign.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_sign.c b/src/lib/libcrypto/dsa/dsa_sign.c
index 355bdd20d6..0f55ea1868 100644
--- a/src/lib/libcrypto/dsa/dsa_sign.c
+++ b/src/lib/libcrypto/dsa/dsa_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_sign.c,v 1.19 2014/10/18 17:20:40 jsing Exp $ */ 1/* $OpenBSD: dsa_sign.c,v 1.20 2018/06/14 17:01:49 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -76,20 +76,13 @@ DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
76DSA_SIG * 76DSA_SIG *
77DSA_SIG_new(void) 77DSA_SIG_new(void)
78{ 78{
79 DSA_SIG *sig; 79 return calloc(1, sizeof(DSA_SIG));
80
81 sig = malloc(sizeof(DSA_SIG));
82 if (!sig)
83 return NULL;
84 sig->r = NULL;
85 sig->s = NULL;
86 return sig;
87} 80}
88 81
89void 82void
90DSA_SIG_free(DSA_SIG *sig) 83DSA_SIG_free(DSA_SIG *sig)
91{ 84{
92 if (sig) { 85 if (sig != NULL) {
93 BN_free(sig->r); 86 BN_free(sig->r);
94 BN_free(sig->s); 87 BN_free(sig->s);
95 free(sig); 88 free(sig);