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

npa-tool fails during Terminal Authentication with Invalid ASN.1 object #2726

Closed
marcoh00 opened this issue Mar 6, 2023 · 1 comment · Fixed by #2727
Closed

npa-tool fails during Terminal Authentication with Invalid ASN.1 object #2726

marcoh00 opened this issue Mar 6, 2023 · 1 comment · Fixed by #2727

Comments

@marcoh00
Copy link

marcoh00 commented Mar 6, 2023

Problem Description

npa-tool fails during Terminal Authentication with Invalid ASN.1 object:

P:11725; T:0x140341712424576 12:43:08.173 [npa-tool] sm-eac.c:251:encode_mse_cdata: Error encoding MSE:Set AT APDU data: -1401 (Invalid ASN.1 object)
P:11725; T:0x140341712424576 12:43:08.173 [npa-tool] sm-eac.c:1206:perform_terminal_authentication: Could not select protocol properties (MSE: Set AT failed).

Proposed Resolution

The terminal authentication function performs the MSE:Set AT step only specifying a "Reference of a public key" and no "Cryptographic mechanism reference", which is correct behavior according to TR-03110 Part 3. However, the corresponding capdu_eac_mse struct does not specify the SC_ASN1_OPTIONAL flag for the latter.

I will open a PR in a few moments that adds the OPTIONAL flag.

Steps to reproduce

Should be reproducible using any nPA or PersoSim.

marcoh00 pushed a commit to marcoh00/OpenSC that referenced this issue Mar 6, 2023
…encode error in encode_mse_cdata during terminal authentication. Fixes OpenSC#2726
@frankmorgner
Copy link
Member

Regression since d9a4267. Also affects changing the PIN

frankmorgner pushed a commit that referenced this issue Mar 9, 2023
…encode error in encode_mse_cdata during terminal authentication. Fixes #2726
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

Successfully merging a pull request may close this issue.

2 participants