-
Notifications
You must be signed in to change notification settings - Fork 759
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
Epass2003 incorrect CMAC subkey #2734
Comments
@FeitianSmartcardReader can probably comment on this too. I unfortunately dont have this token to check. |
@Jakuje let me forward to our team, and would you please send email to me with your address? I will ship few samples to you too. [email protected] |
I don't have the authority to merge. |
Sorry for the late reply. |
Should be fixed with #2759 |
I agree, using #2759 will fix this issue. Well thank you. |
I am closing this issue. #2759 is already merged in master. |
Problem Description
For some EPASS2003 tokens, AES CMAC is used to ensure the authenticity of secure messages. This code should probably correspond to the specification described in RFC4493. This specification describes the subkey derivation procedure.
The "C" code used in the opensc driver implements this operation with the following sequence of commands:
I assume that there was a mistake in writing, where
if(check & 0x80)
should have been used instead ofif(check > 0x80)
. Both subkeys (k1,k2) are affected by this error. The error does not always occur. The CMAC calculation is incorrect only for some keys.I can't say for sure that the code written like this wasn't just a workaround to the epass2003 token error. This CMAC calculation is used here only for a special APDU (00 82 01 00) where a different error is corrected (no initialization vector is used for MAC calculation for this APDU).
Code was introduced in commit 622e6e2, @xaqfan as the author of this code, can you comment on it?
The text was updated successfully, but these errors were encountered: