Skip to content

Commit

Permalink
Merge pull request #10 from rarimo/temp/debug
Browse files Browse the repository at this point in the history
Add: additional info to error message
  • Loading branch information
mhrynenko authored May 15, 2024
2 parents 1857063 + 16043b7 commit d9d0481
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/service/api/handlers/create_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/rarimo/passport-identity-provider/resources"
"gitlab.com/distributed_lab/ape"
"gitlab.com/distributed_lab/ape/problems"
"gitlab.com/distributed_lab/logan/v3"
"gitlab.com/distributed_lab/logan/v3/errors"
)

Expand Down Expand Up @@ -357,7 +358,11 @@ func validateSignedAttributes(signedAttributes, encapsulatedContent []byte, algo
}

if !bytes.Equal(digestAttr.Digest[0].Bytes, d) {
return errors.New("digest signed attribute is not equal to encapsulated content hash")
return errors.From(errors.New("digest signed attribute is not equal to encapsulated content hash"), logan.F{
"signed_attributes": hex.EncodeToString(digestAttr.Digest[0].Bytes),
"content_hash": hex.EncodeToString(d),
"encapsulated_content": hex.EncodeToString(encapsulatedContent),
})
}
return nil
}
Expand Down

0 comments on commit d9d0481

Please sign in to comment.