verificac19-sdk icon indicating copy to clipboard operation
verificac19-sdk copied to clipboard

Validation error for recently issued recovery Green Pass

Open drcoccodrillus opened this issue 2 years ago • 2 comments

I get "Not Valid" reply when I send payloads to the validator using recently issued Green Passes.

Certificate type: recovery

I get instead "Valid" reply while using older certificates of the same type.

{ "result": "KO", "reason": "NOT_VALID", "person_data": { "person": "--- --- ---", "dob": "23/01/1987" }, "device_id": 1, "instance_id": 1, "ci": "--- --- ---", "certificate_type": "recovery" }

I can privately share the payloads I am working with.

drcoccodrillus avatar Jul 14 '22 15:07 drcoccodrillus

I put my hand on the validator and I reckon I've found the issue. I don't know why, but some keys used to sign green passes are not recognized.

This is where the validation process fails. The commented part is to bypass signature validation.

const buildResponse = (certificate, rulesResult, signatureOk) => {
  let motivation = rulesResult;
  /*if (!signatureOk) {
    motivation = {
      code: NOT_VALID,
      result: false,
      message: 'Invalid signature',
    };
  }*/
  return {
    person: certificate.person ? `${certificate.person.givenName} ${certificate.person.familyName}` : null,
    date_of_birth: certificate.dateOfBirth ? certificate.dateOfBirth : null,
    ...motivation,
  };
};

Any suggestion about how to tackle the issue?

drcoccodrillus avatar Jul 21 '22 10:07 drcoccodrillus

Hi @drcoccodrillus sorry for my late response! Where your certificate has been issued from?

astagi avatar Aug 30 '22 09:08 astagi

Hi @astagi! Thank you for your reply and my apologies for answering you after one month. The mentioned green passes where issued by the Italian government. I noticed that mostly the green passes that where bounced by the validator are the temporary one which are coded as "swab". After few days they are always substituted whit a new GP coded as "Cured of COVID-19" and these are correctly validated.

Example: image

image

drcoccodrillus avatar Oct 01 '22 14:10 drcoccodrillus

No problem @drcoccodrillus , glad your problem has disappeared :) I can close this issue then!

astagi avatar Oct 09 '22 20:10 astagi