$44 GRAYBYTE WORDPRESS FILE MANAGER $49

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/lib/golang/src/crypto/tls/

HOME
Current File : /usr/lib/golang/src/crypto/tls//defaults_fips140.go
// Copyright 2025 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 tls

import (
	"crypto/ecdsa"
	"crypto/ed25519"
	"crypto/elliptic"
	"crypto/rsa"
	"crypto/x509"
	boring "crypto/internal/backend"
)

// These FIPS 140-3 policies allow anything approved by SP 800-140C
// and SP 800-140D, and tested as part of the Go Cryptographic Module.
//
// Notably, not SHA-1, 3DES, RC4, ChaCha20Poly1305, RSA PKCS #1 v1.5 key
// transport, or TLS 1.0—1.1 (because we don't test its KDF).
//
// These are not default lists, but filters to apply to the default or
// configured lists. Missing items are treated as if they were not implemented.
//
// They are applied when the fips140 GODEBUG is "on" or "only".

var (
	allowedSupportedVersionsFIPS = []uint16{
		VersionTLS12,
		VersionTLS13,
	}
	allowedCurvePreferencesFIPS = []CurveID{
		X25519MLKEM768,
		CurveP256,
		CurveP384,
		CurveP521,
	}
	allowedSignatureAlgorithmsFIPS = []SignatureScheme{
		PSSWithSHA256,
		ECDSAWithP256AndSHA256,
		Ed25519,
		PSSWithSHA384,
		PSSWithSHA512,
		PKCS1WithSHA256,
		PKCS1WithSHA384,
		PKCS1WithSHA512,
		ECDSAWithP384AndSHA384,
		ECDSAWithP521AndSHA512,
	}
	allowedCipherSuitesFIPS = []uint16{
		TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
		TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
		TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
		TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
		TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
		TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
	}
	allowedCipherSuitesTLS13FIPS = []uint16{
		TLS_AES_128_GCM_SHA256,
		TLS_AES_256_GCM_SHA384,
	}
)

func init() {
	if boring.Enabled() {
		allowedSupportedVersionsFIPS = allowedSupportedVersionsBoring
		allowedCurvePreferencesFIPS = allowedCurvePreferencesBoring
		allowedSignatureAlgorithmsFIPS = allowedSignatureAlgorithmsBoring
		allowedCipherSuitesFIPS = allowedCipherSuitesBoring
		allowedCipherSuitesTLS13FIPS = allowedCipherSuitesTLS13Boring
	}
}

func isCertificateAllowedFIPS(c *x509.Certificate) bool {
	if boring.Enabled() {
		return isCertificateAllowedBoring(c)
	}
	switch k := c.PublicKey.(type) {
	case *rsa.PublicKey:
		return k.N.BitLen() >= 2048
	case *ecdsa.PublicKey:
		return k.Curve == elliptic.P256() || k.Curve == elliptic.P384() || k.Curve == elliptic.P521()
	case ed25519.PublicKey:
		return true
	default:
		return false
	}
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Dec 2025 9.30 PM
root / root
0755
fipsonly
--
16 Dec 2025 9.30 PM
root / root
0755
internal
--
4 Dec 2025 6.06 PM
root / root
0755
alert.go
4.295 KB
4 Dec 2025 6.06 PM
root / root
0644
auth.go
9.687 KB
4 Dec 2025 6.06 PM
root / root
0644
bogo_config.json
17.998 KB
4 Dec 2025 6.06 PM
root / root
0644
cache.go
1.258 KB
4 Dec 2025 6.06 PM
root / root
0644
cipher_suites.go
25.916 KB
4 Dec 2025 6.06 PM
root / root
0644
common.go
65.561 KB
4 Dec 2025 6.06 PM
root / root
0644
common_string.go
3.375 KB
4 Dec 2025 6.06 PM
root / root
0644
conn.go
52.15 KB
4 Dec 2025 6.06 PM
root / root
0644
defaults.go
3.057 KB
4 Dec 2025 6.06 PM
root / root
0644
defaults_boring.go
1.729 KB
4 Dec 2025 6.06 PM
root / root
0644
defaults_fips140.go
2.329 KB
4 Dec 2025 6.06 PM
root / root
0644
ech.go
18.911 KB
4 Dec 2025 6.06 PM
root / root
0644
generate_cert.go
4.831 KB
4 Dec 2025 6.06 PM
root / root
0644
handshake_client.go
40.648 KB
4 Dec 2025 6.06 PM
root / root
0644
handshake_client_tls13.go
28.283 KB
4 Dec 2025 6.06 PM
root / root
0644
handshake_messages.go
52.43 KB
4 Dec 2025 6.06 PM
root / root
0644
handshake_server.go
30.376 KB
4 Dec 2025 6.06 PM
root / root
0644
handshake_server_tls13.go
35.632 KB
4 Dec 2025 6.06 PM
root / root
0644
key_agreement.go
12.354 KB
4 Dec 2025 6.06 PM
root / root
0644
key_schedule.go
3.458 KB
4 Dec 2025 6.06 PM
root / root
0644
prf.go
9.143 KB
4 Dec 2025 6.06 PM
root / root
0644
quic.go
15.06 KB
4 Dec 2025 6.06 PM
root / root
0644
ticket.go
12.627 KB
4 Dec 2025 6.06 PM
root / root
0644
tls.go
12.796 KB
4 Dec 2025 6.06 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF