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

Anomaly between /signercertificateStatus and /signercertificateUpdate breaks dgca-verifier-app-android in production #82

Open
kristank opened this issue Jul 4, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@kristank
Copy link

kristank commented Jul 4, 2022

Hello,

  • Method /signercertificateStatus returns only "not deleted" (it calls signerInformationRepository.findAllByDeletedOrderByIdAsc(false)) certs from local database.
  • Method /signercertificateUpdate returns all certificates (initially it calls findFirstByIdIsNotNullOrderByIdAsc() and then findFirstByIdGreaterThanOrderByIdAsc(Long id), cannot find filter for deleted) from local database.

This breaks dgca-verifier-app-android if one or more certs are marked as deleted in local database, because dgca-verifier-app-android's fetch method checks if the returned certificate is in the list returned from /signercertificateStatus, pseudocode from VerifierRepositoryImpl.kt method fetchCertificate

//validCertList is list returned from /signercertificateStatus
if (validCertList.contains(responseKid) && isKidValid(responseKid, responseStr)) {   
    // process the cert
    // Get next cert
    newResumeToken?.let {
        val newToken = it.toLong()
        fetchCertificate(url, newToken)
    }
}
// Cert fetching stops - dgca-verifier-app-android does not have all certs, verification of missing certs will fail.

Could you please check this issue ?

I found that restarting verifier ws will temporary resolve this issue (until next cert gets deleted), because it clears local database.

@kristank kristank added the bug Something isn't working label Jul 4, 2022
@oleksandrsarapulovgl oleksandrsarapulovgl self-assigned this Jul 5, 2022
@oleksandrsarapulovgl
Copy link

@kristank could you please clarify: you mean in the app we receive responseKid that is not in the validCertList anymore? Because if yes - not clear how clearing local app database fixes the issue, as with next reload we would come to the same point again

@kristank
Copy link
Author

kristank commented Jul 5, 2022

@oleksandrsarapulovgl

Yes, /signercertificateUpdate returns a certificate, whose kid is not returned by /signercertificateStatus

Why restart helps – I did not examine the whole code for verifier WS, but I think by default h2 db is used with no persistent storage, so after restart the deleted certificates are purged from db – only active certs are transferred from GW.

@SchulzeStTSI
Copy link
Collaborator

@kristank
Copy link
Author

kristank commented Jul 6, 2022

@SchulzeStTSI @oleksandrsarapulovgl

Yes, this would fix the android app – all certs would be fetched and the deleted certs would be ignored.

I presume the same fix should be implemented in IOS app.

One question – is it ok that verifier WS returns deleted certs ? Is there a situation where deleted certs should be used in DGC verification ?

Thank you for all the answers.

@dslmeinte
Copy link

@SchulzeStTSI @oleksandrsarapulovgl @kristank

I was contacted during an eHN TechIOP Meeting by a Slovenian representative about this, and I'm a bit surprised that the corresponding PR (eu-digital-green-certificates/dgca-verifier-app-android#323) wasn't reviewed yet. Could that still happen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants