Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Revocation Index 0 anoncreds-rs support #2126

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

gmulhearn
Copy link
Contributor

Closes #2125

Signed-off-by: George Mulhearn <[email protected]>
Copy link

changeset-bot bot commented Dec 5, 2024

⚠️ No Changeset found

Latest commit: f00f112

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Signed-off-by: George Mulhearn <[email protected]>
@@ -320,7 +320,7 @@ export class AnonCredsRsIssuerService implements AnonCredsIssuerService {
}

let revocationConfiguration: CredentialRevocationConfig | undefined
if (revocationRegistryDefinitionId && revocationStatusList && revocationRegistryIndex) {
if (revocationRegistryDefinitionId && revocationStatusList && revocationRegistryIndex !== undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just remembered it starts at one by convetion, so it will still throw later on i think. But this at least fixes your issue.

We might want to add an error saying index 0 is not allowed?

hyperledger/anoncreds-rs#337

Copy link
Contributor Author

@gmulhearn gmulhearn Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh damn! i didn't know this. i guess atleast with this change it will make it's way down into anoncreds-rs, where it will then throw an error - rather than current behaviour where it silently becomes non-revokable.

FYI i just tried running this fix with an index 0 input. i get the error:

AnoncredsError: Invalid state: Revocation index is outside of valid range

(as you linked)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay then let's merge this, because it improves a lot

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit late into the conversation but yes, this came originally from the fact that an index = 0 is not allowed.

I think it would be great if you can add an specific check for revocationRegistryIndex === 0 with an appropriate error message, since this is confusing for those who are not familiar with this convention (which BTW is only shyly mentioned in the spec: "Each credential issued using the Revocation Registry is given its own index (1 to the capacity of the Revocation Registry into the array, the index of the point for that credential.")

@gmulhearn
Copy link
Contributor Author

I'm getting the same int test failure on my other PR: #2124 .

seems unrelated?

@TimoGlastra
Copy link
Contributor

I'm getting the same int test failure on my other PR: #2124 .

seems unrelated?

YEs we need to fix the CI, if it's only the unrelated issue i can merge it!

@TimoGlastra TimoGlastra merged commit 6989c65 into openwallet-foundation:main Dec 5, 2024
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: anoncreds-rs issuance of revocation index 0 silently issues non-revokable cred
4 participants