Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
olomix committed Jul 5, 2023
2 parents 4ae7941 + 6c6c69e commit 17a795e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
9 changes: 0 additions & 9 deletions auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,15 +656,6 @@ func TestVerifier_FullVerify(t *testing.T) {
func TestVerifier_FullVerify_JWS(t *testing.T) {
var request protocol.AuthorizationRequestMessage

request.Typ = packers.MediaTypeSignedMessage
request.Type = protocol.AuthorizationRequestMessageType
request.ID = "4f3549b-0c9d-47f8-968c-c9b0c10b8847"
request.ThreadID = "1f3549b-0c9d-47f8-968c-c9b0c10b8847"
request.Body = protocol.AuthorizationRequestMessageBody{
CallbackURL: "https://test.com/callback",
Reason: "reason",
Scope: []protocol.ZeroKnowledgeProofRequest{},
}
var sigReq protocol.ZeroKnowledgeProofRequest
sigReq.ID = 1
sigReq.CircuitID = string(circuits.AtomicQuerySigV2CircuitID)
Expand Down
7 changes: 4 additions & 3 deletions pubsignals/authV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ func (c *AuthV2) VerifyStates(ctx context.Context, stateResolvers map[string]Sta

// VerifyIDOwnership returns error if ownership id wasn't verified in circuit.
func (c *AuthV2) VerifyIDOwnership(sender string, challenge *big.Int) error {
if challenge.Cmp(c.Challenge) != 0 {
return errors.Errorf("challenge is not used for proof creation, expected , expected %s, challenge from public signals: %s}", challenge.String(), c.Challenge.String())
}

did, err := w3c.ParseDID(sender)
if err != nil {
Expand All @@ -75,8 +78,6 @@ func (c *AuthV2) VerifyIDOwnership(sender string, challenge *big.Int) error {
if senderID.String() != c.UserID.String() {
return errors.Errorf("sender is not used for proof creation, expected %s, user from public signals: %s}", senderID.String(), c.UserID.String())
}
if challenge.Cmp(c.Challenge) != 0 {
return errors.Errorf("challenge is not used for proof creation, expected , expected %s, challenge from public signals: %s}", challenge.String(), c.Challenge.String())
}

return nil
}

0 comments on commit 17a795e

Please sign in to comment.