Quellcode durchsuchen

fix: could not reuse a signing key otherwise it would create in accounts & orders and fail the OIDC challenge. The OIDC challenge was not retryable

beltram vor 3 Jahren
Ursprung
Commit
13df461e97
1 geänderte Dateien mit 5 neuen und 3 gelöschten Zeilen
  1. 5 3
      acme/challenge.go

+ 5 - 3
acme/challenge.go

@@ -447,11 +447,13 @@ func wireOIDC01Validate(ctx context.Context, ch *Challenge, db DB, jwk *jose.JSO
 		return WrapErrorISE(err, "Could not find current order by account id")
 	}
 
-	if len(orders) != 1 {
-		return WrapErrorISE(err, "There are too many orders for this account for this custom OIDC challenge")
+	if len(orders) == 0 {
+		return WrapErrorISE(err, "There are not enough orders for this account for this custom OIDC challenge")
 	}
 
-	if err := db.CreateOidcToken(ctx, orders[0], oidcToken); err != nil {
+	order := orders[len(orders)]
+
+	if err := db.CreateOidcToken(ctx, order, oidcToken); err != nil {
 		return WrapErrorISE(err, "Failed storing OIDC id token")
 	}