Skip to content

certificate create: default CA-profile keys (root-ca, intermediate-ca… - #1747

Closed
reservoir-cmyk wants to merge 1 commit into
smallstep:masterfrom
reservoir-cmyk:certificate-create-ca-default-p384
Closed

reservoir-cmyk wants to merge 1 commit into
smallstep:masterfrom
reservoir-cmyk:certificate-create-ca-default-p384

Conversation

@reservoir-cmyk

Copy link
Copy Markdown

Opening this as a draft PR. It is the CLI-side companion to smallstep/certificates#2869, where the corresponding question for step ca init is being discussed; happy to adjust or close this depending on the direction taken there.

What this changes, and what it deliberately does not

utils.DefaultECCurve is "P-256", and it is shared by every flow that resolves key details through GetKeyDetailsFromCLI: leaf certificates, CSRs, SSH certificates, generic key pairs, and CA keys alike. Changing that shared default to P-384 would move all of those at once, and most of them are not CA keys — the collateral change is larger than the motivation. So this PR does not touch the shared default.

Instead, it makes one individual, concrete change: when step certificate create generates a key for the root-ca or intermediate-ca profile — the two profiles whose whole purpose is creating a CA key — and no curve was explicitly requested, the key defaults to P-384 (utils.DefaultECCurveForCA). The root-creation help example is updated to match; the leaf and CSR examples still say P-256, because for them that is still true.

Three files, +13/−1: the new constant, the profile check in parseOrCreateKey, and the one help example.

Behaviour, measured with the built binary

  • --profile root-ca (nothing specified): P-384
  • --profile intermediate-ca (nothing specified): P-384
  • default (leaf) profile: P-256, unchanged
  • --profile root-ca --kty EC --curve P-256: P-256 — an explicit request is always honoured
  • --profile root-ca --kty RSA: RSA 2048, unaffected
  • step crypto keypair (nothing specified): P-256, unchanged

Tests

  • go build ./... passes; go vet on the touched packages is clean.
  • go test ./utils/... ./command/certificate/... ./command/ca/... ./command/crypto/... ./command/ssh/... passes (same package set as the pre-change baseline).

Open point

Whether CA keys should get a different default at all is the question in the companion Issue; this draft only demonstrates the narrowest form of the change, scoped so that nothing outside CA-key creation moves.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants