Compare commits
No commits in common. 'c9' and 'c9-beta' have entirely different histories.
@ -1,3 +1,3 @@
|
|||||||
SOURCES/compiler-rt-18.1.8.src.tar.xz
|
SOURCES/compiler-rt-18.1.8.src.tar.xz
|
||||||
SOURCES/go1.22.9-1-openssl-fips.tar.gz
|
SOURCES/go1.22.5-1-openssl-fips.tar.gz
|
||||||
SOURCES/go1.22.9.tar.gz
|
SOURCES/go1.22.5.tar.gz
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
6ecbfa5516b60adb4e4e60f991b0d8ddf5aab12a SOURCES/compiler-rt-18.1.8.src.tar.xz
|
6ecbfa5516b60adb4e4e60f991b0d8ddf5aab12a SOURCES/compiler-rt-18.1.8.src.tar.xz
|
||||||
af6e318112b0e4fa6f42978d5c80e2c4fc5ca02c SOURCES/go1.22.9-1-openssl-fips.tar.gz
|
aa46d1a360c3c9e85a2c5b75dfa927d3d4ccf016 SOURCES/go1.22.5-1-openssl-fips.tar.gz
|
||||||
3860690f8aee2de5da3cd46af6e84f4f94bfc5f0 SOURCES/go1.22.9.tar.gz
|
38de97e677498c347fb7350e40a5d61be29973f9 SOURCES/go1.22.5.tar.gz
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
diff --git a/src/crypto/internal/backend/openssl.go b/src/crypto/internal/backend/openssl.go
|
||||||
|
index 3d3a9a36ee..8dc2d46b52 100644
|
||||||
|
--- a/src/crypto/internal/backend/openssl.go
|
||||||
|
+++ b/src/crypto/internal/backend/openssl.go
|
||||||
|
@@ -25,6 +25,22 @@ var enabled bool
|
||||||
|
var knownVersions = [...]string{"3", "1.1", "11", "111", "1.0.2", "1.0.0", "10"}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
+ // 0: FIPS opt-out: abort the process if it is enabled and can't be disabled.
|
||||||
|
+ // 1: FIPS required: abort the process if it is not enabled and can't be enabled.
|
||||||
|
+ // other values: do not override OpenSSL configured FIPS mode.
|
||||||
|
+ var fips string
|
||||||
|
+ if v, ok := syscall.Getenv("GOLANG_FIPS"); ok {
|
||||||
|
+ fips = v
|
||||||
|
+ } else if hostFIPSModeEnabled() {
|
||||||
|
+ // System configuration can only force FIPS mode.
|
||||||
|
+ fips = "1"
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // Use Go standard crypto, do not load openssl
|
||||||
|
+ if (fips != "1") {
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
version, _ := syscall.Getenv("GO_OPENSSL_VERSION_OVERRIDE")
|
||||||
|
if version == "" {
|
||||||
|
var fallbackVersion string
|
||||||
|
@@ -49,16 +65,6 @@ func init() {
|
||||||
|
if err := openssl.Init(version); err != nil {
|
||||||
|
panic("opensslcrypto: can't initialize OpenSSL " + version + ": " + err.Error())
|
||||||
|
}
|
||||||
|
- // 0: FIPS opt-out: abort the process if it is enabled and can't be disabled.
|
||||||
|
- // 1: FIPS required: abort the process if it is not enabled and can't be enabled.
|
||||||
|
- // other values: do not override OpenSSL configured FIPS mode.
|
||||||
|
- var fips string
|
||||||
|
- if v, ok := syscall.Getenv("GOLANG_FIPS"); ok {
|
||||||
|
- fips = v
|
||||||
|
- } else if hostFIPSModeEnabled() {
|
||||||
|
- // System configuration can only force FIPS mode.
|
||||||
|
- fips = "1"
|
||||||
|
- }
|
||||||
|
switch fips {
|
||||||
|
case "0":
|
||||||
|
if openssl.FIPS() {
|
Loading…
Reference in new issue