import UBI golang-1.22.7-2.el9_5

This commit is contained in:
eabdullin 2024-11-12 10:16:31 +00:00
parent 8694298a93
commit d3bc2f207e
9 changed files with 170 additions and 577 deletions

5
.gitignore vendored
View File

@ -1,2 +1,3 @@
SOURCES/go1.21.13-4-openssl-fips.tar.gz
SOURCES/go1.21.13.tar.gz
SOURCES/compiler-rt-18.1.8.src.tar.xz
SOURCES/go1.22.7-1-openssl-fips.tar.gz
SOURCES/go1.22.7.tar.gz

View File

@ -1,2 +1,3 @@
cfcfc208c18ecffcebe3d6218537f495eb555395 SOURCES/go1.21.13-4-openssl-fips.tar.gz
a6aa471b6f806146bbd4ffec11b70ca834421a2e SOURCES/go1.21.13.tar.gz
6ecbfa5516b60adb4e4e60f991b0d8ddf5aab12a SOURCES/compiler-rt-18.1.8.src.tar.xz
24ccd6e12b48b3cfcde1aa22c520a2b2442cdb77 SOURCES/go1.22.7-1-openssl-fips.tar.gz
e9e79942f2469597a86d07dd01282e44811bc5f0 SOURCES/go1.22.7.tar.gz

View File

@ -1,374 +0,0 @@
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
diff --git a/src/crypto/internal/backend/nobackend.go b/src/crypto/internal/backend/nobackend.go
index 33a53a8..f630ea5 100644
--- a/src/crypto/internal/backend/nobackend.go
+++ b/src/crypto/internal/backend/nobackend.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 backend
diff --git a/src/crypto/internal/backend/openssl.go b/src/crypto/internal/backend/openssl.go
index 59370ec..eb81ef6 100644
--- a/src/crypto/internal/backend/openssl.go
+++ b/src/crypto/internal/backend/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 && cgo && !android && !gocrypt && !cmd_go_bootstrap && !msan && !no_openssl
-// +build linux,cgo,!android,!gocrypt,!cmd_go_bootstrap,!msan,!no_openssl
+//go:build linux && cgo && !android && !gocrypt && !cmd_go_bootstrap && !msan && !no_openssl && !static
+// +build linux,cgo,!android,!gocrypt,!cmd_go_bootstrap,!msan,!no_openssl,!static
// 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
--- a/src/crypto/internal/boring/goboringcrypto.h
+++ b/src/crypto/internal/boring/goboringcrypto.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.
diff --git a/src/crypto/internal/boring/syso/syso.go b/src/crypto/internal/boring/syso/syso.go
index b338754..db5ea1e 100644
--- a/src/crypto/internal/boring/syso/syso.go
+++ b/src/crypto/internal/boring/syso/syso.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
// 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
@@ -1,4 +1,5 @@
// This file contains a port of the BoringSSL AEAD interface.
+// +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

View File

@ -1,13 +0,0 @@
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index 36a20e8b2a..8c2dd1b44b 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -1125,7 +1125,7 @@ func (t *tester) registerCgoTests(heading string) {
} else {
panic("unknown linkmode with static build: " + linkmode)
}
- gt.tags = append(gt.tags, "static")
+ gt.tags = append(gt.tags, "static", "no_openssl")
}
gt.ldflags = strings.Join(ldflags, " ")

View File

@ -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 <openssl/evp.h>
#include <openssl/aes.h>
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;
}

View File

@ -1,22 +1,27 @@
From eab9004c072200e58df83ab94678bda1faa7b229 Mon Sep 17 00:00:00 2001
From d6e201910aa29262851c9274a4cd3645022d3539 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= <asm@redhat.com>
Date: Fri, 9 Feb 2024 20:06:16 +0100
Subject: [PATCH] Set GOTOOLCHAIN to local
Date: Tue, 9 Apr 2024 10:05:46 +0200
Subject: [PATCH] Modify environment variables defaults
- Set GOTOOLCHAIN to local
- Set GOAMD64 to v2
---
go.env | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
go.env | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/go.env b/go.env
index 6ff2b921d4..e87f6e7b6d 100644
index 6ff2b921d4..aadcda023b 100644
--- a/go.env
+++ b/go.env
@@ -9,4 +9,4 @@ GOSUMDB=sum.golang.org
@@ -9,4 +9,7 @@ GOSUMDB=sum.golang.org
# Automatically download newer toolchains as directed by go.mod files.
# See https://go.dev/doc/toolchain for details.
-GOTOOLCHAIN=auto
+GOTOOLCHAIN=local
+
+# The AMD64 baseline for RHEL9 is v2.
+GOAMD64=v2
--
2.43.0
2.44.0

View File

@ -0,0 +1,27 @@
From fdcaf4e6876cfd910c3da672564be4a6e829047c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= <asm@redhat.com>
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

View File

@ -1,26 +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..e908c1385b 100644
--- a/src/vendor/github.com/golang-fips/openssl/openssl/goopenssl.h
+++ b/src/vendor/github.com/golang-fips/openssl/openssl/goopenssl.h
@@ -825,6 +825,9 @@ _goboringcrypto_EVP_PKEY_CTX_set_rsa_keygen_bits(GO_EVP_PKEY_CTX *ctx, int mbits
mbits, NULL);
}
+
+
+#if OPENSSL_VERSION_NUMBER < 0x30000000
static inline int
_goboringcrypto_EVP_PKEY_CTX_set_rsa_keygen_pubexp(GO_EVP_PKEY_CTX *ctx, GO_BIGNUM *pubexp) {
return _goboringcrypto_EVP_PKEY_CTX_ctrl(ctx, -1,
@@ -832,6 +835,11 @@ _goboringcrypto_EVP_PKEY_CTX_set_rsa_keygen_pubexp(GO_EVP_PKEY_CTX *ctx, GO_BIGN
EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP,
0, pubexp);
}
+#else
+DEFINEFUNC(int, EVP_PKEY_CTX_set_rsa_keygen_pubexp,
+ (GO_EVP_PKEY_CTX *ctx, GO_BIGNUM *pubexp),
+ (ctx, pubexp))
+#endif
static inline int
_goboringcrypto_EVP_PKEY_CTX_set_ec_paramgen_curve_nid(GO_EVP_PKEY_CTX *ctx, int nid) {

View File

@ -92,14 +92,17 @@
%global gohostarch s390x
%endif
%global go_api 1.21
%global go_version 1.21.13
%global go_api 1.22
%global go_version 1.22.7
%global version %{go_version}
%global pkg_release 4
%global pkg_release 1
# LLVM compiler-rt version for race detector
%global llvm_compiler_rt_version 18.1.8
Name: golang
Version: %{version}
Release: 4%{?dist}
Release: 2%{?dist}
Summary: The Go Programming Language
# source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain
License: BSD and Public Domain
@ -114,6 +117,7 @@ Source0: https://github.com/golang/go/archive/refs/tags/go%{version}.tar.
Source1: https://github.com/golang-fips/go/archive/refs/tags/go%{version}-%{pkg_release}-openssl-fips.tar.gz
# make possible to override default traceback level at build time by setting build tag rpm_crashtraceback
Source2: fedora.go
Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{llvm_compiler_rt_version}/compiler-rt-%{llvm_compiler_rt_version}.src.tar.xz
# The compiler is written in Go. Needs go(1.4+) compiler for build.
# Actual Go based bootstrap compiler provided by above source.
@ -132,24 +136,24 @@ BuildRequires: openssl-devel
# for tests
BuildRequires: pcre-devel, glibc-static, perl
# Necessary for building llvm address sanitizer for Go race detector
BuildRequires: libstdc++-devel
BuildRequires: clang
Provides: go = %{version}-%{release}
Requires: %{name}-bin = %{version}-%{release}
Requires: %{name}-src = %{version}-%{release}
Requires: %{name}-race = %{version}-%{release}
Requires: openssl-devel
Requires: diffutils
# Proposed patch by jcajka https://golang.org/cl/86541
Patch221: fix_TestScript_list_std.patch
Patch230: update-api-openssl3.patch
Patch231: evp-digest-sign-final.patch
Patch1939923: skip_test_rhbz1939923.patch
# Disables libc static linking tests which
# are incompatible with dlopen in golang-fips
Patch2: disable_static_tests_part1.patch
Patch3: disable_static_tests_part2.patch
Patch4: modify_go.env.patch
Patch6: skip_TestCrashDumpsAllThreads.patch
# Having documentation separate was broken
Obsoletes: %{name}-docs < 1.1-4
@ -157,9 +161,6 @@ Obsoletes: %{name}-docs < 1.1-4
# RPM can't handle symlink -> dir with subpackages, so merge back
Obsoletes: %{name}-data < 1.1.1-4
# We don't build golang-race anymore, rhbz#2230705
Obsoletes: golang-race < 1.20.0
# These are the only RHEL/Fedora architectures that we compile this package for
ExclusiveArch: %{golang_arches}
@ -230,16 +231,6 @@ Summary: Golang shared object libraries
%{summary}.
%endif
%if %{race}
%package race
Summary: Golang std library with -race enabled
Requires: %{name} = %{version}-%{release}
%description race
%{summary}
%endif
%package -n go-toolset
Summary: Package that installs go-toolset
Requires: %{name} = %{version}-%{release}
@ -250,18 +241,25 @@ Requires: delve
%description -n go-toolset
This is the main package for go-toolset.
%package race
Summary: Race detetector library object files.
Requires: %{name} = %{version}-%{release}
%description race
Binary library objects for Go's race detector.
%prep
%setup -q -n go-go%{version}
pushd ..
tar -xf %{SOURCE1}
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 --no-backup-if-mismatch -p1 < $p
done
# Configure crypto tests
@ -275,6 +273,11 @@ popd
sed -i '1s/$/ (%{?rhel:Red Hat} %{version}-%{release})/' VERSION
cp %{SOURCE2} ./src/runtime/
# Delete the bundled race detector objects.
find ./src/runtime/race/ -name "race_*.syso" -exec rm {} \;
# Delete the boring binary blob. We use the system OpenSSL instead.
rm -rf src/crypto/internal/boring/syso
%build
set -xe
@ -283,6 +286,38 @@ uname -a
cat /proc/cpuinfo
cat /proc/meminfo
# Build race detector .syso's from llvm sources
%global tsan_buildflags %(echo %{build_cflags} | sed 's/-mtls-dialect=gnu2//')
mkdir ../llvm
tar -xf %{SOURCE3} -C ../llvm
tsan_go_dir="../llvm/compiler-rt-%{llvm_compiler_rt_version}.src/lib/tsan/go"
# The script uses uname -a and grep to set the GOARCH. This
# is unreliable and can get the wrong architecture in
# circumstances like cross-architecture emulation. We fix it
# by just reading GOARCH directly from Go.
export GOARCH=$(go env GOARCH)
%ifarch x86_64
pushd "${tsan_go_dir}"
CFLAGS="${tsan_buildflags}" CC=clang GOAMD64=v3 ./buildgo.sh
popd
cp "${tsan_go_dir}"/race_linux_amd64.syso ./src/runtime/race/internal/amd64v3/race_linux.syso
pushd "${tsan_go_dir}"
CFLAGS="${tsan_buildflags}" CC=clang GOAMD64=v1 ./buildgo.sh
popd
cp "${tsan_go_dir}"/race_linux_amd64.syso ./src/runtime/race/internal/amd64v1/race_linux.syso
%else
pushd "${tsan_go_dir}"
CFLAGS="${tsan_buildflags}" CC=clang ./buildgo.sh
popd
cp "${tsan_go_dir}"/race_linux_%{gohostarch}.syso ./src/runtime/race/race_linux_%{gohostarch}.syso
%endif
# bootstrap compiler GOROOT
%if !%{golang_bootstrap}
export GOROOT_BOOTSTRAP=/
@ -514,8 +549,13 @@ cd ..
# prelink blacklist
%{_sysconfdir}/prelink.conf.d
%files -f go-src.list src
%ifarch x86_64
%exclude %{goroot}/src/runtime/race/internal/amd64v1/race_linux.syso
%exclude %{goroot}/src/runtime/race/internal/amd64v3/race_linux.syso
%else
%exclude %{goroot}/src/runtime/race/race_linux_%{gohostarch}.syso
%endif
%files -f go-docs.list docs
@ -534,47 +574,71 @@ cd ..
%files -n go-toolset
%files race
%ifarch x86_64
%{goroot}/src/runtime/race/internal/amd64v1/race_linux.syso
%{goroot}/src/runtime/race/internal/amd64v3/race_linux.syso
%else
%{goroot}/src/runtime/race/race_linux_%{gohostarch}.syso
%endif
%changelog
* Tue Oct 01 2024 David Benoit <dbenoit@redhat.com> - 1.21.13-4
- Fix CVE-2024-9355
- Resolves: RHEL-61046
* Thu Oct 03 2024 Archana <aravinda@redhat.com> - 1.22.7-2
- Rebuilt to use right build target
- Related: RHEL-57867
* Tue Sep 17 2024 David Benoit <dbenoit@redhat.com> - 1.21.13-3
- Related: RHEL-58226
* Tue Sep 24 2024 David Benoit <dbenoit@redhat.com> - 1.22.7-1
- Update to Go 1.22.7
- Remove fix-standard-crypto-panic.patch (upstreamed)
- Resolves: RHEL-57867
* Mon Sep 16 2024 David Benoit <dbenoit@redhat.com> - 1.21.13-2
- Rebuild Go with CVE Fixes
- Remove fix-memleak-setupRSA.patch (exists upstream)
- Resolves: RHEL-58226
- Resolves: RHEL-57962
- Resolves: RHEL-57848
- Resolves: RHEL-57865
* Wed Aug 14 2024 David Benoit <dbenoit@redhat.com> - 1.22.5-2
- Rebuild race detector archives from LLVM sources
- Add golang-race subpackage
- Resolves: RHEL-33421
- Remove unused crypto/internal/boring/syso package
- Resolves: RHEL-54335
* Mon Aug 19 2024 Archana <aravinda@redhat.com> - 1.21.13-1
- Rebase to Go1.21.13 to pick the fix for CVE-2024-24791
- Technically Go1.21.12 contains the fix for the CVE but there was another
latest release so rebasing to that
- Resolves: RHEL-53547
* Thu Jul 11 2024 Archana <aravinda@redhat.com> - 1.22.5-1
- Rebase to Go1.22.5 to address CVE-2024-24791
- Resolves: RHEL-46973
* Wed Jun 12 2024 Archana Ravindar <aravinda@redhat.com> - 1.21.11-1
- Update to Go 1.21.11 that fixes CVE-2024-24789 and CVE-2024-24790
- Resolves: RHEL-40275
* Thu Jun 27 2024 David Benoit <dbenoit@redhat.com> - 1.22.4-2
- Fix panic in standard crypto mode without openssl
- Resolves: RHEL-45359
* Thu May 23 2024 David Benoit <dbenoit@redhat.com> - 1.21.10-1
- Update to Go 1.21.10
- Resolves: RHEL-36988
- Resolves: RHEL-35630
* Thu Jun 6 2024 Archana Ravindar <aravinda@redhat.com> - 1.22.4-1
- Rebase to Go1.22.4 that includes fixes for CVE-2024-24789 and CVE-2024-24790
- Resolves: RHEL-40156
* Mon Apr 15 2024 David Benoit <dbenoit@redhat.com> - 1.21.9-2
- Rebuilt for z-stream
- Related: RHEL-24312
- Related: RHEL-28940
* Thu May 30 2024 Derek Parker <deparker@redhat.com> - 1.22.3-3
- Update openssl backend
- Resolves: RHEL-36101
* Fri Apr 5 2024 Archana Ravindar <aravinda@redhat.com> - 1.21.9-1
- Fix CVE-2024-1394
- Fix CVE-2023-45288
- Resolves RHEL-24312
- Resolves RHEL-28940
* Thu May 23 2024 Derek Parker <deparker@redhat.com> - 1.22.3-2
- Restore HashSign / HashVerify API
- Resolves: RHEL-35883
* Wed May 22 2024 Alejandro Sáez <asm@redhat.com> - 1.22.3-1
- Rebase to 1.22.3
- Removes re-enable-cgo.patch
- Resolves: RHEL-35634
- Resolves: RHEL-35883
- Resolves: RHEL-10068
- Resolves: RHEL-34924
* Thu Apr 18 2024 Derek Parker <deparker@redhat.com> - 1.22.2-1
- Rebase to 1.22.2
- Resolves: RHEL-28941
* Tue Apr 09 2024 Alejandro Sáez <asm@redhat.com> - 1.22.1-2
- Set the AMD64 baseline to v2
* Tue Mar 19 2024 Alejandro Sáez <asm@redhat.com> - 1.22.1-1
- Rebase to Go 1.22.1
- Re-enable CGO
- Resolves: RHEL-29527
- Resolves: RHEL-28175
* Fri Feb 09 2024 Alejandro Sáez <asm@redhat.com> - 1.21.7-1
- Rebase to Go 1.21.7