Skip to content

Commit

Permalink
Merge 76bb006 into 5fdc712
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Wiedemann authored Jun 4, 2024
2 parents 5fdc712 + 76bb006 commit 871701a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions verifier/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,11 @@ func (v *CredentialVerifier) GenerateToken(clientId, subject, audience string, s
credentialsByType := map[string][]*verifiable.Credential{}
credentialTypes := []string{}
for _, vc := range verifiablePresentation.Credentials() {
// verify the credential
verificationError := vc.CheckProof()
if verificationError != nil {
return 0, "", verificationError
}
for _, credentialType := range vc.Contents().Types {
if _, ok := credentialsByType[credentialType]; !ok {
credentialsByType[credentialType] = []*verifiable.Credential{}
Expand Down Expand Up @@ -468,6 +473,12 @@ func (v *CredentialVerifier) AuthenticationResponse(state string, verifiablePres
trustedChain, _ := verifyChain(verifiablePresentation.Credentials())

for _, credential := range verifiablePresentation.Credentials() {
// verify the credential
verificationError := credential.CheckProof()
if verificationError != nil {
return sameDevice, verificationError
}

verificationContext, err := v.getTrustRegistriesValidationContext(loginSession.clientId, credential.Contents().Types)
if err != nil {
logging.Log().Warnf("Was not able to create a valid verification context. Credential will be rejected. Err: %v", err)
Expand Down

0 comments on commit 871701a

Please sign in to comment.