Remove support for static buffers in HMAC/digests
authortb <tb@openbsd.org>
Sat, 1 Jun 2024 07:36:16 +0000 (07:36 +0000)
committertb <tb@openbsd.org>
Sat, 1 Jun 2024 07:36:16 +0000 (07:36 +0000)
commit9cb045229698d08f09fbd7cf9ae7f3b9b8f8b848
treead79ee4c335452ec46dfcf051ef22336b890b01f
parenta278ca99442dc76d54298316b50484530cd9c2bd
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
14 files changed:
lib/libcrypto/hmac/hmac.c
lib/libcrypto/hmac/hmac.h
lib/libcrypto/md4/md4.c
lib/libcrypto/md4/md4.h
lib/libcrypto/md5/md5.c
lib/libcrypto/md5/md5.h
lib/libcrypto/ripemd/ripemd.c
lib/libcrypto/ripemd/ripemd.h
lib/libcrypto/sha/sha.h
lib/libcrypto/sha/sha1.c
lib/libcrypto/sha/sha256.c
lib/libcrypto/sha/sha512.c
lib/libcrypto/whrlpool/whirlpool.c
lib/libcrypto/whrlpool/whrlpool.h