Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Problem with expired certificates #91

Closed
pmauchle opened this issue Sep 9, 2021 · 13 comments
Closed

Problem with expired certificates #91

pmauchle opened this issue Sep 9, 2021 · 13 comments

Comments

@pmauchle
Copy link

pmauchle commented Sep 9, 2021

We have successfully implemented the SDK in our app, and checking certificates works, but not in the case of expired certificates. They always show valid. This problem is only in iOS. We don't have a problem with the Android SDK.

Here is how we test:`

let result: Result<VerifierCertificateHolder, CovidCertError> = CovidCertificateSDK.Verifier.decode(encodedData: data);

switch result {
case .success(let certHolder):
        CovidCertificateSDK.Verifier.check(holder: certHolder, forceUpdate: false) {result in

        ... here, we check nationalRules, signature and revocationStatus and they are all valid

image

The "Covid check" app shows following:
image

How do we check if the certificate is expired?

@pmauchle pmauchle closed this as completed Sep 9, 2021
@pmauchle pmauchle reopened this Sep 9, 2021
@pmauchle
Copy link
Author

pmauchle commented Sep 9, 2021

Unfourtanly the error still occurs after updating to the latest version. Also now I'm getting NETWORK_PARSE_ERROR errors while testing in the nationalRules.

@stmitt
Copy link
Collaborator

stmitt commented Sep 9, 2021

@pmauchle we'll look into it. Which version of the SDK are you using?

@pmauchle
Copy link
Author

pmauchle commented Sep 9, 2021

@stmitt I just added the SDK again this morning in the swift package manager and use this git repo with the branch main.
image

@stmitt
Copy link
Collaborator

stmitt commented Sep 9, 2021

@pmauchle can you try specifying the 1.0.1 release. The main branch uses a not yet deployed backend.

@pmauchle
Copy link
Author

pmauchle commented Sep 9, 2021

@stmitt I get a dependency error:
Dependencies could not be resolved because package 'covidcertificate-sdk-ios' is required using a stable-version but 'covidcertificate-sdk-ios' depends on an unstable-version package 'swiftcbor' and root depends on 'CovidCertificate-SDK-iOS' 1.0.1.

Same message with 1.0.0

@stmitt
Copy link
Collaborator

stmitt commented Sep 10, 2021

@pmauchle we'll look into this dependency issue for the next release. Can you try to specify the git commit of the latest release directly?
.revision("9293f2274fc16cf0949ecfbbd31c6fa00e6a8704")

@pmauchle
Copy link
Author

pmauchle commented Sep 10, 2021

@stmitt I get an error with SecTrustEvaluateWithError, probably this commit would fix it.

b4e64e4#diff-fa8ca0c7a18dead3a5acad8edb89e43ff05841d344bd77b8f6ef58ecf43587c3

image

@stmitt
Copy link
Collaborator

stmitt commented Sep 10, 2021

@pmauchle Yes indeed, does it work by setting .revision("b4e64e48c32174ea39979d002b55a272c68029c8")?

@pmauchle
Copy link
Author

@stmitt that worked, I was able to add it in the swift package manager and build it.

But I still get NETWORK_PARSE_ERROR in the nationalRules. I used the same API key as in our app which is live and the scanning there works, with the exception of expired certificates.
image

@stmitt
Copy link
Collaborator

stmitt commented Sep 10, 2021

Can you check what the backend is returning for this network request? I just tried the SDK with this specific commit and it works fine. Can you check if you use the API key for the correct environment?

@stmitt
Copy link
Collaborator

stmitt commented Sep 10, 2021

@pmauchle I just noticed in your initial post: while the national rule check was technically successful and no error occurred the isValid flag is set to false and therefore the certificate is not valid anymore.

image

@pmauchle
Copy link
Author

@stmitt it works now in dev environment, I used the prod API keys. I did not know that I have to check even further in the nartionalRules, thanks for pointing that out. I will report if the problem is also solved in Testflight & Live.

@pmauchle
Copy link
Author

@stmitt it works on TestFlight, thank you very much for you help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants