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

Missing signature verification of CSCA master list #1

Closed
smlu opened this issue Sep 24, 2019 · 5 comments
Closed

Missing signature verification of CSCA master list #1

smlu opened this issue Sep 24, 2019 · 5 comments
Assignees

Comments

@smlu
Copy link
Member

smlu commented Sep 24, 2019

Due to the issues with cryptography library and it's implementation of DSA signature verification, the integrety check is currently not implemented for master list.

@smlu
Copy link
Member Author

smlu commented Sep 28, 2019

The problem has been identified at least for one master list (C=ES crc=02409DA3).

The issue doesn't lay in the cryptography library as initially thought but in a different asn1 serialization format that was used to store a SignedAttributes object in the master list and for making a digital signature.

Specifically, a SignedtAttributes object is stored in the master list as asn1 DER-encoded ComplexType type (0xA0 DER tag) but the signature was made over SignedAttributes object serialized as asn1 DER-encoded Set type (0x31 DER tag). The type Set is the correct type to be used according to RFC-5652. When serializing this object with the asn1crypto library the object's type is preserved (ComplexType) thus the invalid message is generated and the signature verification fails.

@smlu
Copy link
Member Author

smlu commented Sep 28, 2019

Commit 8b934bf fixes this issue. Closing issue.

@smlu smlu closed this as completed Sep 28, 2019
@smlu
Copy link
Member Author

smlu commented Oct 7, 2019

The examination of master lists publicly available at ICAO PKD showed that every master list has this issue.

@smlu
Copy link
Member Author

smlu commented Oct 7, 2019

There is still issue with signature verification of the Hungarian master list.
The Hungarian master list has some additional unknown fields within signed attributes field and no documentation was found on what those unknown fields represent or how the SignedtAttributes object should be serialized to produce valid message to verifay signature with.

@smlu
Copy link
Member Author

smlu commented Jan 8, 2021

The RFC 5652 Section 5.4 specifies that the message digest should be calculated over SignedtAttributes encoded with EXPLICIT SET OF tag rather than IMPLICIT [0] tag.

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

No branches or pull requests

1 participant