From 9184c3bd2c80220ab798f0f4ff3c7efbbfa05b58 Mon Sep 17 00:00:00 2001 From: Mark Atwood Date: Thu, 2 Jul 2026 19:53:18 -0700 Subject: [PATCH] md: fix name/OID lookup for MD5 and post-shake digests digest_list[] is a NULL-terminated array walked by spec_from_name() and spec_from_oid(). Under HAVE_WOLFSSL the SHA-3 block substituted four interior NULL placeholders for the unavailable shake specs. An interior NULL terminates the scan early, so every digest listed after it (md5, md2, md4, rmd160, ...) became unresolvable by name/OID; gcry_md_map_name("MD5") returned 0. That breaks consumers referencing digests by name -- GnuPG registers MD5 as a default weak digest at startup and aborts when the lookup fails, breaking gpg and apt signature verification. Remove the interior NULLs so the array has no interior terminator; under HAVE_WOLFSSL the shake entries are simply absent. Restores name and OID resolution for MD5 and all post-shake digests. Does not re-enable MD5 computation (NO_MD5 still refuses it) -- only name/OID lookup. Fixes #30 --- cipher/md.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cipher/md.c b/cipher/md.c index 255c6b52..5919eae4 100644 --- a/cipher/md.c +++ b/cipher/md.c @@ -109,11 +109,6 @@ static const gcry_md_spec_t * const digest_list[] = &_gcry_digest_spec_shake256, &_gcry_digest_spec_cshake128, &_gcry_digest_spec_cshake256, -#else - NULL, - NULL, - NULL, - NULL, #endif #endif #if USE_GOST_R_3411_94