فهرست منبع

Make sure to define the KeyID from the token if available.

Mariano Cano 7 سال پیش
والد
کامیت
08eac1b00d
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      authority/provisioner/jwk.go

+ 3 - 2
authority/provisioner/jwk.go

@@ -209,8 +209,9 @@ func (p *JWK) AuthorizeSSHSign(ctx context.Context, token string) ([]SignOption,
 	if !opts.ValidBefore.IsZero() {
 		signOptions = append(signOptions, sshCertificateValidBeforeModifier(opts.ValidBefore.RelativeTime(t).Unix()))
 	}
-	// Make sure to define the the KeyID
-	if opts.KeyID == "" {
+	if opts.KeyID != "" {
+		signOptions = append(signOptions, sshCertificateKeyIDModifier(opts.KeyID))
+	} else {
 		signOptions = append(signOptions, sshCertificateKeyIDModifier(claims.Subject))
 	}