From a901607bb6626ea1b283bc9c2260db63cbd2a28a Mon Sep 17 00:00:00 2001 From: Nicolas Stalder Date: Tue, 13 Apr 2021 23:13:39 +0200 Subject: [PATCH] Make it build --- src/constants.rs | 2 +- src/state.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/constants.rs b/src/constants.rs index cc37451..55c3384 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -2,4 +2,4 @@ pub const FIDO2_UP_TIMEOUT: u32 = 30_000; pub const U2F_UP_TIMEOUT: u32 = 0_250; -pub const ATTESTATION_CERT_ID: u128 = 0; +pub const ATTESTATION_CERT_ID: u8 = 0; diff --git a/src/state.rs b/src/state.rs index 16680a7..a4a2d9a 100644 --- a/src/state.rs +++ b/src/state.rs @@ -89,10 +89,10 @@ impl Identity { // Attempt to yank out the aaguid of a certificate. fn yank_aaguid(&mut self, der: &[u8]) -> Option<[u8; 16]> { - let aaguid_start_sequence = [ + let aaguid_start_sequence = [ // OBJECT IDENTIFIER 1.3.6.1.4.1.45724.1.1.4 (AAGUID) 0x06u8, 0x0B, 0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0xE5, 0x1C, 0x01, 0x01, 0x04, - + // Sequence, 16 bytes 0x04, 0x12, 0x04, 0x10 ]; @@ -117,7 +117,7 @@ impl Identity { for i in 0 .. 16 { aaguid[i] = cert_reader[i] } - + Some(aaguid) } @@ -131,7 +131,7 @@ impl Identity { // Will panic if certificate does not exist. let cert = syscall!(trussed.read_certificate( - trussed::types::Id (crate::constants::ATTESTATION_CERT_ID), + trussed::types::Id::from(crate::constants::ATTESTATION_CERT_ID), )).der; let mut aaguid = self.yank_aaguid(&cert.as_slice());