From caaa0204b86959f49687a3bbccd87994d9bf3fa6 Mon Sep 17 00:00:00 2001 From: Steve Moyer Date: Tue, 8 Jul 2025 09:42:09 -0400 Subject: [PATCH] fix(hash): HashAlgorithmUnspecified should not be ok --- constant.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/constant.go b/constant.go index 07c2a69..baf4095 100644 --- a/constant.go +++ b/constant.go @@ -37,11 +37,10 @@ func DecodeHashAlgorithm(r *bytes.Reader) (HashAlgorithm, error) { h := HashAlgorithm(u) if _, ok := map[HashAlgorithm]struct{}{ - HashAlgorithmUnspecified: {}, - HashAlgorithmSHA256: {}, - HashAlgorithmSHA384: {}, - HashAlgorithmSHA512: {}, - HashAlgorithmShake256: {}, + HashAlgorithmSHA256: {}, + HashAlgorithmSHA384: {}, + HashAlgorithmSHA512: {}, + HashAlgorithmShake256: {}, }[h]; !ok { return HashAlgorithmUnspecified, fmt.Errorf("%w: %x", ErrUnknownHashAlgorithm, h) }