diff --git a/disable_static_tests_part1.patch b/disable_static_tests_part1.patch index 4b27846681acf3310f333cbd2f8e1cffd58457c5..2f1adc0465bef7313c8bd24deef504b8346e61e7 100644 --- a/disable_static_tests_part1.patch +++ b/disable_static_tests_part1.patch @@ -1,18 +1,18 @@ -diff --git a/src/crypto/boring/boring.go b/src/crypto/boring/boring.go -index 47618fe..d93784d 100644 ---- a/src/crypto/boring/boring.go -+++ b/src/crypto/boring/boring.go -@@ -2,7 +2,7 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build boringcrypto -+//go:build boringcrypto && !static - - // Package boring exposes functions that are only available when building with - // Go+BoringCrypto. This package is available on all targets as long as the +From 24aac090069f79307aeceb8362f60a3cc5e60f7f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= +Date: Fri, 3 May 2024 17:25:19 +0200 +Subject: [PATCH] disable_static_tests_part1 + +--- + src/crypto/internal/backend/nobackend.go | 4 ++-- + src/crypto/internal/backend/openssl.go | 4 ++-- + src/crypto/internal/boring/goboringcrypto.h | 1 + + src/crypto/internal/boring/syso/syso.go | 2 +- + src/vendor/github.com/golang-fips/openssl/v2/goopenssl.h | 1 + + 5 files changed, 7 insertions(+), 5 deletions(-) + diff --git a/src/crypto/internal/backend/nobackend.go b/src/crypto/internal/backend/nobackend.go -index 33a53a8..f630ea5 100644 +index 5b0e356dff..a2e17f7fa5 100644 --- a/src/crypto/internal/backend/nobackend.go +++ b/src/crypto/internal/backend/nobackend.go @@ -2,8 +2,8 @@ @@ -21,13 +21,13 @@ index 33a53a8..f630ea5 100644 -//go:build !linux || !cgo || android || cmd_go_bootstrap || msan || no_openssl -// +build !linux !cgo android cmd_go_bootstrap msan no_openssl -+//go:build !linux || !cgo || android || cmd_go_bootstrap || msan || no_openssl || static -+// +build !linux !cgo android cmd_go_bootstrap msan no_openssl static ++//go:build !linux || !cgo || android || cmd_go_bootstrap || msan || no_openssl || static || static ++// +build !linux !cgo android cmd_go_bootstrap msan no_openssl static static package backend diff --git a/src/crypto/internal/backend/openssl.go b/src/crypto/internal/backend/openssl.go -index 59370ec..eb81ef6 100644 +index 3d3a9a36ee..7e32d3b0fa 100644 --- a/src/crypto/internal/backend/openssl.go +++ b/src/crypto/internal/backend/openssl.go @@ -2,8 +2,8 @@ @@ -41,18 +41,8 @@ index 59370ec..eb81ef6 100644 // Package openssl provides access to OpenSSLCrypto implementation functions. // Check the variable Enabled to find out whether OpenSSLCrypto is available. -diff --git a/src/crypto/internal/boring/div_test.c b/src/crypto/internal/boring/div_test.c -index f909cc9..8530533 100644 ---- a/src/crypto/internal/boring/div_test.c -+++ b/src/crypto/internal/boring/div_test.c -@@ -1,4 +1,5 @@ - // Copyright 2022 The Go Authors. All rights reserved. -+// +build !static - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - diff --git a/src/crypto/internal/boring/goboringcrypto.h b/src/crypto/internal/boring/goboringcrypto.h -index 2b11049..dec1cb2 100644 +index 2b11049728..dec1cb2851 100644 --- a/src/crypto/internal/boring/goboringcrypto.h +++ b/src/crypto/internal/boring/goboringcrypto.h @@ -1,4 +1,5 @@ @@ -62,7 +52,7 @@ index 2b11049..dec1cb2 100644 // license that can be found in the LICENSE file. diff --git a/src/crypto/internal/boring/syso/syso.go b/src/crypto/internal/boring/syso/syso.go -index b338754..db5ea1e 100644 +index b3387545e6..db5ea1e3d9 100644 --- a/src/crypto/internal/boring/syso/syso.go +++ b/src/crypto/internal/boring/syso/syso.go @@ -2,7 +2,7 @@ @@ -74,301 +64,16 @@ index b338754..db5ea1e 100644 // This package only exists with GOEXPERIMENT=boringcrypto. // It provides the actual syso file. -diff --git a/src/crypto/tls/fipsonly/fipsonly.go b/src/crypto/tls/fipsonly/fipsonly.go -index e5e4783..a0d9523 100644 ---- a/src/crypto/tls/fipsonly/fipsonly.go -+++ b/src/crypto/tls/fipsonly/fipsonly.go -@@ -2,7 +2,7 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build boringcrypto -+//go:build boringcrypto && !static - - // Package fipsonly restricts all TLS configuration to FIPS-approved settings. - // -diff --git a/src/crypto/tls/fipsonly/fipsonly_test.go b/src/crypto/tls/fipsonly/fipsonly_test.go -index f8485dc..6563ac4 100644 ---- a/src/crypto/tls/fipsonly/fipsonly_test.go -+++ b/src/crypto/tls/fipsonly/fipsonly_test.go -@@ -2,7 +2,7 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build boringcrypto -+//go:build boringcrypto && !static - - package fipsonly - -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/aes.go b/src/vendor/github.com/golang-fips/openssl/openssl/aes.go -index 079fc3c..e826d0b 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/aes.go -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/aes.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/ecdh.go b/src/vendor/github.com/golang-fips/openssl/openssl/ecdh.go -index 9537870..c491628 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/ecdh.go -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/ecdh.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/ecdsa.go b/src/vendor/github.com/golang-fips/openssl/openssl/ecdsa.go -index 9f46388..87feb18 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/ecdsa.go -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/ecdsa.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/evp.go b/src/vendor/github.com/golang-fips/openssl/openssl/evp.go -index 46d2bdd..34f4a43 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/evp.go -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/evp.go -@@ -1,5 +1,5 @@ --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/goopenssl.h b/src/vendor/github.com/golang-fips/openssl/openssl/goopenssl.h -index ac6c64f..5526db9 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/goopenssl.h -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/goopenssl.h -@@ -1,4 +1,5 @@ - // Copyright 2017 The Go Authors. All rights reserved. -+// +build !static - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - // +build linux -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/hkdf.go b/src/vendor/github.com/golang-fips/openssl/openssl/hkdf.go -index 2e21224..83da261 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/hkdf.go -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/hkdf.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/hmac.go b/src/vendor/github.com/golang-fips/openssl/openssl/hmac.go -index 3af1924..57a525a 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/hmac.go -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/hmac.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/notboring.go b/src/vendor/github.com/golang-fips/openssl/openssl/notboring.go -index 5093cde..0610495 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/notboring.go -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/notboring.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build !linux || !cgo || android || cmd_go_bootstrap || msan || no_openssl --// +build !linux !cgo android cmd_go_bootstrap msan no_openssl -+//go:build !linux || !cgo || android || cmd_go_bootstrap || msan || no_openssl || static -+// +build !linux !cgo android cmd_go_bootstrap msan no_openssl static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/openssl.go b/src/vendor/github.com/golang-fips/openssl/openssl/openssl.go -index 17a9034..db51ced 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/openssl.go -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/openssl.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_ecdsa_signature.c b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_ecdsa_signature.c -index 7ce9833..fe66288 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_ecdsa_signature.c -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_ecdsa_signature.c -@@ -1,4 +1,5 @@ - // +build linux -+// +build !static - // +build !android - // +build !no_openssl - // +build !cmd_go_bootstrap -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_evp.c b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_evp.c -index a45ed60..2b541fd 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_evp.c -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_evp.c -@@ -1,4 +1,5 @@ - // +build linux -+// +build !static - // +build !android - // +build !no_openssl - // +build !cmd_go_bootstrap -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_lock_setup.c b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_lock_setup.c -index 49d40a7..3b3dbf8 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_lock_setup.c -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_lock_setup.c -@@ -1,4 +1,5 @@ - // +build linux -+// +build !static - // +build !android - // +build !no_openssl - // +build !cmd_go_bootstrap -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_aead_gcm.c b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_aead_gcm.c -index 7eb645e..1c3225a 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_aead_gcm.c -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_aead_gcm.c +diff --git a/src/vendor/github.com/golang-fips/openssl/v2/goopenssl.h b/src/vendor/github.com/golang-fips/openssl/v2/goopenssl.h +index e488bf2014..e776aa46a3 100644 +--- a/src/vendor/github.com/golang-fips/openssl/v2/goopenssl.h ++++ b/src/vendor/github.com/golang-fips/openssl/v2/goopenssl.h @@ -1,4 +1,5 @@ - // This file contains a port of the BoringSSL AEAD interface. + // This header file describes the OpenSSL ABI as built for use in Go. +// +build !static - // +build linux - // +build !android - // +build !no_openssl -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_ctr128.c b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_ctr128.c -index df4ebe3..876393b 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_ctr128.c -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_ctr128.c -@@ -1,4 +1,5 @@ - // +build linux -+// +build !static - // +build !android - // +build !no_openssl - // +build !cmd_go_bootstrap -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_ecdh.c b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_ecdh.c -index 8205b04..dcd751d 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_ecdh.c -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_ecdh.c -@@ -1,4 +1,5 @@ - // +build linux -+// +build !static - // +build !android - // +build !no_openssl - // +build !cmd_go_bootstrap -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_evp_md5_sha1.c b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_evp_md5_sha1.c -index 2eedd5b..04510d3 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_evp_md5_sha1.c -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_evp_md5_sha1.c -@@ -1,4 +1,5 @@ - // This file contains a backport of the EVP_md5_sha1 method. -+// +build !static - // +build linux - // +build !android - // +build !no_openssl -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_hmac.c b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_hmac.c -index a5996d6..2552081 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_hmac.c -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_hmac.c -@@ -1,4 +1,5 @@ - // This file contains HMAC portability wrappers. -+// +build !static - // +build linux - // +build !android - // +build !no_openssl -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_rsa.c b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_rsa.c -index e214929..c9f6887 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_rsa.c -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_rsa.c -@@ -1,4 +1,5 @@ - // This file contains RSA portability wrappers. -+// +build !static - // +build linux - // +build !android - // +build !no_openssl -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_stub_rand.c b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_stub_rand.c -index 22bd865..b7aa26b 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_stub_rand.c -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_stub_rand.c -@@ -1,4 +1,5 @@ - // +build linux -+// +build !static - // +build !android - // +build !no_openssl - // +build !cmd_go_bootstrap -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/rand.go b/src/vendor/github.com/golang-fips/openssl/openssl/rand.go -index b3668b8..dcdae70 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/rand.go -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/rand.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/rsa.go b/src/vendor/github.com/golang-fips/openssl/openssl/rsa.go -index 7870b93..564db24 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/rsa.go -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/rsa.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/sha.go b/src/vendor/github.com/golang-fips/openssl/openssl/sha.go -index 0b55ced..57309c0 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/sha.go -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/sha.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - package openssl + #include // size_t +-- +2.44.0 + diff --git a/download b/download index c5b87bd4dd089680a0ce0e6cc250854bd48eac0a..9d369dddb633594eeda9bc1e4d04122e99df474e 100644 --- a/download +++ b/download @@ -1,2 +1,2 @@ -935e449500b0166e4e1add33d4b7b429 go1.21.13-4-openssl-fips.tar.gz -cd42cf6c19e5e7af54e4824c0f474334 go1.21.13.tar.gz +1bd75acc99ef3b43897788100ac47c04 go1.22.7-1-openssl-fips.tar.gz +0a1f6beefb03eb82bb89a9dd2092c6d6 go1.22.7.tar.gz diff --git a/evp-digest-sign-final.patch b/evp-digest-sign-final.patch deleted file mode 100644 index 928f7070b8bd0ab18970d4ca5568d66d0881a8f8..0000000000000000000000000000000000000000 --- a/evp-digest-sign-final.patch +++ /dev/null @@ -1,92 +0,0 @@ -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/goopenssl.h b/src/vendor/github.com/golang-fips/openssl/openssl/goopenssl.h -index ac6c64f86d..5213b841dc 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/goopenssl.h -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/goopenssl.h -@@ -264,7 +264,7 @@ int _goboringcrypto_HMAC_Update(GO_HMAC_CTX *ctx, - int _goboringcrypto_HMAC_CTX_reset(GO_HMAC_CTX *ctx); - void _goboringcrypto_HMAC_CTX_free(GO_HMAC_CTX *ctx); - int _goboringcrypto_HMAC_Final(GO_HMAC_CTX *ctx, -- unsigned char *md, unsigned int *len); -+ unsigned char *md, unsigned int len); - - #include - #include -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/hmac.go b/src/vendor/github.com/golang-fips/openssl/openssl/hmac.go -index 3af1924884..c76d6690aa 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/hmac.go -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/hmac.go -@@ -121,7 +121,9 @@ func (h *boringHMAC) finalize() { - - func (h *boringHMAC) Write(p []byte) (int, error) { - if len(p) > 0 { -- C._goboringcrypto_HMAC_Update(h.ctx, (*C.uint8_t)(unsafe.Pointer(&p[0])), C.size_t(len(p))) -+ if C._goboringcrypto_HMAC_Update(h.ctx, (*C.uint8_t)(unsafe.Pointer(&p[0])), C.size_t(len(p))) == 0 { -+ panic("boringcrypto: HMAC_Update failed") -+ } - } - runtime.KeepAlive(h) - return len(p), nil -@@ -136,10 +138,12 @@ func (h *boringHMAC) BlockSize() int { - } - - func (h *boringHMAC) Sum(in []byte) []byte { -+ size := h.Size() - if h.sum == nil { -- size := h.Size() - h.sum = make([]byte, size) - } -- C._goboringcrypto_HMAC_Final(h.ctx, (*C.uint8_t)(unsafe.Pointer(&h.sum[0])), nil) -+ if C._goboringcrypto_HMAC_Final(h.ctx, (*C.uint8_t)(unsafe.Pointer(&h.sum[0])), C.uint(size)) == 0 { -+ panic("boringcrypto: HMAC_Final failed") -+ } - return append(in, h.sum...) - } -diff --git a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_hmac.c b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_hmac.c -index d26ce90c82..f7dabb25e0 100644 ---- a/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_hmac.c -+++ b/src/vendor/github.com/golang-fips/openssl/openssl/openssl_port_hmac.c -@@ -115,10 +115,10 @@ void _goboringcrypto_HMAC_CTX_free(GO_HMAC_CTX *ctx) - } - - int _goboringcrypto_HMAC_Final(GO_HMAC_CTX *ctx, -- unsigned char *md, unsigned int *len) -+ unsigned char *md, unsigned int len) - { - EVP_MD_CTX *mdctx = NULL; -- size_t slen; -+ size_t slen = len; - int ret = 0; - - mdctx = _goboringcrypto_EVP_MD_CTX_create(); -@@ -128,9 +128,10 @@ int _goboringcrypto_HMAC_Final(GO_HMAC_CTX *ctx, - if (_goboringcrypto_internal_EVP_MD_CTX_copy_ex(mdctx, ctx->mdctx) != 1) - goto err; - -- ret = _goboringcrypto_EVP_DigestSignFinal(mdctx, md, &slen); -- if (ret == 1 && len) -- *len = slen; -+ if (_goboringcrypto_EVP_DigestSignFinal(mdctx, md, &slen) != 1) -+ goto err; -+ -+ ret = 1; - - err: - _goboringcrypto_EVP_MD_CTX_free(mdctx); -@@ -219,7 +220,7 @@ void _goboringcrypto_HMAC_CTX_free(GO_HMAC_CTX *ctx) - } - - int _goboringcrypto_HMAC_Final(GO_HMAC_CTX *ctx, -- unsigned char *md, unsigned int *len) -+ unsigned char *md, unsigned int len) - { - HMAC_CTX hctx; - int ret; -@@ -228,7 +229,7 @@ int _goboringcrypto_HMAC_Final(GO_HMAC_CTX *ctx, - if (ret != 1) - return ret; - -- ret = _goboringcrypto_internal_HMAC_Final(&hctx, md, len); -+ ret = _goboringcrypto_internal_HMAC_Final(&hctx, md, &len); - _goboringcrypto_internal_HMAC_CTX_cleanup(&hctx); - return ret; - } diff --git a/golang.spec b/golang.spec index 185830fe786e1fd6691a151a5638115018f53b1f..2dc1a89d53906f87c89fb1a65d41bcb99df6ff41 100644 --- a/golang.spec +++ b/golang.spec @@ -30,20 +30,20 @@ # Define GOROOT macros %global goroot %{_prefix}/lib/%{name} %global gopath %{_datadir}/gocode -%global golang_arches x86_64 aarch64 ppc64le s390x loongarch64 +%global golang_arches x86_64 aarch64 ppc64le s390x %global golibdir %{_libdir}/%{name} # Golang build options. # Build golang using external/internal(close to cgo disabled) linking. -%ifarch x86_64 ppc64le %{arm} aarch64 s390x loongarch64 +%ifarch x86_64 ppc64le %{arm} aarch64 s390x %global external_linker 1 %else %global external_linker 0 %endif # Build golang with cgo enabled/disabled(later equals more or less to internal linking). -%ifarch x86_64 ppc64le %{arm} aarch64 s390x loongarch64 +%ifarch x86_64 ppc64le %{arm} aarch64 s390x %global cgo_enabled 1 %else %global cgo_enabled 0 @@ -57,7 +57,7 @@ %endif # Controls what ever we fail on failed tests -%ifarch x86_64 %{arm} ppc64le s390x loongarch64 +%ifarch x86_64 %{arm} ppc64le s390x %global fail_on_tests 1 %else %global fail_on_tests 0 @@ -91,17 +91,14 @@ %ifarch s390x %global gohostarch s390x %endif -%ifarch loongarch64 -%global gohostarch loong64 -%endif -%global go_api 1.21 -%global version 1.21.13 -%global pkg_release 4 +%global go_api 1.22 +%global version 1.22.7 +%global pkg_release 1 Name: golang Version: %{version} -Release: 3%{anolis_release}%{?dist} +Release: 1%{anolis_release}%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -118,10 +115,6 @@ Source1: https://github.com/golang-fips/go/archive/refs/tags/go%{version}- # make possible to override default traceback level at build time by setting build tag rpm_crashtraceback Source2: fedora.go -Source3: loongarch64.tar.gz -Source4: loongarch64.patches -Source5: race_linux_loong64.syso - # The compiler is written in Go. Needs go(1.4+) compiler for build. # Actual Go based bootstrap compiler provided by above source. %if !%{golang_bootstrap} @@ -153,7 +146,7 @@ Patch1939923: skip_test_rhbz1939923.patch Patch2: disable_static_tests_part1.patch Patch3: disable_static_tests_part2.patch Patch5: modify_go.env.patch -Patch6: evp-digest-sign-final.patch +Patch7: skip_TestCrashDumpsAllThreads.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -253,8 +246,8 @@ popd patch_dir="../go-go%{version}-%{pkg_release}-openssl-fips/patches" # Add --no-backup-if-mismatch option to avoid creating .orig temp files for p in "$patch_dir"/*.patch; do - echo "Applying $p" - patch -p1 --no-backup-if-mismatch < $p + echo "Applying $p" + patch -p1 --no-backup-if-mismatch < $p done # Configure crypto tests @@ -263,21 +256,11 @@ ln -s ../go-go%{version} go ./scripts/configure-crypto-tests.sh popd -## Apply loongarch64 patches -tar xf %{SOURCE3} -for p in $(cat %{SOURCE4}); do - patch -p1 -s -i loongarch64/$p -done - -## Delete loongarch64 directory -rm -rf loongarch64 - %autopatch -p1 sed -i '1s/$/ (%{?rhel:Red Hat} %{version}-%{release})/' VERSION cp %{SOURCE2} ./src/runtime/ -cp %{SOURCE5} ./src/runtime/race %build set -xe @@ -472,11 +455,12 @@ export DISABLE_BoringCertAlgs_TEST="-run=!^TestBoringCertAlgs$" # Run tests with FIPS enabled. export GOLANG_FIPS=1 +export OPENSSL_FORCE_FIPS_MODE=1 pushd crypto # Run all crypto tests but skip TLS, we will run FIPS specific TLS tests later - go test $(go list ./... | grep -v tls) -v + go test -timeout 50m $(go list ./... | grep -v tls) -v # Check that signature functions have parity between boring and notboring - CGO_ENABLED=0 go test $(go list ./... | grep -v tls) -v + CGO_ENABLED=0 go test -timeout 50m $(go list ./... | grep -v tls) -v popd # Run all FIPS specific TLS tests pushd crypto/tls @@ -540,40 +524,52 @@ cd .. %endif %changelog -* Thu Oct 3 2024 Liwei Ge - 1.21.13-3.0.1 -- Fix CVE-2024-9355 - -* Tue Sep 24 2024 Chang Gao - 1.21.13-2.0.1 +* Wed Nov 06 2024 Chang Gao - 1.22.7-1.0.1 - disable DISABLE_BoringCertAlgs_TEST test -- Add LoongArch64 support (limeidan@loongsonc.cn) -* Mon Sep 16 2024 David Benoit - 1.21.13-2 -- Rebuild Go with CVE Fixes -- Remove fix-memleak-setupRSA.patch (exists upstream) +* Mon Sep 16 2024 David Benoit - 1.22.7-1 +- Update to Go 1.22.7 - Resolves: RHEL-58223 - Resolves: RHEL-57961 - Resolves: RHEL-57847 - Resolves: RHEL-57860 -* Wed Aug 21 2024 Archana - 1.21.13-1 -- Update to Go1.21.13 to fix CVE-2024-24791 -- Resolves: RHEL-47198 - -* Wed Jun 12 2024 Archana Ravindar - 1.21.11-1 -- Update to Go1.21.11 to address CVE-2024-24789 and CVE-2024-24790 -- Resolves: RHEL-40274 - -* Thu May 23 2024 David Benoit - 1.21.10 -- Update to Go 1.21.10 -- Resolves: RHEL-36993 - -* Fri Apr 12 2024 David Benoit - 1.21.9-1 -- Fix CVE-2023-45288 -- Resolves: RHEL-31915 - -* Mon Apr 1 2024 Archana Ravindar - 1.21.7-2 -- Fix CVE-2024-1394 -- Resolves RHEL-24300 +* Fri Sep 06 2024 Archana - 1.22.5-3 +- Update fix that loads Openssl in FIPS mode if fips==1 +- Related: RHEL-52485 + +* Mon Sep 02 2024 Archana - 1.22.5-2 +- Include fix that loads Openssl only in FIPS mode to avoid panic +- Resolves: RHEL-52485 + +* Fri Jul 12 2024 Archana - 1.22.5-1 +- Rebase to Go1.22.5 to fix CVE-2024-24791 +- Resolves: RHEL-46972 + +* Fri Jun 07 2024 Archana - 1.22.4-1 +- Addresses CVEs-2024-24789 and CVE-2024-24790 +- Resolves: RHEL-40157 + +* Thu May 30 2024 Derek Parker - 1.22.3-3 +- Update openssl backend +- Resolves: RHEL-36102 + +* Thu May 23 2024 Derek Parker - 1.22.3-2 +- Restore HashSign / HashVerify API +- Resolves: RHEL-35884 + +* Thu May 23 2024 David Benoit - 1.22.3-1 +- Update to Go 1.22.3 +- Resolves: RHEL-35884 +- Resolves: RHEL-35075 +- Resolves: RHEL-35632 +- Resolves: RHEL-35901 + +* Thu May 02 2024 Alejandro Sáez - 1.22.2-1 +- Rebase to 1.22.2 +- Re-enable CGO +- Skip TestCrashDumpsAllThreads +- Resolves: RHEL-33157 * Tue Feb 13 2024 Alejandro Sáez - 1.21.7-1 - Rebase to Go 1.21.7 diff --git a/loongarch64.patches b/loongarch64.patches deleted file mode 100644 index a6a2cf4fdfcd8724164deb8d18334bf131622270..0000000000000000000000000000000000000000 --- a/loongarch64.patches +++ /dev/null @@ -1,53 +0,0 @@ -0001-oldabi-fix-misc-cgo-test-sigaltstack-size-on-loong64.patch -0002-oldabi-fix-mabi-to-lp64-for-loong64.patch -0003-oldabi-fix-runtime-defs_linux_loong64.patch -0004-oldabi-fix-test-issue11656-for-loong64.patch -0005-oldabi-fixup-stack-growth-after-fork-in-runtime.sigf.patch -0006-oldabi-cmd-internal-obj-loong64-cmd-link-internal-sw.patch -0007-cmd-dist-cmd-link-internal-runtime-add-buildmode-plu.patch -0008-runtime-cmd-go-enable-memory-sanitizer-on-linux-loon.patch -0009-runtime-cmd-go-enable-address-sanitizer-on-linux-loo.patch -0010-internal-sysinfo-print-cpu-type-from-cpuinfo-when-in.patch -0011-cmd-cmd-vendor-pick-up-updates-for-golang.org-x-arch.patch -0012-cmd-internal-objfile-add-loong64-disassembler-suppor.patch -0013-runtime-remove-the-meaningless-offset-of-8-for-duffz.patch -0014-cmd-compiler-remove-the-meaningless-offset-of-8-for-.patch -0015-cmd-internal-obj-loong64-add-atomic-memory-access-in.patch -0016-cmd-compiler-runtime-internal-atomic-optimize-xchg-a.patch -0017-cmd-compiler-runtime-internal-atomic-optimize-xadd-a.patch -0018-cmd-compiler-runtime-internal-atomic-optimize-And-32.patch -0019-cmd-compiler-runtime-internal-atomic-Implementing-xc.patch -0020-cmd-compiler-runtime-internal-atomic-Implementing-xa.patch -0021-cmd-compiler-runtime-internal-atomic-Implementing-An.patch -0022-cmd-internal-obj-loong64-remove-the-invalid-plan9-fo.patch -0023-cmd-internal-obj-loong64-correct-the-instruction-for.patch -0024-cmd-internal-obj-loong64-recheck-jump-offset-boundar.patch -0025-runtime-fix-the-vDSO-symbol-version-for-kernel-4.19-.patch -0026-cmd-link-internal-loadelf-correct-the-relocation-siz.patch -0027-cmd-compile-cmd-internal-runtime-change-the-register.patch -0028-cmd-compile-add-ABI-register-definations-for-loong64.patch -0029-cmd-compile-cmd-internal-runtime-change-registers-on.patch -0030-internal-abi-define-loong64-regABI-constants.patch -0031-cmd-compile-internal-add-register-info-for-loong64-r.patch -0032-cmd-compile-internal-add-spill-support-for-loong64-r.patch -0033-cmd-compile-update-loong64-CALL-ops.patch -0034-runtime-make-duff-device-as-ABIInternal-for-loong64.patch -0035-runtime-support-regABI-and-add-spill-functions-in-ru.patch -0036-reflect-runtime-add-reflect-support-for-regABI-on-lo.patch -0037-internal-bytealg-add-regABI-support-in-bytealg-funct.patch -0038-runtime-add-regABI-support-in-memclr-and-memmove-fun.patch -0039-cmd-internal-obj-set-morestack-arg-spilling-and-rega.patch -0040-cmd-compile-fix-If-lowering-on-loong64.patch -0041-runtime-internal-syscall-use-ABIInternal-for-Syscall.patch -0042-cmd-compile-internal-buildcfg-enable-regABI-on-loong.patch -0043-internal-abi-internal-buildcfg-always-enable-registe.patch -0044-all-delete-loong64-non-register-ABI-fallback-path.patch -0045-cmd-internal-obj-loong64-using-LookupABI-to-find-duf.patch -0046-cmd-internal-cmd-link-unify-the-relocation-nameing-s.patch -0047-oldabi-fix-the-definition-of-members-in-the-PtraceRe.patch -0048-cmd-internal-obj-loong64-remove-unused-register-alia.patch -0049-cmd-internal-runtime-change-the-LR-parameter-registe.patch -0050-cmd-dist-update-isUnsupportedVMASize-test-skip.patch -0051-cmd-runtime-enable-race-detector-on-loong64.patch -0052-runtime-Mark-race-functions-on-loong64-as-ABInternal.patch -0053-runtime-delete-on-register-ABI-fallback-path-for-rac.patch diff --git a/loongarch64.tar.gz b/loongarch64.tar.gz deleted file mode 100644 index 1e1ffdb61286e89addb2d9e7f92e9191435fe413..0000000000000000000000000000000000000000 Binary files a/loongarch64.tar.gz and /dev/null differ diff --git a/race_linux_loong64.syso b/race_linux_loong64.syso deleted file mode 100644 index 0b51b02dbfc4bc98a4688e864eb5c23500104c68..0000000000000000000000000000000000000000 Binary files a/race_linux_loong64.syso and /dev/null differ diff --git a/skip_TestCrashDumpsAllThreads.patch b/skip_TestCrashDumpsAllThreads.patch new file mode 100644 index 0000000000000000000000000000000000000000..92e7eca403223489033f07cf854d8d246f719611 --- /dev/null +++ b/skip_TestCrashDumpsAllThreads.patch @@ -0,0 +1,27 @@ +From fdcaf4e6876cfd910c3da672564be4a6e829047c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= +Date: Wed, 27 Mar 2024 17:15:48 +0100 +Subject: [PATCH] Skip TestCrashDumpsAllThreads + +--- + src/runtime/crash_unix_test.go | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/runtime/crash_unix_test.go b/src/runtime/crash_unix_test.go +index 123a462423..a0034d6455 100644 +--- a/src/runtime/crash_unix_test.go ++++ b/src/runtime/crash_unix_test.go +@@ -74,6 +74,10 @@ func TestCrashDumpsAllThreads(t *testing.T) { + t.Skip("skipping; SIGQUIT is blocked, see golang.org/issue/19196") + } + ++ if runtime.GOOS == "linux" && runtime.GOARCH == "s390x" { ++ t.Skip("skipping; frequent TestCrashDumpsAllThreads failures on linux/s390x, see golang.org/issue/64650") ++ } ++ + testenv.MustHaveGoBuild(t) + + if strings.Contains(os.Getenv("GOFLAGS"), "mayMoreStackPreempt") { +-- +2.44.0 +