Skip to content

Commit 9686d6f

Browse files
committed
Make --attestation-uri incompatible with --kms
The ACME-DA flow in the step ca certificate command expects all KMS parameters to be provided through the `--attestation-uri` flag. Using the `--kms` flag at the same time can lead to errors. For example, if the YubiKey PIN is set with the `--kms` flag, the flow will ignore it and use the default one instead, resulting in a PIN retry error. Fixes #1492
1 parent cde640b commit 9686d6f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

command/ca/certificate.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,16 @@ func certificateAction(ctx *cli.Context) error {
228228
offline := ctx.Bool("offline")
229229
sans := ctx.StringSlice("san")
230230

231-
// offline and token are incompatible because the token is generated before
232-
// the start of the offline CA.
233-
if offline && tok != "" {
231+
switch {
232+
case offline && tok != "":
233+
// offline and token are incompatible because the token is generated before
234+
// the start of the offline CA.
234235
return errs.IncompatibleFlagWithFlag(ctx, "offline", "token")
236+
case ctx.String("attestation-uri") != "" && ctx.String("kms") != "":
237+
// attestation-uri and kms are incompatible because the ACME-DA flow
238+
// expects all necessary parameters in the attestation-uri, and having
239+
// both can be confusing.
240+
return errs.IncompatibleFlagWithFlag(ctx, "attestation-uri", "kms")
235241
}
236242

237243
// certificate flow unifies online and offline flows on a single api

0 commit comments

Comments
 (0)