Skip to content

Commit

Permalink
fix: same issue as with oidc challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
beltram committed Sep 12, 2023
1 parent 5cb200f commit e92a173
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions acme/challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,13 @@ func wireDPOP01Validate(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 DPoP challenge")
if len(orders) == 0 {
return WrapErrorISE(err, "There are not enough orders for this account for this custom OIDC challenge")
}

if err := db.CreateDpopToken(ctx, orders[0], dpop); err != nil {
order := orders[len(orders)-1]

if err := db.CreateDpopToken(ctx, order, dpop); err != nil {
return WrapErrorISE(err, "Failed storing DPoP token")
}

Expand Down

0 comments on commit e92a173

Please sign in to comment.