Skip to content

Commit

Permalink
fix(anoncreds): allow for zero idx to be used for revocation (#1742)
Browse files Browse the repository at this point in the history
Signed-off-by: Berend Sliedrecht <[email protected]>
  • Loading branch information
berendsliedrecht authored Feb 6, 2024
1 parent 0bec03c commit a1b9901
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ export class AnonCredsCredentialFormatService implements CredentialFormatService
).credentialDefinition.value

if (credentialDefinition.revocation) {
if (!revocationRegistryDefinitionId || !revocationRegistryIndex) {
if (!revocationRegistryDefinitionId || revocationRegistryIndex === undefined) {
throw new CredoError(
'AnonCreds revocable credentials require revocationRegistryDefinitionId and revocationRegistryIndex'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ export class AnonCredsProofFormatService implements ProofFormatService<AnonCreds

// If revocation interval is not present or the credential is not revocable then we
// don't need to fetch the revocation status
if (!requestNonRevoked || !credentialRevocationId || !revocationRegistryId) {
if (!requestNonRevoked || credentialRevocationId === null || !revocationRegistryId) {
return { isRevoked: undefined, timestamp: undefined }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ export class LegacyIndyProofFormatService implements ProofFormatService<LegacyIn

// If revocation interval is not present or the credential is not revocable then we
// don't need to fetch the revocation status
if (!requestNonRevoked || !credentialRevocationId || !revocationRegistryId) {
if (!requestNonRevoked || credentialRevocationId === null || !revocationRegistryId) {
return { isRevoked: undefined, timestamp: undefined }
}

Expand Down

0 comments on commit a1b9901

Please sign in to comment.