Compare commits
No commits in common. "stream-go-toolset-rhel8-rhel-8.9.0" and "c8-stream-rhel8" have entirely different histories.
stream-go-
...
c8-stream-
14
.gitignore
vendored
14
.gitignore
vendored
@ -1,12 +1,2 @@
|
|||||||
SOURCES/go1.19.4-1-openssl-fips.tar.gz
|
SOURCES/go1.21.13-4-openssl-fips.tar.gz
|
||||||
SOURCES/go1.19.4.tar.gz
|
SOURCES/go1.21.13.tar.gz
|
||||||
/go1.19.4-1-openssl-fips.tar.gz
|
|
||||||
/go1.19.4.tar.gz
|
|
||||||
/go1.19.6-1-openssl-fips.tar.gz
|
|
||||||
/go1.19.6.tar.gz
|
|
||||||
/go1.20.3.tar.gz
|
|
||||||
/go1.20.3-1-openssl-fips.tar.gz
|
|
||||||
/go1.20.4.tar.gz
|
|
||||||
/go1.20.4-3-openssl-fips.tar.gz
|
|
||||||
/go1.20.6.tar.gz
|
|
||||||
/go1.20.6-1-openssl-fips.tar.gz
|
|
||||||
|
2
.golang.metadata
Normal file
2
.golang.metadata
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
cfcfc208c18ecffcebe3d6218537f495eb555395 SOURCES/go1.21.13-4-openssl-fips.tar.gz
|
||||||
|
a6aa471b6f806146bbd4ffec11b70ca834421a2e SOURCES/go1.21.13.tar.gz
|
65
README.md
65
README.md
@ -1,65 +0,0 @@
|
|||||||
# Golang
|
|
||||||
|
|
||||||
## Introduction
|
|
||||||
|
|
||||||
This package holds the spec file and related patches for the Golang package.
|
|
||||||
The golang package is part of the larger go-toolset meta package.
|
|
||||||
|
|
||||||
## Sources
|
|
||||||
|
|
||||||
This particular branch provides Go 1.16.x. The sources for this branch can be
|
|
||||||
found at https://pagure.io/go/tree/go1.16-openssl-fips. The reason the source is
|
|
||||||
coming from a pagure fork as opposed to an upstream tarball is due to certain
|
|
||||||
patches we have written and currently maintain in order to claim FIPS compliance
|
|
||||||
by calling into OpenSSL. Shipping a forked version of the toolchain is not the
|
|
||||||
ideal scenario, and there is work in progress with upstream to enable us to
|
|
||||||
instead ship a pure upstream toolchain and include a crypto module in go-toolset
|
|
||||||
which will satisfy our FIPS requirements.
|
|
||||||
|
|
||||||
The current fork is based on an upstream branch[[0]] which uses
|
|
||||||
boringcrypto[[1]] instead of OpenSSL.
|
|
||||||
|
|
||||||
If you need to make changes to the source for a rebase or bug fix, check out the
|
|
||||||
pagure repo and switch to the branch listed above. Once you have made your
|
|
||||||
changes you can test them locally with `./all.bash`. You may want to export
|
|
||||||
`GOLANG_FIPS=1` before running that if you want to verify the FIPS codepaths are
|
|
||||||
correct. Please note however that the test suite does not fully expect FIPS
|
|
||||||
compliance, and will attempt to test non FIPS compliant code paths. The easiest
|
|
||||||
way to test your changes correctly is to create a tarball locally and execute a
|
|
||||||
mockbuild using this packge, which knows how to correctly run the testsuite in
|
|
||||||
both FIPS and non-FIPS modes.
|
|
||||||
|
|
||||||
NOTE: The way pagure previously handled uploaded releases has changed, and
|
|
||||||
releases must be tagged in the appropriate branch, from which pagure will
|
|
||||||
generate source tarballs.
|
|
||||||
|
|
||||||
## Testing & building changes
|
|
||||||
|
|
||||||
The first test you should run is a local mockbuild. This can be done with the
|
|
||||||
rhpkg command:
|
|
||||||
|
|
||||||
```
|
|
||||||
rhpkg mockbuild
|
|
||||||
```
|
|
||||||
|
|
||||||
Once everything builds and passes locally you'll likely want to perform a
|
|
||||||
scratch build. This will ensure that the changes you made build and run
|
|
||||||
correctly on all architectures that this package supports. The best way to do
|
|
||||||
this is to run a scratch build from your local sources without first having to
|
|
||||||
push them. This ensures your changes are correct before commiting them to the
|
|
||||||
repo. This can also be done via the following rhpkg command:
|
|
||||||
|
|
||||||
```
|
|
||||||
rhpkg scratch-build --srpm
|
|
||||||
```
|
|
||||||
|
|
||||||
Once your scratch build has passed you can execute a real build:
|
|
||||||
|
|
||||||
```
|
|
||||||
rhpkg build
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
[0] https://github.com/golang/go/tree/dev.boringcrypto
|
|
||||||
[1] https://opensource.google.com/projects/boringssl
|
|
374
SOURCES/disable_static_tests_part1.patch
Normal file
374
SOURCES/disable_static_tests_part1.patch
Normal file
@ -0,0 +1,374 @@
|
|||||||
|
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
|
||||||
|
|
@ -1,13 +1,13 @@
|
|||||||
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
|
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
|
||||||
index 9f26606..2408505 100644
|
index 36a20e8b2a..8c2dd1b44b 100644
|
||||||
--- a/src/cmd/dist/test.go
|
--- a/src/cmd/dist/test.go
|
||||||
+++ b/src/cmd/dist/test.go
|
+++ b/src/cmd/dist/test.go
|
||||||
@@ -1259,7 +1259,7 @@ func (t *tester) registerCgoTests() {
|
@@ -1125,7 +1125,7 @@ func (t *tester) registerCgoTests(heading string) {
|
||||||
} else {
|
} else {
|
||||||
panic("unknown linkmode with static build: " + linkmode)
|
panic("unknown linkmode with static build: " + linkmode)
|
||||||
}
|
}
|
||||||
- gt.tags = append(gt.tags, "static")
|
- gt.tags = append(gt.tags, "static")
|
||||||
+ gt.tags = append(gt.tags, "static", "no_openssl")
|
+ gt.tags = append(gt.tags, "static", "no_openssl")
|
||||||
}
|
}
|
||||||
|
gt.ldflags = strings.Join(ldflags, " ")
|
||||||
|
|
||||||
t.registerTest("cgo:"+name, "../misc/cgo/test", gt, opts...)
|
|
22
SOURCES/modify_go.env.patch
Normal file
22
SOURCES/modify_go.env.patch
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
From eab9004c072200e58df83ab94678bda1faa7b229 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
|
||||||
|
|
||||||
|
---
|
||||||
|
go.env | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/go.env b/go.env
|
||||||
|
index 6ff2b921d4..e87f6e7b6d 100644
|
||||||
|
--- a/go.env
|
||||||
|
+++ b/go.env
|
||||||
|
@@ -9,4 +9,4 @@ 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
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
@ -56,7 +56,7 @@
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Controls what ever we fail on failed tests
|
# Controls what ever we fail on failed tests
|
||||||
%ifarch x86_64 %{arm} aarch64 ppc64le s390x
|
%ifarch x86_64 %{arm} ppc64le s390x
|
||||||
%global fail_on_tests 1
|
%global fail_on_tests 1
|
||||||
%else
|
%else
|
||||||
%global fail_on_tests 0
|
%global fail_on_tests 0
|
||||||
@ -91,9 +91,9 @@
|
|||||||
%global gohostarch s390x
|
%global gohostarch s390x
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%global go_api 1.20
|
%global go_api 1.21
|
||||||
%global version 1.20.6
|
%global version 1.21.13
|
||||||
%global pkg_release 1
|
%global pkg_release 4
|
||||||
|
|
||||||
Name: golang
|
Name: golang
|
||||||
Version: %{version}
|
Version: %{version}
|
||||||
@ -137,7 +137,6 @@ Requires: %{name}-src = %{version}-%{release}
|
|||||||
Requires: openssl-devel
|
Requires: openssl-devel
|
||||||
Requires: diffutils
|
Requires: diffutils
|
||||||
|
|
||||||
|
|
||||||
# Proposed patch by jcajka https://golang.org/cl/86541
|
# Proposed patch by jcajka https://golang.org/cl/86541
|
||||||
Patch221: fix_TestScript_list_std.patch
|
Patch221: fix_TestScript_list_std.patch
|
||||||
|
|
||||||
@ -145,7 +144,7 @@ Patch1939923: skip_test_rhbz1939923.patch
|
|||||||
|
|
||||||
Patch2: disable_static_tests_part1.patch
|
Patch2: disable_static_tests_part1.patch
|
||||||
Patch3: disable_static_tests_part2.patch
|
Patch3: disable_static_tests_part2.patch
|
||||||
Patch6: fix-memory-leak-evp-sign-verify.patch
|
Patch5: modify_go.env.patch
|
||||||
|
|
||||||
# Having documentation separate was broken
|
# Having documentation separate was broken
|
||||||
Obsoletes: %{name}-docs < 1.1-4
|
Obsoletes: %{name}-docs < 1.1-4
|
||||||
@ -242,8 +241,12 @@ Requires: %{name} = %{version}-%{release}
|
|||||||
pushd ..
|
pushd ..
|
||||||
tar -xf %{SOURCE1}
|
tar -xf %{SOURCE1}
|
||||||
popd
|
popd
|
||||||
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/000-initial-setup.patch
|
patch_dir="../go-go%{version}-%{pkg_release}-openssl-fips/patches"
|
||||||
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/001-initial-openssl-for-fips.patch
|
# 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
|
||||||
|
done
|
||||||
|
|
||||||
# Configure crypto tests
|
# Configure crypto tests
|
||||||
pushd ../go-go%{version}-%{pkg_release}-openssl-fips
|
pushd ../go-go%{version}-%{pkg_release}-openssl-fips
|
||||||
@ -251,13 +254,9 @@ ln -s ../go-go%{version} go
|
|||||||
./scripts/configure-crypto-tests.sh
|
./scripts/configure-crypto-tests.sh
|
||||||
popd
|
popd
|
||||||
|
|
||||||
%patch2 -p1
|
%autopatch -p1
|
||||||
%patch3 -p1
|
|
||||||
%patch6 -p1
|
|
||||||
|
|
||||||
%patch221 -p1
|
sed -i '1s/$/ (%{?rhel:Red Hat} %{version}-%{release})/' VERSION
|
||||||
|
|
||||||
%patch1939923 -p1
|
|
||||||
|
|
||||||
cp %{SOURCE2} ./src/runtime/
|
cp %{SOURCE2} ./src/runtime/
|
||||||
|
|
||||||
@ -328,7 +327,7 @@ rm -rf pkg/bootstrap/bin
|
|||||||
|
|
||||||
# install everything into libdir (until symlink problems are fixed)
|
# install everything into libdir (until symlink problems are fixed)
|
||||||
# https://code.google.com/p/go/issues/detail?id=5830
|
# https://code.google.com/p/go/issues/detail?id=5830
|
||||||
cp -apv api bin doc lib pkg src misc test VERSION \
|
cp -apv api bin doc lib pkg src misc test go.env VERSION \
|
||||||
$RPM_BUILD_ROOT%{goroot}
|
$RPM_BUILD_ROOT%{goroot}
|
||||||
|
|
||||||
# bz1099206
|
# bz1099206
|
||||||
@ -513,12 +512,69 @@ cd ..
|
|||||||
%files -f go-pkg.list bin
|
%files -f go-pkg.list bin
|
||||||
%{_bindir}/go
|
%{_bindir}/go
|
||||||
%{_bindir}/gofmt
|
%{_bindir}/gofmt
|
||||||
|
%{goroot}/go.env
|
||||||
|
|
||||||
%if %{shared}
|
%if %{shared}
|
||||||
%files -f go-shared.list shared
|
%files -f go-shared.list shared
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* 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-58223
|
||||||
|
- Resolves: RHEL-57961
|
||||||
|
- Resolves: RHEL-57847
|
||||||
|
- Resolves: RHEL-57860
|
||||||
|
|
||||||
|
* Wed Aug 21 2024 Archana <aravinda@redhat.com> - 1.21.13-1
|
||||||
|
- Update to Go1.21.13 to fix CVE-2024-24791
|
||||||
|
- Resolves: RHEL-47198
|
||||||
|
|
||||||
|
* Wed Jun 12 2024 Archana Ravindar <aravinda@redhat.com> - 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 <dbenoit@redhat.com> - 1.21.10
|
||||||
|
- Update to Go 1.21.10
|
||||||
|
- Resolves: RHEL-36993
|
||||||
|
|
||||||
|
* Fri Apr 12 2024 David Benoit <dbenoit@redhat.com> - 1.21.9-1
|
||||||
|
- Fix CVE-2023-45288
|
||||||
|
- Resolves: RHEL-31915
|
||||||
|
|
||||||
|
* Mon Apr 1 2024 Archana Ravindar <aravinda@redhat.com> - 1.21.7-2
|
||||||
|
- Fix CVE-2024-1394
|
||||||
|
- Resolves RHEL-24300
|
||||||
|
|
||||||
|
* Tue Feb 13 2024 Alejandro Sáez <asm@redhat.com> - 1.21.7-1
|
||||||
|
- Rebase to Go 1.21.7
|
||||||
|
- Add release information
|
||||||
|
- Set GOTOOLCHAIN to local
|
||||||
|
- Skip TestOverlongMessagePKCS1v15
|
||||||
|
- Resolves: RHEL-24082
|
||||||
|
- Resolves: RHEL-18363
|
||||||
|
- Resolves: RHEL-18382
|
||||||
|
|
||||||
|
* Wed Nov 08 2023 David Benoit <dbenoit@redhat.com> - 1.21.3-4
|
||||||
|
- Do not remove GOPROXY/GOSUMDB
|
||||||
|
- Related: RHEL-12620
|
||||||
|
|
||||||
|
* Thu Nov 02 2023 David Benoit <dbenoit@redhat.com> - 1.21.3-3
|
||||||
|
- Fix go.env in Go 1.21
|
||||||
|
- Related: RHEL-12620
|
||||||
|
|
||||||
|
* Tue Oct 31 2023 Archana Ravindar <aravinda@redhat.com> - 1.21.3-2
|
||||||
|
- Rebase disable_static_tests_part2.patch to Go 1.21.3
|
||||||
|
- Add missing strict fips runtime detection patch
|
||||||
|
- Temporarily disable FIPS tests on aarch64 due to builder kernel bugs
|
||||||
|
- Remove fix-memory-leak patch as it is fixed upstream
|
||||||
|
- Resolves: RHEL-12620
|
||||||
|
|
||||||
|
* Fri Oct 20 2023 Archana Ravindar <aravinda@redhat.com> - 1.21.3-1
|
||||||
|
- Rebase Go to 1.21.3
|
||||||
|
- Resolves: RHEL-12620
|
||||||
|
|
||||||
* Mon Aug 14 2023 Alejandro Sáez <asm@redhat.com> - 1.20.6-2
|
* Mon Aug 14 2023 Alejandro Sáez <asm@redhat.com> - 1.20.6-2
|
||||||
- Retire golang-race package
|
- Retire golang-race package
|
||||||
- Resolves: rhbz#2230599
|
- Resolves: rhbz#2230599
|
@ -1,289 +0,0 @@
|
|||||||
From 24e9707cbfa6b1ed6abdd4b11f9ddaf3aac5ad88 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ian Lance Taylor <iant@golang.org>
|
|
||||||
Date: Tue, 25 May 2021 16:31:41 -0700
|
|
||||||
Subject: [PATCH] cmd/link, cmd/cgo: support -flto in CFLAGS
|
|
||||||
|
|
||||||
The linker now accepts unrecognized object files in external linking mode.
|
|
||||||
These objects will simply be passed to the external linker.
|
|
||||||
This permits using -flto which can generate pure byte code objects,
|
|
||||||
whose symbol table the linker does not know how to read.
|
|
||||||
|
|
||||||
The cgo tool now passes -fno-lto when generating objects whose symbols
|
|
||||||
it needs to read. The cgo tool now emits matching types in different
|
|
||||||
objects, so that the lto linker does not report a mismatch.
|
|
||||||
|
|
||||||
This is based on https://golang.org/cl/293290 by Derek Parker.
|
|
||||||
|
|
||||||
For #43505
|
|
||||||
Fixes #43830
|
|
||||||
Fixes #46295
|
|
||||||
|
|
||||||
Change-Id: I6787de213417466784ddef5af8899e453b4ae1ad
|
|
||||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/322614
|
|
||||||
Trust: Ian Lance Taylor <iant@golang.org>
|
|
||||||
Run-TryBot: Ian Lance Taylor <iant@golang.org>
|
|
||||||
TryBot-Result: Go Bot <gobot@golang.org>
|
|
||||||
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
|
|
||||||
---
|
|
||||||
|
|
||||||
diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go
|
|
||||||
index ae61725..a73e998 100644
|
|
||||||
--- a/src/cmd/cgo/gcc.go
|
|
||||||
+++ b/src/cmd/cgo/gcc.go
|
|
||||||
@@ -1638,6 +1638,8 @@
|
|
||||||
c = append(c, "-maix64")
|
|
||||||
c = append(c, "-mcmodel=large")
|
|
||||||
}
|
|
||||||
+ // disable LTO so we get an object whose symbols we can read
|
|
||||||
+ c = append(c, "-fno-lto")
|
|
||||||
c = append(c, "-") //read input from standard input
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go
|
|
||||||
index 8c31d5b..94152f4 100644
|
|
||||||
--- a/src/cmd/cgo/out.go
|
|
||||||
+++ b/src/cmd/cgo/out.go
|
|
||||||
@@ -168,8 +168,18 @@
|
|
||||||
if *gccgo {
|
|
||||||
fmt.Fprintf(fc, "extern byte *%s;\n", n.C)
|
|
||||||
} else {
|
|
||||||
- fmt.Fprintf(fm, "extern char %s[];\n", n.C)
|
|
||||||
- fmt.Fprintf(fm, "void *_cgohack_%s = %s;\n\n", n.C, n.C)
|
|
||||||
+ // Force a reference to all symbols so that
|
|
||||||
+ // the external linker will add DT_NEEDED
|
|
||||||
+ // entries as needed on ELF systems.
|
|
||||||
+ // Treat function variables differently
|
|
||||||
+ // to avoid type confict errors from LTO
|
|
||||||
+ // (Link Time Optimization).
|
|
||||||
+ if n.Kind == "fpvar" {
|
|
||||||
+ fmt.Fprintf(fm, "extern void %s();\n", n.C)
|
|
||||||
+ } else {
|
|
||||||
+ fmt.Fprintf(fm, "extern char %s[];\n", n.C)
|
|
||||||
+ fmt.Fprintf(fm, "void *_cgohack_%s = %s;\n\n", n.C, n.C)
|
|
||||||
+ }
|
|
||||||
fmt.Fprintf(fgo2, "//go:linkname __cgo_%s %s\n", n.C, n.C)
|
|
||||||
fmt.Fprintf(fgo2, "//go:cgo_import_static %s\n", n.C)
|
|
||||||
fmt.Fprintf(fgo2, "var __cgo_%s byte\n", n.C)
|
|
||||||
@@ -1042,7 +1052,7 @@
|
|
||||||
fmt.Fprintf(fgo2, "//go:cgo_export_static _cgoexp%s_%s\n", cPrefix, exp.ExpName)
|
|
||||||
fmt.Fprintf(fgo2, "func _cgoexp%s_%s(a *%s) {\n", cPrefix, exp.ExpName, gotype)
|
|
||||||
|
|
||||||
- fmt.Fprintf(fm, "int _cgoexp%s_%s;\n", cPrefix, exp.ExpName)
|
|
||||||
+ fmt.Fprintf(fm, "void _cgoexp%s_%s(void* p){}\n", cPrefix, exp.ExpName)
|
|
||||||
|
|
||||||
if gccResult != "void" {
|
|
||||||
// Write results back to frame.
|
|
||||||
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
|
|
||||||
index 50bf80b..bc49c6d 100644
|
|
||||||
--- a/src/cmd/dist/test.go
|
|
||||||
+++ b/src/cmd/dist/test.go
|
|
||||||
@@ -722,14 +722,29 @@
|
|
||||||
},
|
|
||||||
})
|
|
||||||
if t.hasCxx() {
|
|
||||||
- t.tests = append(t.tests, distTest{
|
|
||||||
- name: "swig_callback",
|
|
||||||
- heading: "../misc/swig/callback",
|
|
||||||
- fn: func(dt *distTest) error {
|
|
||||||
- t.addCmd(dt, "misc/swig/callback", t.goTest())
|
|
||||||
- return nil
|
|
||||||
+ t.tests = append(t.tests,
|
|
||||||
+ distTest{
|
|
||||||
+ name: "swig_callback",
|
|
||||||
+ heading: "../misc/swig/callback",
|
|
||||||
+ fn: func(dt *distTest) error {
|
|
||||||
+ t.addCmd(dt, "misc/swig/callback", t.goTest())
|
|
||||||
+ return nil
|
|
||||||
+ },
|
|
||||||
},
|
|
||||||
- })
|
|
||||||
+ distTest{
|
|
||||||
+ name: "swig_callback_lto",
|
|
||||||
+ heading: "../misc/swig/callback",
|
|
||||||
+ fn: func(dt *distTest) error {
|
|
||||||
+ cmd := t.addCmd(dt, "misc/swig/callback", t.goTest())
|
|
||||||
+ cmd.Env = append(os.Environ(),
|
|
||||||
+ "CGO_CFLAGS=-flto",
|
|
||||||
+ "CGO_CXXFLAGS=-flto",
|
|
||||||
+ "CGO_LDFLAGS=-flto",
|
|
||||||
+ )
|
|
||||||
+ return nil
|
|
||||||
+ },
|
|
||||||
+ },
|
|
||||||
+ )
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/src/cmd/go/testdata/script/cgo_lto2_issue43830.txt b/src/cmd/go/testdata/script/cgo_lto2_issue43830.txt
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..e2483ba
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/cmd/go/testdata/script/cgo_lto2_issue43830.txt
|
|
||||||
@@ -0,0 +1,33 @@
|
|
||||||
+# tests golang.org/issue/43830
|
|
||||||
+
|
|
||||||
+[!cgo] skip 'skipping test without cgo'
|
|
||||||
+[openbsd] env CC='clang'
|
|
||||||
+[openbsd] [!exec:clang] skip 'skipping test without clang present'
|
|
||||||
+[!openbsd] env CC='gcc'
|
|
||||||
+[!openbsd] [!exec:gcc] skip 'skipping test without gcc present'
|
|
||||||
+
|
|
||||||
+env CGO_CFLAGS='-Wno-ignored-optimization-argument -flto -ffat-lto-objects'
|
|
||||||
+
|
|
||||||
+go build main.go
|
|
||||||
+
|
|
||||||
+-- main.go --
|
|
||||||
+
|
|
||||||
+package main
|
|
||||||
+
|
|
||||||
+import "fmt"
|
|
||||||
+
|
|
||||||
+// #include "hello.h"
|
|
||||||
+import "C"
|
|
||||||
+
|
|
||||||
+func main() {
|
|
||||||
+ hello := C.hello
|
|
||||||
+ fmt.Printf("%v\n", hello)
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+-- hello.h --
|
|
||||||
+
|
|
||||||
+#include <stdio.h>
|
|
||||||
+
|
|
||||||
+void hello(void) {
|
|
||||||
+ printf("hello\n");
|
|
||||||
+}
|
|
||||||
diff --git a/src/cmd/go/testdata/script/cgo_lto_issue43830.txt b/src/cmd/go/testdata/script/cgo_lto_issue43830.txt
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..06ab2f3
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/cmd/go/testdata/script/cgo_lto_issue43830.txt
|
|
||||||
@@ -0,0 +1,39 @@
|
|
||||||
+# tests golang.org/issue/43830
|
|
||||||
+
|
|
||||||
+[!cgo] skip 'skipping test without cgo'
|
|
||||||
+[openbsd] env CC='clang'
|
|
||||||
+[openbsd] [!exec:clang] skip 'skipping test without clang present'
|
|
||||||
+[!openbsd] env CC='gcc'
|
|
||||||
+[!openbsd] [!exec:gcc] skip 'skipping test without gcc present'
|
|
||||||
+
|
|
||||||
+env CGO_CFLAGS='-Wno-ignored-optimization-argument -flto -ffat-lto-objects'
|
|
||||||
+
|
|
||||||
+go build main.go add.go
|
|
||||||
+
|
|
||||||
+-- main.go --
|
|
||||||
+
|
|
||||||
+package main
|
|
||||||
+
|
|
||||||
+/*
|
|
||||||
+int c_add(int a, int b) {
|
|
||||||
+ return myadd(a, b);
|
|
||||||
+}
|
|
||||||
+*/
|
|
||||||
+import "C"
|
|
||||||
+
|
|
||||||
+func main() {
|
|
||||||
+ println(C.c_add(1, 2))
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+-- add.go --
|
|
||||||
+
|
|
||||||
+package main
|
|
||||||
+
|
|
||||||
+import "C"
|
|
||||||
+
|
|
||||||
+/* test */
|
|
||||||
+
|
|
||||||
+//export myadd
|
|
||||||
+func myadd(a C.int, b C.int) C.int {
|
|
||||||
+ return a + b
|
|
||||||
+}
|
|
||||||
diff --git a/src/cmd/link/internal/ld/ar.go b/src/cmd/link/internal/ld/ar.go
|
|
||||||
index 22f53a4..23915f9 100644
|
|
||||||
--- a/src/cmd/link/internal/ld/ar.go
|
|
||||||
+++ b/src/cmd/link/internal/ld/ar.go
|
|
||||||
@@ -124,6 +124,10 @@
|
|
||||||
|
|
||||||
libgcc := sym.Library{Pkg: "libgcc"}
|
|
||||||
h := ldobj(ctxt, f, &libgcc, l, pname, name)
|
|
||||||
+ if h.ld == nil {
|
|
||||||
+ Errorf(nil, "%s unrecognized object file at offset %d", name, off)
|
|
||||||
+ continue
|
|
||||||
+ }
|
|
||||||
f.MustSeek(h.off, 0)
|
|
||||||
h.ld(ctxt, f, h.pkg, h.length, h.pn)
|
|
||||||
}
|
|
||||||
diff --git a/src/cmd/link/internal/ld/config.go b/src/cmd/link/internal/ld/config.go
|
|
||||||
index ae0d752..20f1d0b 100644
|
|
||||||
--- a/src/cmd/link/internal/ld/config.go
|
|
||||||
+++ b/src/cmd/link/internal/ld/config.go
|
|
||||||
@@ -241,6 +241,10 @@
|
|
||||||
return true, "dynamically linking with a shared library"
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if unknownObjFormat {
|
|
||||||
+ return true, "some input objects have an unrecognized file format"
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
return false, ""
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -248,7 +252,7 @@
|
|
||||||
//
|
|
||||||
// It is called after flags are processed and inputs are processed,
|
|
||||||
// so the ctxt.LinkMode variable has an initial value from the -linkmode
|
|
||||||
-// flag and the iscgo externalobj variables are set.
|
|
||||||
+// flag and the iscgo, externalobj, and unknownObjFormat variables are set.
|
|
||||||
func determineLinkMode(ctxt *Link) {
|
|
||||||
extNeeded, extReason := mustLinkExternal(ctxt)
|
|
||||||
via := ""
|
|
||||||
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
|
|
||||||
index e8f001b..644faeb 100644
|
|
||||||
--- a/src/cmd/link/internal/ld/lib.go
|
|
||||||
+++ b/src/cmd/link/internal/ld/lib.go
|
|
||||||
@@ -343,10 +343,16 @@
|
|
||||||
const pkgdef = "__.PKGDEF"
|
|
||||||
|
|
||||||
var (
|
|
||||||
- // Set if we see an object compiled by the host compiler that is not
|
|
||||||
- // from a package that is known to support internal linking mode.
|
|
||||||
+ // externalobj is set to true if we see an object compiled by
|
|
||||||
+ // the host compiler that is not from a package that is known
|
|
||||||
+ // to support internal linking mode.
|
|
||||||
externalobj = false
|
|
||||||
- theline string
|
|
||||||
+
|
|
||||||
+ // unknownObjFormat is set to true if we see an object whose
|
|
||||||
+ // format we don't recognize.
|
|
||||||
+ unknownObjFormat = false
|
|
||||||
+
|
|
||||||
+ theline string
|
|
||||||
)
|
|
||||||
|
|
||||||
func Lflag(ctxt *Link, arg string) {
|
|
||||||
@@ -1065,6 +1071,10 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
f.MustSeek(h.off, 0)
|
|
||||||
+ if h.ld == nil {
|
|
||||||
+ Errorf(nil, "%s: unrecognized object file format", h.pn)
|
|
||||||
+ continue
|
|
||||||
+ }
|
|
||||||
h.ld(ctxt, f, h.pkg, h.length, h.pn)
|
|
||||||
f.Close()
|
|
||||||
}
|
|
||||||
@@ -1855,6 +1865,14 @@
|
|
||||||
return ldhostobj(ldxcoff, ctxt.HeadType, f, pkg, length, pn, file)
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if c1 != 'g' || c2 != 'o' || c3 != ' ' || c4 != 'o' {
|
|
||||||
+ // An unrecognized object is just passed to the external linker.
|
|
||||||
+ // If we try to read symbols from this object, we will
|
|
||||||
+ // report an error at that time.
|
|
||||||
+ unknownObjFormat = true
|
|
||||||
+ return ldhostobj(nil, ctxt.HeadType, f, pkg, length, pn, file)
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/* check the header */
|
|
||||||
line, err := f.ReadString('\n')
|
|
||||||
if err != nil {
|
|
@ -1,53 +0,0 @@
|
|||||||
From 241192ecd31ca03a6f68fa7e55bb9f66040d3a2f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Lynn Boger <laboger@linux.vnet.ibm.com>
|
|
||||||
Date: Thu, 14 Jul 2022 10:47:28 -0500
|
|
||||||
Subject: [PATCH] cmd/link: use correct path for dynamic loader on ppc64le
|
|
||||||
|
|
||||||
The setting of the path for the dynamic loader when building for
|
|
||||||
linux/ppc64le ELF v2 was incorrectly set to the path for
|
|
||||||
PPC64 ELF v1. This has not caused issues in the common cases
|
|
||||||
because this string can be set based on the default GO_LDSO setting.
|
|
||||||
It does result in an incorrect value when cross compiling binaries
|
|
||||||
with -buildmode=pie.
|
|
||||||
|
|
||||||
Updates #53813
|
|
||||||
|
|
||||||
Change-Id: I84de1c97b42e0434760b76a57c5a05e055fbb730
|
|
||||||
---
|
|
||||||
src/cmd/link/internal/ppc64/obj.go | 13 +++++++------
|
|
||||||
1 file changed, 7 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/cmd/link/internal/ppc64/obj.go b/src/cmd/link/internal/ppc64/obj.go
|
|
||||||
index b6d5ad92af..bca8fa9212 100644
|
|
||||||
--- a/src/cmd/link/internal/ppc64/obj.go
|
|
||||||
+++ b/src/cmd/link/internal/ppc64/obj.go
|
|
||||||
@@ -38,9 +38,12 @@ import (
|
|
||||||
)
|
|
||||||
|
|
||||||
func Init() (*sys.Arch, ld.Arch) {
|
|
||||||
- arch := sys.ArchPPC64
|
|
||||||
- if buildcfg.GOARCH == "ppc64le" {
|
|
||||||
- arch = sys.ArchPPC64LE
|
|
||||||
+ arch := sys.ArchPPC64LE
|
|
||||||
+ dynld := "/lib64/ld64.so.2"
|
|
||||||
+
|
|
||||||
+ if buildcfg.GOARCH == "ppc64" {
|
|
||||||
+ arch = sys.ArchPPC64
|
|
||||||
+ dynld = "/lib64/ld64.so.1"
|
|
||||||
}
|
|
||||||
|
|
||||||
theArch := ld.Arch{
|
|
||||||
@@ -64,9 +67,7 @@ func Init() (*sys.Arch, ld.Arch) {
|
|
||||||
Machoreloc1: machoreloc1,
|
|
||||||
Xcoffreloc1: xcoffreloc1,
|
|
||||||
|
|
||||||
- // TODO(austin): ABI v1 uses /usr/lib/ld.so.1,
|
|
||||||
- Linuxdynld: "/lib64/ld64.so.1",
|
|
||||||
-
|
|
||||||
+ Linuxdynld: dynld,
|
|
||||||
Freebsddynld: "XXX",
|
|
||||||
Openbsddynld: "XXX",
|
|
||||||
Netbsddynld: "XXX",
|
|
||||||
--
|
|
||||||
2.35.3
|
|
||||||
|
|
@ -1,310 +0,0 @@
|
|||||||
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
|
|
||||||
index d9eb9c3..506f979 100644
|
|
||||||
--- a/src/cmd/dist/test.go
|
|
||||||
+++ b/src/cmd/dist/test.go
|
|
||||||
@@ -1180,18 +1180,20 @@ func (t *tester) cgoTest(dt *distTest) error {
|
|
||||||
fmt.Println("No support for static linking found (lacks libc.a?), skip cgo static linking test.")
|
|
||||||
} else {
|
|
||||||
if goos != "android" {
|
|
||||||
- t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", `-linkmode=external -extldflags "-static -pthread"`)
|
|
||||||
+ t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", `-linkmode=external -extldflags "-static -pthread"`, "-tags=no_openssl")
|
|
||||||
}
|
|
||||||
t.addCmd(dt, "misc/cgo/nocgo", t.goTest())
|
|
||||||
t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-ldflags", `-linkmode=external`)
|
|
||||||
if goos != "android" {
|
|
||||||
- t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-ldflags", `-linkmode=external -extldflags "-static -pthread"`)
|
|
||||||
+ t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-ldflags", `-linkmode=external -extldflags "-static -pthread"`, "-tags=no_openssl")
|
|
||||||
+ /*
|
|
||||||
t.addCmd(dt, "misc/cgo/test", t.goTest(), "-tags=static", "-ldflags", `-linkmode=external -extldflags "-static -pthread"`)
|
|
||||||
// -static in CGO_LDFLAGS triggers a different code path
|
|
||||||
// than -static in -extldflags, so test both.
|
|
||||||
// See issue #16651.
|
|
||||||
cmd := t.addCmd(dt, "misc/cgo/test", t.goTest(), "-tags=static")
|
|
||||||
setEnv(cmd, "CGO_LDFLAGS", "-static -pthread")
|
|
||||||
+ */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1201,7 +1203,7 @@ func (t *tester) cgoTest(dt *distTest) error {
|
|
||||||
t.addCmd(dt, "misc/cgo/test", t.goTest(), "-buildmode=pie", "-ldflags=-linkmode=internal", "-tags=internal,internal_pie")
|
|
||||||
}
|
|
||||||
t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-buildmode=pie")
|
|
||||||
- t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-buildmode=pie")
|
|
||||||
+ t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-buildmode=pie", "-tags=no_openssl")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/src/crypto/internal/boring/aes.go b/src/crypto/internal/boring/aes.go
|
|
||||||
index a495bd7..2c6107b 100644
|
|
||||||
--- a/src/crypto/internal/boring/aes.go
|
|
||||||
+++ b/src/crypto/internal/boring/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 boring
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/aes_test.go b/src/crypto/internal/boring/aes_test.go
|
|
||||||
index 3b4c364..371bc20 100644
|
|
||||||
--- a/src/crypto/internal/boring/aes_test.go
|
|
||||||
+++ b/src/crypto/internal/boring/aes_test.go
|
|
||||||
@@ -1,9 +1,5 @@
|
|
||||||
-// +build linux
|
|
||||||
-// +build !android
|
|
||||||
-// +build !no_openssl
|
|
||||||
-// +build !cmd_go_bootstrap
|
|
||||||
-// +build !msan
|
|
||||||
-// +build cgo
|
|
||||||
+//go:build linux && !android && !no_openssl && !cmd_go_bootstrap && !msan && cgo && !static
|
|
||||||
+// +build linux,!android,!no_openssl,!cmd_go_bootstrap,!msan,cgo,!static
|
|
||||||
|
|
||||||
package boring
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/boring.go b/src/crypto/internal/boring/boring.go
|
|
||||||
index ec6e80c..05431b1 100644
|
|
||||||
--- a/src/crypto/internal/boring/boring.go
|
|
||||||
+++ b/src/crypto/internal/boring/boring.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 boring
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/ecdsa.go b/src/crypto/internal/boring/ecdsa.go
|
|
||||||
index f72da41..33ee442 100644
|
|
||||||
--- a/src/crypto/internal/boring/ecdsa.go
|
|
||||||
+++ b/src/crypto/internal/boring/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 boring
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/goboringcrypto.h b/src/crypto/internal/boring/goboringcrypto.h
|
|
||||||
index 4547ade..b8aaae4 100644
|
|
||||||
--- a/src/crypto/internal/boring/goboringcrypto.h
|
|
||||||
+++ b/src/crypto/internal/boring/goboringcrypto.h
|
|
||||||
@@ -1,6 +1,12 @@
|
|
||||||
// Copyright 2017 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
+// +build linux
|
|
||||||
+// +build !android
|
|
||||||
+// +build !no_openssl
|
|
||||||
+// +build !cmd_go_bootstrap
|
|
||||||
+// +build !msan
|
|
||||||
+// +build !static
|
|
||||||
|
|
||||||
// This header file describes the BoringCrypto ABI as built for use in Go.
|
|
||||||
// The BoringCrypto build for Go (which generates goboringcrypto_*.syso)
|
|
||||||
diff --git a/src/crypto/internal/boring/goopenssl.h b/src/crypto/internal/boring/goopenssl.h
|
|
||||||
index 4820385..ac41482 100644
|
|
||||||
--- a/src/crypto/internal/boring/goopenssl.h
|
|
||||||
+++ b/src/crypto/internal/boring/goopenssl.h
|
|
||||||
@@ -6,6 +6,7 @@
|
|
||||||
// +build !no_openssl
|
|
||||||
// +build !cmd_go_bootstrap
|
|
||||||
// +build !msan
|
|
||||||
+// +build !static
|
|
||||||
|
|
||||||
// This header file describes the OpenSSL ABI as built for use in Go.
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/hmac.go b/src/crypto/internal/boring/hmac.go
|
|
||||||
index 4e913c3..10cfbb3 100644
|
|
||||||
--- a/src/crypto/internal/boring/hmac.go
|
|
||||||
+++ b/src/crypto/internal/boring/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 boring
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/notboring.go b/src/crypto/internal/boring/notboring.go
|
|
||||||
index e513834..08c5245 100644
|
|
||||||
--- a/src/crypto/internal/boring/notboring.go
|
|
||||||
+++ b/src/crypto/internal/boring/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 boring
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/openssl_ecdsa_signature.c b/src/crypto/internal/boring/openssl_ecdsa_signature.c
|
|
||||||
index 710d074..853be3d 100644
|
|
||||||
--- a/src/crypto/internal/boring/openssl_ecdsa_signature.c
|
|
||||||
+++ b/src/crypto/internal/boring/openssl_ecdsa_signature.c
|
|
||||||
@@ -3,6 +3,7 @@
|
|
||||||
// +build !no_openssl
|
|
||||||
// +build !cmd_go_bootstrap
|
|
||||||
// +build !msan
|
|
||||||
+// +build !static
|
|
||||||
|
|
||||||
#include "goboringcrypto.h"
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/openssl_evp.c b/src/crypto/internal/boring/openssl_evp.c
|
|
||||||
index 36be702..331dfd3 100644
|
|
||||||
--- a/src/crypto/internal/boring/openssl_evp.c
|
|
||||||
+++ b/src/crypto/internal/boring/openssl_evp.c
|
|
||||||
@@ -3,6 +3,7 @@
|
|
||||||
// +build !no_openssl
|
|
||||||
// +build !cmd_go_bootstrap
|
|
||||||
// +build !msan
|
|
||||||
+// +build !static
|
|
||||||
|
|
||||||
#include "goboringcrypto.h"
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/openssl_lock_setup.c b/src/crypto/internal/boring/openssl_lock_setup.c
|
|
||||||
index 955924e..c0f3435 100644
|
|
||||||
--- a/src/crypto/internal/boring/openssl_lock_setup.c
|
|
||||||
+++ b/src/crypto/internal/boring/openssl_lock_setup.c
|
|
||||||
@@ -3,6 +3,7 @@
|
|
||||||
// +build !no_openssl
|
|
||||||
// +build !cmd_go_bootstrap
|
|
||||||
// +build !msan
|
|
||||||
+// +build !static
|
|
||||||
|
|
||||||
#include "goboringcrypto.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
diff --git a/src/crypto/internal/boring/openssl_port_aead_gcm.c b/src/crypto/internal/boring/openssl_port_aead_gcm.c
|
|
||||||
index b39bf54..80c933a 100644
|
|
||||||
--- a/src/crypto/internal/boring/openssl_port_aead_gcm.c
|
|
||||||
+++ b/src/crypto/internal/boring/openssl_port_aead_gcm.c
|
|
||||||
@@ -4,6 +4,7 @@
|
|
||||||
// +build !no_openssl
|
|
||||||
// +build !cmd_go_bootstrap
|
|
||||||
// +build !msan
|
|
||||||
+// +build !static
|
|
||||||
|
|
||||||
#include "goboringcrypto.h"
|
|
||||||
#include <openssl/err.h>
|
|
||||||
diff --git a/src/crypto/internal/boring/openssl_port_ctr128.c b/src/crypto/internal/boring/openssl_port_ctr128.c
|
|
||||||
index abaff5c..e2263a5 100644
|
|
||||||
--- a/src/crypto/internal/boring/openssl_port_ctr128.c
|
|
||||||
+++ b/src/crypto/internal/boring/openssl_port_ctr128.c
|
|
||||||
@@ -3,6 +3,7 @@
|
|
||||||
// +build !no_openssl
|
|
||||||
// +build !cmd_go_bootstrap
|
|
||||||
// +build !msan
|
|
||||||
+// +build !static
|
|
||||||
|
|
||||||
#include "goboringcrypto.h"
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/openssl_port_evp_md5_sha1.c b/src/crypto/internal/boring/openssl_port_evp_md5_sha1.c
|
|
||||||
index 8418c38..39bf3ae 100644
|
|
||||||
--- a/src/crypto/internal/boring/openssl_port_evp_md5_sha1.c
|
|
||||||
+++ b/src/crypto/internal/boring/openssl_port_evp_md5_sha1.c
|
|
||||||
@@ -4,6 +4,7 @@
|
|
||||||
// +build !no_openssl
|
|
||||||
// +build !cmd_go_bootstrap
|
|
||||||
// +build !msan
|
|
||||||
+// +build !static
|
|
||||||
|
|
||||||
// The following is a partial backport of crypto/evp/m_md5_sha1.c,
|
|
||||||
// commit cbc8a839959418d8a2c2e3ec6bdf394852c9501e on the
|
|
||||||
diff --git a/src/crypto/internal/boring/openssl_port_hmac.c b/src/crypto/internal/boring/openssl_port_hmac.c
|
|
||||||
index be7c71a..35e1860 100644
|
|
||||||
--- a/src/crypto/internal/boring/openssl_port_hmac.c
|
|
||||||
+++ b/src/crypto/internal/boring/openssl_port_hmac.c
|
|
||||||
@@ -4,6 +4,8 @@
|
|
||||||
// +build !no_openssl
|
|
||||||
// +build !cmd_go_bootstrap
|
|
||||||
// +build !msan
|
|
||||||
+// +build !static
|
|
||||||
+
|
|
||||||
|
|
||||||
#include "goboringcrypto.h"
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/openssl_port_rsa.c b/src/crypto/internal/boring/openssl_port_rsa.c
|
|
||||||
index 5174f66..a8008e9 100644
|
|
||||||
--- a/src/crypto/internal/boring/openssl_port_rsa.c
|
|
||||||
+++ b/src/crypto/internal/boring/openssl_port_rsa.c
|
|
||||||
@@ -4,6 +4,7 @@
|
|
||||||
// +build !no_openssl
|
|
||||||
// +build !cmd_go_bootstrap
|
|
||||||
// +build !msan
|
|
||||||
+// +build !static
|
|
||||||
|
|
||||||
#include "goboringcrypto.h"
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/openssl_stub_rand.c b/src/crypto/internal/boring/openssl_stub_rand.c
|
|
||||||
index 18d6777..e8ac53b 100644
|
|
||||||
--- a/src/crypto/internal/boring/openssl_stub_rand.c
|
|
||||||
+++ b/src/crypto/internal/boring/openssl_stub_rand.c
|
|
||||||
@@ -3,6 +3,7 @@
|
|
||||||
// +build !no_openssl
|
|
||||||
// +build !cmd_go_bootstrap
|
|
||||||
// +build !msan
|
|
||||||
+// +build !static
|
|
||||||
|
|
||||||
#include "goboringcrypto.h"
|
|
||||||
#include <openssl/rand.h>
|
|
||||||
diff --git a/src/crypto/internal/boring/rand.go b/src/crypto/internal/boring/rand.go
|
|
||||||
index e9c334f..3adbd4d 100644
|
|
||||||
--- a/src/crypto/internal/boring/rand.go
|
|
||||||
+++ b/src/crypto/internal/boring/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 boring
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/rsa.go b/src/crypto/internal/boring/rsa.go
|
|
||||||
index b1a2f57..0cabadb 100644
|
|
||||||
--- a/src/crypto/internal/boring/rsa.go
|
|
||||||
+++ b/src/crypto/internal/boring/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 boring
|
|
||||||
|
|
||||||
diff --git a/src/crypto/internal/boring/sha.go b/src/crypto/internal/boring/sha.go
|
|
||||||
index bdcc782..6184d6c 100644
|
|
||||||
--- a/src/crypto/internal/boring/sha.go
|
|
||||||
+++ b/src/crypto/internal/boring/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 boring
|
|
||||||
|
|
@ -1,288 +0,0 @@
|
|||||||
diff --git a/src/crypto/internal/backend/nobackend.go b/src/crypto/internal/backend/nobackend.go
|
|
||||||
index 5f258a2..5dbbc42 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/boring/goboringcrypto.h b/src/crypto/internal/boring/goboringcrypto.h
|
|
||||||
index d6d99b1..f2fe332 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/vendor/github.com/golang-fips/openssl-fips/openssl/aes.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/aes.go
|
|
||||||
index 079fc3c..e826d0b 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/aes.go
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/ecdh.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdh.go
|
|
||||||
index 0b61e79..94d0c98 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdh.go
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/ecdsa.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdsa.go
|
|
||||||
index afec529..d822152 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdsa.go
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/goopenssl.h b/src/vendor/github.com/golang-fips/openssl-fips/openssl/goopenssl.h
|
|
||||||
index 6d6a562..17cc314 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/goopenssl.h
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/hkdf.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/hkdf.go
|
|
||||||
index ae40b93..17bc075 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/hkdf.go
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/hmac.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/hmac.go
|
|
||||||
index 6f00177..f466b18 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/hmac.go
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/notboring.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/notboring.go
|
|
||||||
index 7c0b5d6..262af07 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/notboring.go
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/openssl.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl.go
|
|
||||||
index d49194d..ff15054 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl.go
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/openssl_ecdsa_signature.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_ecdsa_signature.c
|
|
||||||
index 2349db1..57fbb04 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_ecdsa_signature.c
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/openssl_evp.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c
|
|
||||||
index 4379019..5034c46 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/openssl_lock_setup.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_lock_setup.c
|
|
||||||
index 49d40a7..3b3dbf8 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_lock_setup.c
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/openssl_port_aead_gcm.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_aead_gcm.c
|
|
||||||
index 7eb645e..1c3225a 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_aead_gcm.c
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/openssl_port_ctr128.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_ctr128.c
|
|
||||||
index df4ebe3..876393b 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_ctr128.c
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/openssl_port_evp_md5_sha1.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_evp_md5_sha1.c
|
|
||||||
index 2eedd5b..04510d3 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_evp_md5_sha1.c
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/openssl_port_hmac.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_hmac.c
|
|
||||||
index 362d9e5..bebafef 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_hmac.c
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/openssl_port_rsa.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_rsa.c
|
|
||||||
index 2824147..8bc1d85 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_rsa.c
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/openssl_stub_rand.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_stub_rand.c
|
|
||||||
index 22bd865..b7aa26b 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_stub_rand.c
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/rand.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/rand.go
|
|
||||||
index b3668b8..dcdae70 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/rand.go
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/rsa.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/rsa.go
|
|
||||||
index 915c840..8623d9d 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/rsa.go
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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-fips/openssl/sha.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/sha.go
|
|
||||||
index 0b55ced..57309c0 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/sha.go
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/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
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
|||||||
diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c
|
|
||||||
index 76bac5b..24a9615 100644
|
|
||||||
--- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c
|
|
||||||
+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c
|
|
||||||
@@ -43,7 +43,11 @@ int _goboringcrypto_EVP_sign_raw(EVP_MD *md, EVP_PKEY_CTX *ctx, const uint8_t *m
|
|
||||||
GO_RSA *rsa_key) {
|
|
||||||
int ret = 0;
|
|
||||||
GO_EVP_PKEY *pk = _goboringcrypto_EVP_PKEY_new();
|
|
||||||
- _goboringcrypto_EVP_PKEY_assign_RSA(pk, rsa_key);
|
|
||||||
+ if (!pk)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ if (!(_goboringcrypto_EVP_PKEY_set1_RSA(pk, rsa_key)))
|
|
||||||
+ goto err;
|
|
||||||
|
|
||||||
if (!ctx && !(ctx = _goboringcrypto_EVP_PKEY_CTX_new(pk, NULL)))
|
|
||||||
goto err;
|
|
||||||
@@ -63,6 +67,8 @@ int _goboringcrypto_EVP_sign_raw(EVP_MD *md, EVP_PKEY_CTX *ctx, const uint8_t *m
|
|
||||||
err:
|
|
||||||
if (ctx)
|
|
||||||
_goboringcrypto_EVP_PKEY_CTX_free(ctx);
|
|
||||||
+ if (pk)
|
|
||||||
+ _goboringcrypto_EVP_PKEY_free(pk);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
@@ -103,7 +109,11 @@ int _goboringcrypto_EVP_verify_raw(const uint8_t *msg, size_t msgLen,
|
|
||||||
int ret = 0;
|
|
||||||
EVP_PKEY_CTX *ctx;
|
|
||||||
GO_EVP_PKEY *pk = _goboringcrypto_EVP_PKEY_new();
|
|
||||||
- _goboringcrypto_EVP_PKEY_assign_RSA(pk, rsa_key);
|
|
||||||
+ if (!pk)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ if (!(_goboringcrypto_EVP_PKEY_set1_RSA(pk, rsa_key)))
|
|
||||||
+ goto err;
|
|
||||||
|
|
||||||
if (!(ctx = _goboringcrypto_EVP_PKEY_CTX_new(pk, NULL)))
|
|
||||||
goto err;
|
|
||||||
@@ -123,6 +133,8 @@ int _goboringcrypto_EVP_verify_raw(const uint8_t *msg, size_t msgLen,
|
|
||||||
err:
|
|
||||||
if (ctx)
|
|
||||||
_goboringcrypto_EVP_PKEY_CTX_free(ctx);
|
|
||||||
+ if (pk)
|
|
||||||
+ _goboringcrypto_EVP_PKEY_free(pk);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
--- !Policy
|
|
||||||
product_versions:
|
|
||||||
- rhel-9
|
|
||||||
decision_context: osci_compose_gate
|
|
||||||
rules:
|
|
||||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
|
|
@ -1,73 +0,0 @@
|
|||||||
diff --git a/src/time/internal_test.go b/src/time/internal_test.go
|
|
||||||
index f0dddb7..415949a 100644
|
|
||||||
--- a/src/time/internal_test.go
|
|
||||||
+++ b/src/time/internal_test.go
|
|
||||||
@@ -4,13 +4,15 @@
|
|
||||||
|
|
||||||
package time
|
|
||||||
|
|
||||||
+import "runtime"
|
|
||||||
+
|
|
||||||
func init() {
|
|
||||||
// force US/Pacific for time zone tests
|
|
||||||
ForceUSPacificForTesting()
|
|
||||||
}
|
|
||||||
|
|
||||||
func initTestingZone() {
|
|
||||||
- z, err := loadLocation("America/Los_Angeles", zoneSources[len(zoneSources)-1:])
|
|
||||||
+ z, err := loadLocation("America/Los_Angeles", zoneSources)
|
|
||||||
if err != nil {
|
|
||||||
panic("cannot load America/Los_Angeles for testing: " + err.Error() + "; you may want to use -tags=timetzdata")
|
|
||||||
}
|
|
||||||
@@ -21,8 +23,9 @@ func initTestingZone() {
|
|
||||||
var OrigZoneSources = zoneSources
|
|
||||||
|
|
||||||
func forceZipFileForTesting(zipOnly bool) {
|
|
||||||
- zoneSources = make([]string, len(OrigZoneSources))
|
|
||||||
+ zoneSources = make([]string, len(OrigZoneSources)+1)
|
|
||||||
copy(zoneSources, OrigZoneSources)
|
|
||||||
+ zoneSources = append(zoneSources, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
|
|
||||||
if zipOnly {
|
|
||||||
zoneSources = zoneSources[len(zoneSources)-1:]
|
|
||||||
}
|
|
||||||
diff --git a/src/time/zoneinfo_test.go b/src/time/zoneinfo_test.go
|
|
||||||
index f032aa7..e3e5547 100644
|
|
||||||
--- a/src/time/zoneinfo_test.go
|
|
||||||
+++ b/src/time/zoneinfo_test.go
|
|
||||||
@@ -9,6 +9,7 @@ import (
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"reflect"
|
|
||||||
+ "runtime"
|
|
||||||
"testing"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
@@ -137,7 +138,7 @@ func TestLoadLocationFromTZData(t *testing.T) {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
- tzinfo, err := time.LoadTzinfo(locationName, time.OrigZoneSources[len(time.OrigZoneSources)-1])
|
|
||||||
+ tzinfo, err := time.LoadTzinfo(locationName, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
|
|
||||||
index 23f8b3c..228db1b 100644
|
|
||||||
--- a/src/time/zoneinfo_unix.go
|
|
||||||
+++ b/src/time/zoneinfo_unix.go
|
|
||||||
@@ -12,7 +12,6 @@
|
|
||||||
package time
|
|
||||||
|
|
||||||
import (
|
|
||||||
- "runtime"
|
|
||||||
"syscall"
|
|
||||||
)
|
|
||||||
|
|
||||||
@@ -22,7 +21,6 @@ var zoneSources = []string{
|
|
||||||
"/usr/share/zoneinfo/",
|
|
||||||
"/usr/share/lib/zoneinfo/",
|
|
||||||
"/usr/lib/locale/TZ/",
|
|
||||||
- runtime.GOROOT() + "/lib/time/zoneinfo.zip",
|
|
||||||
}
|
|
||||||
|
|
||||||
func initLocal() {
|
|
@ -1,112 +0,0 @@
|
|||||||
diff --git a/src/crypto/rsa/pkcs1v15_test.go b/src/crypto/rsa/pkcs1v15_test.go
|
|
||||||
index a4f2e2dbbe..76701d2e2b 100644
|
|
||||||
--- a/src/crypto/rsa/pkcs1v15_test.go
|
|
||||||
+++ b/src/crypto/rsa/pkcs1v15_test.go
|
|
||||||
@@ -52,6 +52,7 @@ var decryptPKCS1v15Tests = []DecryptPKCS1v15Test{
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestDecryptPKCS1v15(t *testing.T) {
|
|
||||||
+ t.Skip("not supported in FIPS mode")
|
|
||||||
decryptionFuncs := []func([]byte) ([]byte, error){
|
|
||||||
func(ciphertext []byte) (plaintext []byte, err error) {
|
|
||||||
return DecryptPKCS1v15(nil, testRSA2048PrivateKey, ciphertext)
|
|
||||||
@@ -76,6 +77,7 @@ func TestDecryptPKCS1v15(t *testing.T) {
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestEncryptPKCS1v15(t *testing.T) {
|
|
||||||
+ t.Skip("not supported in FIPS mode")
|
|
||||||
random := rand.Reader
|
|
||||||
k := (testRSA2048PrivateKey.N.BitLen() + 7) / 8
|
|
||||||
|
|
||||||
@@ -137,6 +139,7 @@ var decryptPKCS1v15SessionKeyTests = []DecryptPKCS1v15Test{
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestEncryptPKCS1v15SessionKey(t *testing.T) {
|
|
||||||
+ t.Skip("not supported in FIPS mode")
|
|
||||||
for i, test := range decryptPKCS1v15SessionKeyTests {
|
|
||||||
key := []byte("FAIL")
|
|
||||||
err := DecryptPKCS1v15SessionKey(nil, testRSA2048PrivateKey, decodeBase64(test.in), key)
|
|
||||||
@@ -151,6 +154,7 @@ func TestEncryptPKCS1v15SessionKey(t *testing.T) {
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestEncryptPKCS1v15DecrypterSessionKey(t *testing.T) {
|
|
||||||
+ t.Skip("not supported in FIPS mode")
|
|
||||||
for i, test := range decryptPKCS1v15SessionKeyTests {
|
|
||||||
plaintext, err := testRSA2048PrivateKey.Decrypt(rand.Reader, decodeBase64(test.in), &PKCS1v15DecryptOptions{SessionKeyLen: 4})
|
|
||||||
if err != nil {
|
|
||||||
@@ -270,6 +274,7 @@ func TestUnpaddedSignature(t *testing.T) {
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestShortSessionKey(t *testing.T) {
|
|
||||||
+ t.Skip("not supported in FIPS mode")
|
|
||||||
// This tests that attempting to decrypt a session key where the
|
|
||||||
// ciphertext is too small doesn't run outside the array bounds.
|
|
||||||
ciphertext, err := EncryptPKCS1v15(rand.Reader, &testRSA2048PrivateKey.PublicKey, []byte{1})
|
|
||||||
diff --git a/src/crypto/rsa/pss_test.go b/src/crypto/rsa/pss_test.go
|
|
||||||
index b547a87c71..99e7882866 100644
|
|
||||||
--- a/src/crypto/rsa/pss_test.go
|
|
||||||
+++ b/src/crypto/rsa/pss_test.go
|
|
||||||
@@ -77,6 +77,7 @@ func TestEMSAPSS(t *testing.T) {
|
|
||||||
// TestPSSGolden tests all the test vectors in pss-vect.txt from
|
|
||||||
// ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1-vec.zip
|
|
||||||
func TestPSSGolden(t *testing.T) {
|
|
||||||
+ t.Skip("SHA1 not supported in boring mode")
|
|
||||||
inFile, err := os.Open("testdata/pss-vect.txt.bz2")
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("Failed to open input file: %s", err)
|
|
||||||
diff --git a/src/crypto/rsa/rsa_test.go b/src/crypto/rsa/rsa_test.go
|
|
||||||
index 9aa67655ab..2f4e666abb 100644
|
|
||||||
--- a/src/crypto/rsa/rsa_test.go
|
|
||||||
+++ b/src/crypto/rsa/rsa_test.go
|
|
||||||
@@ -123,28 +123,29 @@ func testKeyBasics(t *testing.T, priv *PrivateKey) {
|
|
||||||
t.Errorf("private exponent too large")
|
|
||||||
}
|
|
||||||
|
|
||||||
- if boring.Enabled() {
|
|
||||||
- // Cannot call encrypt/decrypt directly. Test via PKCS1v15.
|
|
||||||
- msg := []byte("hi!")
|
|
||||||
- if priv.Size() >= 256 {
|
|
||||||
- enc, err := EncryptPKCS1v15(rand.Reader, &priv.PublicKey, msg)
|
|
||||||
- if err != nil {
|
|
||||||
- t.Errorf("EncryptPKCS1v15: %v", err)
|
|
||||||
- return
|
|
||||||
- }
|
|
||||||
- dec, err := DecryptPKCS1v15(rand.Reader, priv, enc)
|
|
||||||
- if err != nil {
|
|
||||||
- t.Errorf("DecryptPKCS1v15: %v", err)
|
|
||||||
- return
|
|
||||||
- }
|
|
||||||
- if !bytes.Equal(dec, msg) {
|
|
||||||
- t.Errorf("got:%x want:%x (%+v)", dec, msg, priv)
|
|
||||||
- }
|
|
||||||
- } else {
|
|
||||||
- t.Logf("skipping check for unsupported key less than 2048 bits")
|
|
||||||
- }
|
|
||||||
- return
|
|
||||||
- }
|
|
||||||
+ if boring.Enabled() {
|
|
||||||
+ // Cannot call encrypt/decrypt directly. Test via EncryptOAEP.
|
|
||||||
+ sha256 := sha256.New()
|
|
||||||
+ msg := []byte("hi!")
|
|
||||||
+ if priv.Size() >= 256 {
|
|
||||||
+ enc, err := EncryptOAEP(sha256, rand.Reader, &priv.PublicKey, msg, nil)
|
|
||||||
+ if err != nil {
|
|
||||||
+ t.Errorf("EncryptOAEP: %v", err)
|
|
||||||
+ return
|
|
||||||
+ }
|
|
||||||
+ dec, err := DecryptOAEP(sha256, rand.Reader, priv, enc, nil)
|
|
||||||
+ if err != nil {
|
|
||||||
+ t.Errorf("DecryptOAEP: %v", err)
|
|
||||||
+ return
|
|
||||||
+ }
|
|
||||||
+ if !bytes.Equal(dec, msg) {
|
|
||||||
+ t.Errorf("got:%x want:%x (%+v)", dec, msg, priv)
|
|
||||||
+ }
|
|
||||||
+ } else {
|
|
||||||
+ t.Logf("skipping check for unsupported key less than 2048 bits")
|
|
||||||
+ }
|
|
||||||
+ return
|
|
||||||
+ }
|
|
||||||
|
|
||||||
pub := &priv.PublicKey
|
|
||||||
m := big.NewInt(42)
|
|
@ -1,128 +0,0 @@
|
|||||||
From d7cad65ab9179804e9f089ce97bc124e9ef79494 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= <asm@redhat.com>
|
|
||||||
Date: Wed, 15 Dec 2021 16:02:15 +0100
|
|
||||||
Subject: [PATCH] Remove ed25519vectors_test.go
|
|
||||||
|
|
||||||
---
|
|
||||||
src/crypto/ed25519/ed25519vectors_test.go | 109 ----------------------
|
|
||||||
1 file changed, 109 deletions(-)
|
|
||||||
delete mode 100644 src/crypto/ed25519/ed25519vectors_test.go
|
|
||||||
|
|
||||||
diff --git a/src/crypto/ed25519/ed25519vectors_test.go b/src/crypto/ed25519/ed25519vectors_test.go
|
|
||||||
deleted file mode 100644
|
|
||||||
index 74fcdcdf4e..0000000000
|
|
||||||
--- a/src/crypto/ed25519/ed25519vectors_test.go
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1,109 +0,0 @@
|
|
||||||
-// Copyright 2021 The Go Authors. All rights reserved.
|
|
||||||
-// Use of this source code is governed by a BSD-style
|
|
||||||
-// license that can be found in the LICENSE file.
|
|
||||||
-
|
|
||||||
-package ed25519_test
|
|
||||||
-
|
|
||||||
-import (
|
|
||||||
- "crypto/ed25519"
|
|
||||||
- "encoding/hex"
|
|
||||||
- "encoding/json"
|
|
||||||
- "internal/testenv"
|
|
||||||
- "os"
|
|
||||||
- "os/exec"
|
|
||||||
- "path/filepath"
|
|
||||||
- "testing"
|
|
||||||
-)
|
|
||||||
-
|
|
||||||
-// TestEd25519Vectors runs a very large set of test vectors that exercise all
|
|
||||||
-// combinations of low-order points, low-order components, and non-canonical
|
|
||||||
-// encodings. These vectors lock in unspecified and spec-divergent behaviors in
|
|
||||||
-// edge cases that are not security relevant in most contexts, but that can
|
|
||||||
-// cause issues in consensus applications if changed.
|
|
||||||
-//
|
|
||||||
-// Our behavior matches the "classic" unwritten verification rules of the
|
|
||||||
-// "ref10" reference implementation.
|
|
||||||
-//
|
|
||||||
-// Note that although we test for these edge cases, they are not covered by the
|
|
||||||
-// Go 1 Compatibility Promise. Applications that need stable verification rules
|
|
||||||
-// should use github.com/hdevalence/ed25519consensus.
|
|
||||||
-//
|
|
||||||
-// See https://hdevalence.ca/blog/2020-10-04-its-25519am for more details.
|
|
||||||
-func TestEd25519Vectors(t *testing.T) {
|
|
||||||
- jsonVectors := downloadEd25519Vectors(t)
|
|
||||||
- var vectors []struct {
|
|
||||||
- A, R, S, M string
|
|
||||||
- Flags []string
|
|
||||||
- }
|
|
||||||
- if err := json.Unmarshal(jsonVectors, &vectors); err != nil {
|
|
||||||
- t.Fatal(err)
|
|
||||||
- }
|
|
||||||
- for i, v := range vectors {
|
|
||||||
- expectedToVerify := true
|
|
||||||
- for _, f := range v.Flags {
|
|
||||||
- switch f {
|
|
||||||
- // We use the simplified verification formula that doesn't multiply
|
|
||||||
- // by the cofactor, so any low order residue will cause the
|
|
||||||
- // signature not to verify.
|
|
||||||
- //
|
|
||||||
- // This is allowed, but not required, by RFC 8032.
|
|
||||||
- case "LowOrderResidue":
|
|
||||||
- expectedToVerify = false
|
|
||||||
- // Our point decoding allows non-canonical encodings (in violation
|
|
||||||
- // of RFC 8032) but R is not decoded: instead, R is recomputed and
|
|
||||||
- // compared bytewise against the canonical encoding.
|
|
||||||
- case "NonCanonicalR":
|
|
||||||
- expectedToVerify = false
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- publicKey := decodeHex(t, v.A)
|
|
||||||
- signature := append(decodeHex(t, v.R), decodeHex(t, v.S)...)
|
|
||||||
- message := []byte(v.M)
|
|
||||||
-
|
|
||||||
- didVerify := ed25519.Verify(publicKey, message, signature)
|
|
||||||
- if didVerify && !expectedToVerify {
|
|
||||||
- t.Errorf("#%d: vector with flags %s unexpectedly verified", i, v.Flags)
|
|
||||||
- }
|
|
||||||
- if !didVerify && expectedToVerify {
|
|
||||||
- t.Errorf("#%d: vector with flags %s unexpectedly rejected", i, v.Flags)
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-func downloadEd25519Vectors(t *testing.T) []byte {
|
|
||||||
- testenv.MustHaveExternalNetwork(t)
|
|
||||||
-
|
|
||||||
- // Download the JSON test file from the GOPROXY with `go mod download`,
|
|
||||||
- // pinning the version so test and module caching works as expected.
|
|
||||||
- goTool := testenv.GoToolPath(t)
|
|
||||||
- path := "filippo.io/mostly-harmless/ed25519vectors@v0.0.0-20210322192420-30a2d7243a94"
|
|
||||||
- cmd := exec.Command(goTool, "mod", "download", "-json", path)
|
|
||||||
- // TODO: enable the sumdb once the TryBots proxy supports it.
|
|
||||||
- cmd.Env = append(os.Environ(), "GONOSUMDB=*")
|
|
||||||
- output, err := cmd.Output()
|
|
||||||
- if err != nil {
|
|
||||||
- t.Fatalf("failed to run `go mod download -json %s`, output: %s", path, output)
|
|
||||||
- }
|
|
||||||
- var dm struct {
|
|
||||||
- Dir string // absolute path to cached source root directory
|
|
||||||
- }
|
|
||||||
- if err := json.Unmarshal(output, &dm); err != nil {
|
|
||||||
- t.Fatal(err)
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- jsonVectors, err := os.ReadFile(filepath.Join(dm.Dir, "ed25519vectors.json"))
|
|
||||||
- if err != nil {
|
|
||||||
- t.Fatalf("failed to read ed25519vectors.json: %v", err)
|
|
||||||
- }
|
|
||||||
- return jsonVectors
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-func decodeHex(t *testing.T, s string) []byte {
|
|
||||||
- t.Helper()
|
|
||||||
- b, err := hex.DecodeString(s)
|
|
||||||
- if err != nil {
|
|
||||||
- t.Errorf("invalid hex: %v", err)
|
|
||||||
- }
|
|
||||||
- return b
|
|
||||||
-}
|
|
||||||
--
|
|
||||||
2.33.1
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
|||||||
From 4ec78a579cc3c83a7d0afc7483fb3e69e2fd87a7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Paul E. Murphy" <murp@ibm.com>
|
|
||||||
Date: Tue, 27 Apr 2021 15:05:51 -0500
|
|
||||||
Subject: [PATCH] cmd/link: disable plugin support if cgo is disabled
|
|
||||||
|
|
||||||
Functional plugin support requires cgo to be enabled. Disable
|
|
||||||
it if the environment has disabled cgo.
|
|
||||||
|
|
||||||
This prevents unexpected linker failures when linking large
|
|
||||||
binaries with cgo disabled which use the plugin package.
|
|
||||||
|
|
||||||
Fixes #45564
|
|
||||||
|
|
||||||
Change-Id: Ib71f0e089f7373b7b3e3cd53da3612291e7bc473
|
|
||||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/314449
|
|
||||||
Run-TryBot: Paul Murphy <murp@ibm.com>
|
|
||||||
Reviewed-by: Cherry Zhang <cherryyz@google.com>
|
|
||||||
TryBot-Result: Go Bot <gobot@golang.org>
|
|
||||||
Trust: Lynn Boger <laboger@linux.vnet.ibm.com>
|
|
||||||
---
|
|
||||||
src/cmd/link/internal/ld/lib.go | 5 ++++-
|
|
||||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
|
|
||||||
index 0e77424884..f7a32aebae 100644
|
|
||||||
--- a/src/cmd/link/internal/ld/lib.go
|
|
||||||
+++ b/src/cmd/link/internal/ld/lib.go
|
|
||||||
@@ -533,7 +533,10 @@ func (ctxt *Link) loadlib() {
|
|
||||||
// up symbol by name may not get expected result.
|
|
||||||
|
|
||||||
iscgo = ctxt.LibraryByPkg["runtime/cgo"] != nil
|
|
||||||
- ctxt.canUsePlugins = ctxt.LibraryByPkg["plugin"] != nil
|
|
||||||
+
|
|
||||||
+ // Plugins a require cgo support to function. Similarly, plugins may require additional
|
|
||||||
+ // internal linker support on some platforms which may not be implemented.
|
|
||||||
+ ctxt.canUsePlugins = ctxt.LibraryByPkg["plugin"] != nil && iscgo
|
|
||||||
|
|
||||||
// We now have enough information to determine the link mode.
|
|
||||||
determineLinkMode(ctxt)
|
|
||||||
--
|
|
||||||
2.30.2
|
|
||||||
|
|
2
sources
2
sources
@ -1,2 +0,0 @@
|
|||||||
SHA512 (go1.20.6.tar.gz) = 45990e2bb4ddf84646ecca5814a62b4330063188238b5ab3f9d47f517a227ea7a981fe3d50681f4187462d01d0c1601cb01375f940569a5465b78065a4371cd4
|
|
||||||
SHA512 (go1.20.6-1-openssl-fips.tar.gz) = 7e1f9a61b8d419233b41d4592e8741a9d3039120c1fb444cfd7ac229d65a8031ecf1644e1161bc6cf5739ac7ec84e6405eb101f63b5a972ecb6b2ea69cea39e2
|
|
Loading…
Reference in New Issue
Block a user