summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjoshua <>2024-03-26 12:10:50 +0000
committerjoshua <>2024-03-26 12:10:50 +0000
commit8ec42d5ee5a4f2ad8f1041e98230cca595c03ba9 (patch)
tree30242722543d8fcf16a0eccd205602eaf5467e38 /src/lib
parentb4da27dc607f0df09ca9d4a261307534f5914cec (diff)
downloadopenbsd-8ec42d5ee5a4f2ad8f1041e98230cca595c03ba9.tar.gz
openbsd-8ec42d5ee5a4f2ad8f1041e98230cca595c03ba9.tar.bz2
openbsd-8ec42d5ee5a4f2ad8f1041e98230cca595c03ba9.zip
Simplify HMAC_CTX_new()
There is no need to call HMAC_CTX_init() as the memory has already been initialised to zero. ok tb
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/hmac/hmac.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/lib/libcrypto/hmac/hmac.c b/src/lib/libcrypto/hmac/hmac.c
index 32d75154d4..d80b45de5b 100644
--- a/src/lib/libcrypto/hmac/hmac.c
+++ b/src/lib/libcrypto/hmac/hmac.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hmac.c,v 1.32 2024/02/18 15:45:42 tb Exp $ */ 1/* $OpenBSD: hmac.c,v 1.33 2024/03/26 12:10:50 joshua 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 *
@@ -180,14 +180,7 @@ LCRYPTO_ALIAS(HMAC_Final);
180HMAC_CTX * 180HMAC_CTX *
181HMAC_CTX_new(void) 181HMAC_CTX_new(void)
182{ 182{
183 HMAC_CTX *ctx; 183 return calloc(1, sizeof(HMAC_CTX));
184
185 if ((ctx = calloc(1, sizeof(*ctx))) == NULL)
186 return NULL;
187
188 HMAC_CTX_init(ctx);
189
190 return ctx;
191} 184}
192LCRYPTO_ALIAS(HMAC_CTX_new); 185LCRYPTO_ALIAS(HMAC_CTX_new);
193 186