Adjust to Trussed object ID cleanup

This commit is contained in:
Nicolas Stalder
2021-05-14 19:00:34 +02:00
parent 91a91cbeb8
commit 51be20ffb2
3 changed files with 8 additions and 8 deletions

View File

@@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize};
use trussed::{
client, syscall, try_syscall,
postcard_deserialize, postcard_serialize, postcard_serialize_bytes,
types::{Location, ObjectHandle, PathBuf},
types::{KeyId, Location, PathBuf},
};
use crate::{command, Command, oath, state::{CommandState, State}};
@@ -735,7 +735,7 @@ pub struct Credential<'l> {
///
/// Meanwhile, the client app just pads up to 14B :)
pub secret: trussed::types::ObjectHandle,
pub secret: KeyId,
pub touch_required: bool,
pub counter: Option<u32>,
}
@@ -755,13 +755,13 @@ pub struct Credential<'l> {
// }
impl<'l> Credential<'l> {
fn from(credential: &command::Credential<'l>, handle: ObjectHandle) -> Self {
fn from(credential: &command::Credential<'l>, key: KeyId) -> Self {
Self {
label: credential.label,
kind: credential.kind,
algorithm: credential.algorithm,
digits: credential.digits,
secret: handle,
secret: key,
touch_required: credential.touch_required,
counter: credential.counter,
}

View File

@@ -1,6 +1,6 @@
use core::convert::TryInto;
use trussed::{client, syscall};
use trussed::{client, syscall, types::KeyId};
use crate::oath;
/// The core calculation
@@ -10,7 +10,7 @@ use crate::oath;
///
/// [rfc-4226]: https://tools.ietf.org/html/rfc4226
/// [rfc-6238]: https://tools.ietf.org/html/rfc6238
pub fn calculate<T>(trussed: &mut T, algorithm: oath::Algorithm, challenge: &[u8], key: trussed::types::ObjectHandle)
pub fn calculate<T>(trussed: &mut T, algorithm: oath::Algorithm, challenge: &[u8], key: KeyId)
-> [u8; 4]
where
T: client::Client + client::HmacSha1 + client::HmacSha256 + client::Sha256,

View File

@@ -6,7 +6,7 @@ use iso7816::Status;
use trussed::{
postcard_deserialize, postcard_serialize_bytes,
syscall, try_syscall,
types::{ObjectHandle, Location, PathBuf},
types::{KeyId, Location, PathBuf},
};
#[derive(Clone, Debug, Default, Eq, PartialEq)]
@@ -25,7 +25,7 @@ pub struct Persistent {
pub salt: [u8; 8],
/// This is the user's password, passed through PBKDF-HMAC-SHA1.
/// It is used for authorization using challenge HMAC-SHA1'ing.
pub authorization_key: Option<ObjectHandle>,
pub authorization_key: Option<KeyId>,
}
#[derive(Clone, Debug, Default, Eq, PartialEq)]