diff options
author | tb <> | 2024-06-01 07:36:17 +0000 |
---|---|---|
committer | tb <> | 2024-06-01 07:36:17 +0000 |
commit | f3bc6c83f92ef9b23bfc523ef1b24bfa27e1f6e4 (patch) | |
tree | d92a9fa364845580193b9ab3f5f391408342fa26 /src/lib/libcrypto/hmac/hmac.h | |
parent | aee2754cfbb89d3dff4c3a521fb027d0c6967bc9 (diff) | |
download | openbsd-f3bc6c83f92ef9b23bfc523ef1b24bfa27e1f6e4.tar.gz openbsd-f3bc6c83f92ef9b23bfc523ef1b24bfa27e1f6e4.tar.bz2 openbsd-f3bc6c83f92ef9b23bfc523ef1b24bfa27e1f6e4.zip |
Remove support for static buffers in HMAC/digests
HMAC() and the one-step digests used to support passing a NULL buffer and
would return the digest in a static buffer. This design is firmly from the
nineties, not thread safe and it saves callers a single line. The few ports
that used to rely this were fixed with patches sent to non-hostile (and
non-dead) upstreams. It's early enough in the release cycle that remaining
uses hidden from the compiler should be caught, at least the ones that
matter.
There won't be that many since BoringSSL removed this feature in 2017.
https://boringssl-review.googlesource.com/14528
Add non-null attributes to the headers and add a few missing bounded
attributes.
ok beck jsing
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/hmac/hmac.h | 5 |
1 files changed, 3 insertions, 2 deletions
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, | |||
85 | int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); | 85 | int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); |
86 | int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); | 86 | int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); |
87 | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, | 87 | unsigned 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))); | ||
89 | int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); | 90 | int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); |
90 | 91 | ||
91 | void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); | 92 | void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); |