Sfoglia il codice sorgente

passing expected issuer to rusty-jwt-cli

beltram 3 anni fa
parent
commit
c4fb19d01f
1 ha cambiato i file con 8 aggiunte e 3 eliminazioni
  1. 8 3
      acme/challenge.go

+ 8 - 3
acme/challenge.go

@@ -438,8 +438,8 @@ func wireDPOP01Validate(ctx context.Context, ch *Challenge, db DB, jwk *jose.JSO
 		return NewErrorISE("missing provisioner")
 		return NewErrorISE("missing provisioner")
 	}
 	}
 
 
-	//key := ed25519.PublicKey([]byte(provisioner.GetOptions().GetDPOPOptions().GetSigningKey()))
-	key := provisioner.GetOptions().GetDPOPOptions().GetSigningKey()
+	dpopOptions := provisioner.GetOptions().GetDPOPOptions()
+	key := dpopOptions.GetSigningKey()
 
 
 	var wireChallengePayload WireChallengePayload
 	var wireChallengePayload WireChallengePayload
 	err := json.Unmarshal(payload, &wireChallengePayload)
 	err := json.Unmarshal(payload, &wireChallengePayload)
@@ -471,6 +471,9 @@ func wireDPOP01Validate(ctx context.Context, ch *Challenge, db DB, jwk *jose.JSO
 		return WrapErrorISE(err, "error unmarshalling challenge data")
 		return WrapErrorISE(err, "error unmarshalling challenge data")
 	}
 	}
 
 
+	issuer := dpopOptions.DpopTarget
+
+	expiry := strconv.FormatInt(time.Now().Add(time.Hour*24*365).Unix(), 10)
 	cmd := exec.CommandContext(
 	cmd := exec.CommandContext(
 		ctx,
 		ctx,
 		provisioner.GetOptions().GetDPOPOptions().GetValidationExecPath(),
 		provisioner.GetOptions().GetDPOPOptions().GetValidationExecPath(),
@@ -482,7 +485,9 @@ func wireDPOP01Validate(ctx context.Context, ch *Challenge, db DB, jwk *jose.JSO
 		"--leeway",
 		"--leeway",
 		"360",
 		"360",
 		"--max-expiry",
 		"--max-expiry",
-		strconv.FormatInt(time.Now().Add(time.Hour*24*365).Unix(), 10),
+		expiry,
+		"--issuer",
+		issuer,
 		"--hash-algorithm",
 		"--hash-algorithm",
 		`"SHA-256"`,
 		`"SHA-256"`,
 		"--key",
 		"--key",