Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAlgorithms ¶ added in v1.26.0
func DefaultAlgorithms(_ ...Option) ssh.Algorithms
DefaultAlgorithms returns the algorithms enabled by default. No FIPS policy is applied; only empty names are dropped (see dropAlgorithms).
Options are accepted and ignored, as in SupportedAlgorithms.
PublicKeyAuths is left empty here, unlike in a fips build. ssh.NewServerConn then substitutes its own default, which is what a non-FIPS server offers today; restricting it would drop ssh-rsa for deployments that have made no FIPS commitment.
func HostKeySigner ¶ added in v1.64.12
HostKeySigner returns signer unchanged. Without the fips build tag there is no signature algorithm policy to enforce, so callers can wrap every host key unconditionally and let the build tag decide.
func SupportedAlgorithms ¶ added in v1.25.0
func SupportedAlgorithms(_ ...Option) ssh.Algorithms
SupportedAlgorithms returns the algorithms currently implemented by Go's SSH package. No FIPS policy is applied; only empty names are dropped (see dropAlgorithms).
Options are accepted and ignored. Without the fips build tag there is no policy to adjust, so callers can pass them unconditionally and let the build tag decide.
Types ¶
type Option ¶ added in v1.64.12
type Option func(*options)
Option adjusts the algorithm sets returned by SupportedAlgorithms and DefaultAlgorithms.
Options are variadic so both functions stay backward compatible as the policy grows. A nil Option is ignored.
func WithoutDeprecated ¶ added in v1.64.12
func WithoutDeprecated() Option
WithoutDeprecated excludes the algorithms that FIPS 140-3 still approves but that are not part of GitLab's hardened baseline. Two groups qualify, for two different reasons:
- The SHA-1 constructions hmac-sha1, hmac-sha1-96 and diffie-hellman-group14-sha1. HMAC-SHA-1 is an approved MAC (SP 800-140C Rev. 2, via FIPS 198-1), 96-bit truncation is permitted by SP 800-107 Rev. 1 Section 5.3.4, and SHA-1 in the SSH KDF is permitted by SP 800-135 Rev. 1 Section 5.2. SP 800-131A deprecates SHA-1 for non-signature protection through 2030-12-31, and disallows it after.
- Finite-field Diffie-Hellman: diffie-hellman-group14-sha256, diffie-hellman-group16-sha512 and diffie-hellman-group-exchange-sha256. The groups themselves are approved safe primes (SP 800-56A Rev. 3 Appendix D), but x/crypto/ssh computes them with math/big in pure Go, so the implementation sits outside every validated module boundary. The native Go Cryptographic Module does not implement finite-field Diffie-Hellman at all, so this group is already absent there.
Both groups are offered by default, because removing them is a compatibility break rather than a compliance requirement: it stops clients too old to offer HMAC-SHA-2 or ECDH. Pass this option when the deployment can require modern clients and wants every offered algorithm inside a validated boundary.