Fix default card capabilities value

The 53 tag was included twice
This commit is contained in:
Sosthène Guédon
2024-01-15 17:19:59 +01:00
parent 2c948a966f
commit bc52d5563b
2 changed files with 19 additions and 5 deletions
+18
View File
@@ -50,6 +50,24 @@ pub const DISCOVERY_OBJECT: [u8; 18] = hex!(
4000"
);
pub const CARD_CAP: [u8; 27] = hex!(
"
F0 00 // card identifier
F1 00 // capability container version
F2 00 // capability container grammar
F3 00 // application card url
F4 00 // pkcs15
F5 01 10 // registereddata model number
F6 00 // access control rule table
F7 00 // card apdus
FA 00 // redirection tag
FB 00 // capability tuples
FC 00 // status tuples
FD 00 // next ccc
FE 00 // Error detection code
"
);
use crate::Container;
pub const RETIRED_CERTS: [Container; 20] = [
Container::RetiredCert01,
+1 -5
View File
@@ -715,11 +715,7 @@ impl ContainerStorage {
fn default(self) -> Option<Vec<u8, MAX_MESSAGE_LENGTH>> {
match self.0 {
Container::CardHolderUniqueIdentifier => panic!("CHUID should alway be set"),
Container::CardCapabilityContainer => Some(
crate::piv_types::CardCapabilityContainer::default()
.to_heapless_vec()
.unwrap(),
),
Container::CardCapabilityContainer => Some(Vec::from_slice(&CARD_CAP).unwrap()),
Container::DiscoveryObject => Some(Vec::from_slice(&DISCOVERY_OBJECT).unwrap()),
_ => None,
}