Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apiserver/pkg/authentication/user"
"k8s.io/client-go/util/cert"

configv1 "github.com/openshift/api/config/v1"
)

// TLS versions that are known to golang. Go 1.13 adds support for
Expand Down Expand Up @@ -243,6 +245,9 @@ func ValidCipherSuites() []string {
return validCipherSuites
}

// DefaultTLSProfileType is the intermediate profile type.
const DefaultTLSProfileType = configv1.TLSProfileIntermediateType

// DefaultCiphers returns the default cipher suites for TLS connections.
//
// RECOMMENDATION: Instead of relying on this function directly, consumers should respect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func innerTLSSecurityProfileObservations(genericListers configobserver.Listers,
func getSecurityProfileCiphers(profile *configv1.TLSSecurityProfile) (string, []string) {
var profileType configv1.TLSProfileType
if profile == nil {
profileType = configv1.TLSProfileIntermediateType
profileType = crypto.DefaultTLSProfileType
} else {
profileType = profile.Type
}
Expand All @@ -101,7 +101,7 @@ func getSecurityProfileCiphers(profile *configv1.TLSSecurityProfile) (string, []

// nothing found / custom type set but no actual custom spec
if profileSpec == nil {
profileSpec = configv1.TLSProfiles[configv1.TLSProfileIntermediateType]
profileSpec = configv1.TLSProfiles[crypto.DefaultTLSProfileType]
}

// need to remap all Ciphers to their respective IANA names used by Go
Expand Down