There is one place, where libgcrypt is using SHA-1 by default. It is already gated by fips_mode() check, but I think it would make sense to move away from SHA-1 by default generally.
- cipher/pubkey-util.c: _gcry_pk_util_init_encoding_ctx -- sets default ctx->hash_algo to GCRY_MD_SHA1 unless in FIPS mode
It might be that the default is overridden in all the uses of this function (did not check that), but the following patch seems to work fine for me and tests keep passing for me locally:
diff --git a/cipher/pubkey-util.c b/cipher/pubkey-util.c index b41135e6..7229b76a 100644 --- a/cipher/pubkey-util.c +++ b/cipher/pubkey-util.c @@ -629,14 +629,7 @@ _gcry_pk_util_init_encoding_ctx (struct pk_encoding_ctx *ctx, ctx->nbits = nbits; ctx->encoding = PUBKEY_ENC_UNKNOWN; ctx->flags = 0; - if (fips_mode ()) - { - ctx->hash_algo = GCRY_MD_SHA256; - } - else - { - ctx->hash_algo = GCRY_MD_SHA1; - } + ctx->hash_algo = GCRY_MD_SHA256; ctx->label = NULL; ctx->labellen = 0; ctx->saltlen = 20;