Skip to content

Commit

Permalink
Use fido2luks as rp_id instead if default hmac, consider making
Browse files Browse the repository at this point in the history
credenials device specific
  • Loading branch information
shimunn committed Jan 2, 2020
1 parent 5d1c7be commit e7049a2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/device.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
use crate::error::*;

use ctap;
use ctap::extensions::hmac::{FidoHmacCredential, HmacExtension};
use ctap::{FidoDevice, FidoError, FidoErrorKind};
use ctap::{
self,
extensions::hmac::{FidoHmacCredential, HmacExtension},
FidoDevice, FidoError, FidoErrorKind,
};

pub fn make_credential_id() -> Fido2LuksResult<FidoHmacCredential> {
let mut errs = Vec::new();
match get_devices()? {
ref devs if devs.is_empty() => Err(Fido2LuksError::NoAuthenticatorError)?,
devs => {
for mut dev in devs.into_iter() {
match dev.make_hmac_credential() {
match dev
.make_credential("fido2luks", &[0u8], "", &[0u8; 32])
.map(|cred| cred.into())
{
//TODO: make credentials device specific
Ok(cred) => {
return Ok(cred);
}
Expand Down

0 comments on commit e7049a2

Please sign in to comment.