cmac+hash: add support for Nettle 4.0

Support for truncated digests was removed in Nettle 4.0. The digest
functions no longer accept the output length. Provide a full-length
buffer and copy the requested length of the digest, same as with the
other crypto providers.
This commit is contained in:
Miroslav Lichvar
2026-03-02 11:55:30 +01:00
parent d622b222a9
commit fee12ec914
3 changed files with 31 additions and 4 deletions

2
configure vendored
View File

@@ -911,7 +911,7 @@ HASH_LINK=""
if [ $feat_sechash = "1" ] && [ "x$HASH_LINK" = "x" ] && [ $try_nettle = "1" ]; then
test_cflags="`pkg_config --cflags nettle`"
test_link="`pkg_config --libs nettle`"
if test_code 'nettle' 'nettle/nettle-meta.h nettle/sha2.h' \
if test_code 'nettle' 'nettle/nettle-meta.h nettle/sha2.h nettle/version.h' \
"$test_cflags" "$test_link" \
'return nettle_hashes[0]->context_size;'
then