Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

acceptance: comply with openssl key size restrictions #81727

Merged
merged 1 commit into from
May 24, 2022
Merged
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
10 changes: 7 additions & 3 deletions pkg/acceptance/cluster/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ const certsDir = ".localcluster.certs"

var absCertsDir string

// keyLen is the length (in bits) of the generated CA and node certs.
// keyLen is the length (in bits) of the generated TLS certs.
//
// This needs to be at least 2048 since the newer versions of openssl
// (used by some tests) produce an error 'ee key too small' for
// smaller values.
const keyLen = 2048

// AbsCertsDir returns the absolute path to the certificate directory.
Expand Down Expand Up @@ -54,12 +58,12 @@ func GenerateCerts(ctx context.Context) func() {
// Root user.
maybePanic(security.CreateClientPair(
certsDir, filepath.Join(certsDir, security.EmbeddedCAKey),
2048, 48*time.Hour, false, username.RootUserName(), true /* generate pk8 key */))
keyLen, 48*time.Hour, false, username.RootUserName(), true /* generate pk8 key */))

// Test user.
maybePanic(security.CreateClientPair(
certsDir, filepath.Join(certsDir, security.EmbeddedCAKey),
1024, 48*time.Hour, false, username.TestUserName(), true /* generate pk8 key */))
keyLen, 48*time.Hour, false, username.TestUserName(), true /* generate pk8 key */))

// Certs for starting a cockroach server. Key size is from cli/cert.go:defaultKeySize.
maybePanic(security.CreateNodePair(
Expand Down