Repository navigation
SE050Sim: UserID and AESKey sessions, attested reads; SDK test in all session modes #25
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
651e0f8
bcd899f
0743e31
6149ca8
2dd21eb
922a22d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,6 +147,15 @@ pub fn handle_write_ec_key( | |
| creation_policy, | ||
| if generated { 0x02 } else { 0x01 }, | ||
| ); | ||
| // INS_AUTH_OBJECT: an ECKey Authentication Object, with its maximum | ||
| // number of failed attempts (0 = unlimited, at most 0x7FFF). | ||
| if apdu.ins & 0x40 != 0 { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 6149ca8: ECKey Authentication Objects must be NIST P-256, checked before key import or generation, and an existing one cannot be rewritten on another curve. Covered by |
||
| let max = tlv::find_tlv(&tlvs, crate::tlv::TAG_MAX_ATTEMPTS) | ||
| .filter(|t| t.value.len() == 2) | ||
| .map(|t| u16::from_be_bytes([t.value[0], t.value[1]]) & 0x7FFF) | ||
| .unwrap_or(0); | ||
| store.set_auth_object(obj_id, max); | ||
| } | ||
| } | ||
| response | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 922a22d: the key length is computed before anything is stored, and an Authentication Object, new or existing, only takes a 16-byte key. Otherwise 0x6A80 and the old key stays. Covered by
aes_authentication_object_policies_and_key_length.