Skip to content

Commit

Permalink
fix openssl 3
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Dec 20, 2024
1 parent 46e049c commit 170f517
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion evp.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ func loadHash(ch crypto.Hash) *hashAlgorithm {
hash.ch = ch
hash.size = int(C.go_openssl_EVP_MD_get_size(hash.md))
hash.blockSize = int(C.go_openssl_EVP_MD_get_block_size(hash.md))
hash.marshallable = isHashMarshallable(hash.md)
if vMajor == 3 {
// On OpenSSL 3, directly operating on a EVP_MD object
// not created by EVP_MD_fetch has negative performance
Expand All @@ -169,6 +168,7 @@ func loadHash(ch crypto.Hash) *hashAlgorithm {
hash.md = md
}
}
hash.marshallable = isHashMarshallable(hash.md)
cacheMD.Store(ch, &hash)
return &hash
}
Expand Down

0 comments on commit 170f517

Please sign in to comment.