Parcourir la source

acquire DPoP signing key from provisioner

Stefan Berthold il y a 3 ans
Parent
commit
e6dd211637
2 fichiers modifiés avec 10 ajouts et 4 suppressions
  1. 1 4
      acme/challenge.go
  2. 9 0
      authority/provisioner/dpop_options.go

+ 1 - 4
acme/challenge.go

@@ -431,10 +431,7 @@ func wireDPOP01Validate(ctx context.Context, ch *Challenge, db DB, jwk *jose.JSO
 		return NewErrorISE("missing provisioner")
 	}
 
-	key, ok := jwk.Key.(ed25519.PublicKey)
-	if !ok {
-		return NewErrorISE("key is not ED25519")
-	}
+	key := ed25519.PublicKey([]byte(provisioner.GetOptions().GetDPOPOptions().GetSigningKey()))
 
 	var wireChallengePayload WireChallengePayload
 	err := json.Unmarshal(payload, &wireChallengePayload)

+ 9 - 0
authority/provisioner/dpop_options.go

@@ -4,6 +4,8 @@ type DPOPOptions struct {
 	// ValidationExecPath is the name of the executable to call for DPOP
 	// validation.
 	ValidationExecPath string `json:"validation-exec-path,omitempty"`
+	// Backend signing key for DPoP access token
+	SigningKey string `json:"key"`
 }
 
 func (o *DPOPOptions) GetValidationExecPath() string {
@@ -12,3 +14,10 @@ func (o *DPOPOptions) GetValidationExecPath() string {
 	}
 	return o.ValidationExecPath
 }
+
+func (o *DPOPOptions) GetSigningKey() string {
+	if o == nil {
+		return ""
+	}
+	return o.SigningKey
+}