Skip to content

Commit

Permalink
fix detection of revregtype in older jsonld lib
Browse files Browse the repository at this point in the history
  • Loading branch information
cykoder committed Sep 28, 2020
1 parent f1a4cfc commit 56de60f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/vc.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ export function checkCredentialContext(credential) {
function hasDockRevocation(status) {
const id = status[credentialIDField];
if (status
&& jsonld.getValues(status, credentialTypeField).includes(RevRegType)
&& (
jsonld.getValues(status, credentialTypeField).includes(RevRegType) ||
jsonld.getValues(status, credentialTypeField).includes('/' + RevRegType)
)
&& id.startsWith(DockRevRegQualifier)
&& isHexWithGivenByteSize(id.slice(DockRevRegQualifier.length), RevRegIdByteSize)) {
return true;
Expand Down Expand Up @@ -240,6 +243,7 @@ export async function verifyCredential(credential, {
// Check for revocation only if the credential is verified and revocation check is needed.
if (credVer.verified && isRevocationCheckNeeded(expandedCredential, forceRevocationCheck, revocationApi)) {
const revResult = await checkRevocationStatus(expandedCredential, revocationApi);

// If revocation check fails, return the error else return the result of credential verification to avoid data loss.
if (!revResult.verified) {
return revResult;
Expand Down

0 comments on commit 56de60f

Please sign in to comment.