@@ -17,7 +17,7 @@ To reproduce, run 'go mod vendor' in 'go/src'.
1717 .../github.com/golang-fips/openssl/v2/ecdh.go | 323 +++++++
1818 .../golang-fips/openssl/v2/ecdsa.go | 217 +++++
1919 .../golang-fips/openssl/v2/ed25519.go | 218 +++++
20- .../github.com/golang-fips/openssl/v2/evp.go | 471 +++++++++++
20+ .../github.com/golang-fips/openssl/v2/evp.go | 483 +++++++++++
2121 .../golang-fips/openssl/v2/goopenssl.c | 218 +++++
2222 .../golang-fips/openssl/v2/goopenssl.h | 255 ++++++
2323 .../github.com/golang-fips/openssl/v2/hash.go | 793 ++++++++++++++++++
@@ -61,7 +61,7 @@ To reproduce, run 'go mod vendor' in 'go/src'.
6161 .../internal/subtle/aliasing.go | 32 +
6262 .../internal/sysdll/sys_windows.go | 55 ++
6363 src/vendor/modules.txt | 11 +
64- 56 files changed, 9049 insertions(+)
64+ 56 files changed, 9061 insertions(+)
6565 create mode 100644 src/vendor/github.com/golang-fips/openssl/v2/.gitleaks.toml
6666 create mode 100644 src/vendor/github.com/golang-fips/openssl/v2/LICENSE
6767 create mode 100644 src/vendor/github.com/golang-fips/openssl/v2/README.md
@@ -1936,10 +1936,10 @@ index 00000000000000..f74bd8f8d7a993
19361936+ }
19371937diff --git a/src/vendor/github.com/golang-fips/openssl/v2/evp.go b/src/vendor/github.com/golang-fips/openssl/v2/evp.go
19381938new file mode 100644
1939- index 00000000000000..a9237a6a0ce9aa
1939+ index 00000000000000..ff07f5f55bf974
19401940--- /dev/null
19411941+++ b/src/vendor/github.com/golang-fips/openssl/v2/evp.go
1942- @@ -0,0 +1,471 @@
1942+ @@ -0,0 +1,483 @@
19431943+ //go:build !cmd_go_bootstrap
19441944+
19451945+ package openssl
@@ -1993,12 +1993,28 @@ index 00000000000000..a9237a6a0ce9aa
19931993+ return v.(C.GO_EVP_MD_PTR)
19941994+ }
19951995+ defer func() {
1996- + if md != nil && vMajor == 3 {
1997- + // On OpenSSL 3, directly operating on a EVP_MD object
1998- + // not created by EVP_MD_fetch has negative performance
1999- + // implications, as digest operations will have
2000- + // to fetch it on every call. Better to just fetch it once here.
2001- + md = C.go_openssl_EVP_MD_fetch(nil, C.go_openssl_EVP_MD_get0_name(md), nil)
1996+ + if md != nil {
1997+ + switch vMajor {
1998+ + case 1:
1999+ + // On OpenSSL 1 EVP_MD objects can be not-nil even
2000+ + // when they are not supported. We need to pass the md
2001+ + // to a EVP_MD_CTX to really know if they can be used.
2002+ + ctx := C.go_openssl_EVP_MD_CTX_new()
2003+ + if ctx != nil {
2004+ + if C.go_openssl_EVP_DigestInit_ex(ctx, md, nil) != 1 {
2005+ + md = nil
2006+ + }
2007+ + C.go_openssl_EVP_MD_CTX_free(ctx)
2008+ + }
2009+ + case 3:
2010+ + // On OpenSSL 3, directly operating on a EVP_MD object
2011+ + // not created by EVP_MD_fetch has negative performance
2012+ + // implications, as digest operations will have
2013+ + // to fetch it on every call. Better to just fetch it once here.
2014+ + md = C.go_openssl_EVP_MD_fetch(nil, C.go_openssl_EVP_MD_get0_name(md), nil)
2015+ + default:
2016+ + panic(errUnsupportedVersion())
2017+ + }
20022018+ }
20032019+ cacheMD.Store(ch, md)
20042020+ }()
@@ -2014,13 +2030,9 @@ index 00000000000000..a9237a6a0ce9aa
20142030+ }
20152031+ switch ch {
20162032+ case crypto.MD4:
2017- + if versionAtOrAbove(1, 1, 0) || !FIPS() {
2018- + return C.go_openssl_EVP_md4()
2019- + }
2033+ + return C.go_openssl_EVP_md4()
20202034+ case crypto.MD5:
2021- + if versionAtOrAbove(1, 1, 0) || !FIPS() {
2022- + return C.go_openssl_EVP_md5()
2023- + }
2035+ + return C.go_openssl_EVP_md5()
20242036+ case crypto.SHA1:
20252037+ return C.go_openssl_EVP_sha1()
20262038+ case crypto.SHA224:
@@ -9489,11 +9501,11 @@ index 00000000000000..1722410e5af193
94899501+ return getSystemDirectory() + "\\" + dll
94909502+ }
94919503diff --git a/src/vendor/modules.txt b/src/vendor/modules.txt
9492- index b8a0b84a282a32..3677388dc80929 100644
9504+ index b8a0b84a282a32..fa72eda0979db6 100644
94939505--- a/src/vendor/modules.txt
94949506+++ b/src/vendor/modules.txt
94959507@@ -1,3 +1,14 @@
9496- + # github.com/golang-fips/openssl/v2 v2.0.4-0.20240909165545-0a2f211a8f95
9508+ + # github.com/golang-fips/openssl/v2 v2.0.4-0.20241106131105-4bcac10661a9
94979509+ ## explicit; go 1.20
94989510+ github.com/golang-fips/openssl/v2
94999511+ github.com/golang-fips/openssl/v2/bbig
0 commit comments