summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/hmac
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/hmac/hmac.c5
-rw-r--r--src/lib/libcrypto/hmac/hmac.h5
2 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/libcrypto/hmac/hmac.c b/src/lib/libcrypto/hmac/hmac.c
index 7c882ba15b..1315b1a0d2 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.34 2024/03/30 10:10:58 tb Exp $ */ 1/* $OpenBSD: hmac.c,v 1.35 2024/06/01 07:36:16 tb 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 *
@@ -263,11 +263,8 @@ HMAC(const EVP_MD *evp_md, const void *key, int key_len, const unsigned char *d,
263 size_t n, unsigned char *md, unsigned int *md_len) 263 size_t n, unsigned char *md, unsigned int *md_len)
264{ 264{
265 HMAC_CTX c; 265 HMAC_CTX c;
266 static unsigned char m[EVP_MAX_MD_SIZE];
267 const unsigned char dummy_key[1] = { 0 }; 266 const unsigned char dummy_key[1] = { 0 };
268 267
269 if (md == NULL)
270 md = m;
271 if (key == NULL) { 268 if (key == NULL) {
272 key = dummy_key; 269 key = dummy_key;
273 key_len = 0; 270 key_len = 0;
diff --git a/src/lib/libcrypto/hmac/hmac.h b/src/lib/libcrypto/hmac/hmac.h
index 1ce365294c..abdd19450e 100644
--- a/src/lib/libcrypto/hmac/hmac.h
+++ b/src/lib/libcrypto/hmac/hmac.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: hmac.h,v 1.17 2023/04/25 15:48:48 tb Exp $ */ 1/* $OpenBSD: hmac.h,v 1.18 2024/06/01 07:36:16 tb 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 *
@@ -85,7 +85,8 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md,
85int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); 85int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len);
86int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); 86int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
87unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, 87unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
88 const unsigned char *d, size_t n, unsigned char *md, unsigned int *md_len); 88 const unsigned char *d, size_t n, unsigned char *md, unsigned int *md_len)
89 __attribute__((__nonnull__ (6)));
89int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); 90int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
90 91
91void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); 92void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);