Summary
digest_list[] in cipher/md.c is a NULL-terminated array walked by
spec_from_name() / spec_from_oid(). Under HAVE_WOLFSSL the SHA-3 block
substitutes four interior NULL placeholders for the unavailable shake specs:
#if !defined(HAVE_WOLFSSL)
&_gcry_digest_spec_shake128, ...
#else
NULL, NULL, NULL, NULL,
#endif
An interior NULL terminates the for (idx=0; (spec=digest_list[idx]); idx++)
scan early, so every digest listed after it — md5, md2, md4, rmd160,
tiger, whirlpool… — becomes unresolvable by name/OID. gcry_md_map_name("MD5")
returns 0.
Impact
Consumers that reference digests by name break. GnuPG registers MD5 as a
default weak digest at startup (additional_weak_digest("md5")); the failed
lookup makes gpg abort, so all gpg operations and apt repository signature
verification fail. (The ENABLED_WOLFSSL_FIPS-gated
_gcry_md_map_name_wolfssl table compensates, but it's compiled out in
non-FIPS builds.)
Fix
Remove the interior NULLs so the scan array has no interior terminator; under
HAVE_WOLFSSL the shake entries are simply absent. Restores name/OID
resolution for MD5 and all post-shake digests. Does NOT re-enable MD5
computation (NO_MD5 still refuses it) — only name/OID lookup. PR to follow.
Summary
digest_list[]incipher/md.cis a NULL-terminated array walked byspec_from_name()/spec_from_oid(). UnderHAVE_WOLFSSLthe SHA-3 blocksubstitutes four interior NULL placeholders for the unavailable shake specs:
An interior NULL terminates the
for (idx=0; (spec=digest_list[idx]); idx++)scan early, so every digest listed after it — md5, md2, md4, rmd160,
tiger, whirlpool… — becomes unresolvable by name/OID.
gcry_md_map_name("MD5")returns 0.
Impact
Consumers that reference digests by name break. GnuPG registers MD5 as a
default weak digest at startup (
additional_weak_digest("md5")); the failedlookup makes gpg abort, so all gpg operations and apt repository signature
verification fail. (The
ENABLED_WOLFSSL_FIPS-gated_gcry_md_map_name_wolfssltable compensates, but it's compiled out innon-FIPS builds.)
Fix
Remove the interior NULLs so the scan array has no interior terminator; under
HAVE_WOLFSSLthe shake entries are simply absent. Restores name/OIDresolution for MD5 and all post-shake digests. Does NOT re-enable MD5
computation (NO_MD5 still refuses it) — only name/OID lookup. PR to follow.