forked from kanidm/webauthn-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: implementing SoloKey vendor commands
- Loading branch information
Showing
13 changed files
with
214 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use async_trait::async_trait; | ||
use uuid::Uuid; | ||
|
||
use crate::{ | ||
prelude::WebauthnCError, transport::solokey::SoloKeyToken, transport::Token, ui::UiCallback, | ||
}; | ||
|
||
use super::Ctap20Authenticator; | ||
|
||
#[async_trait] | ||
pub trait SoloKeyAuthenticator { | ||
async fn get_uuid(&mut self) -> Result<Uuid, WebauthnCError>; | ||
} | ||
|
||
#[async_trait] | ||
impl<'a, T: Token + SoloKeyToken, U: UiCallback> SoloKeyAuthenticator | ||
for Ctap20Authenticator<'a, T, U> | ||
{ | ||
async fn get_uuid(&mut self) -> Result<Uuid, WebauthnCError> { | ||
self.token.get_solokey_uuid().await | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use async_trait::async_trait; | ||
use uuid::Uuid; | ||
|
||
use crate::prelude::WebauthnCError; | ||
|
||
use super::AnyToken; | ||
|
||
#[cfg(all(feature = "usb", feature = "vendor-solokey"))] | ||
pub const CMD_UUID: u8 = super::TYPE_INIT | 0x62; | ||
|
||
#[async_trait] | ||
pub trait SoloKeyToken { | ||
async fn get_solokey_uuid(&mut self) -> Result<Uuid, WebauthnCError>; | ||
} | ||
|
||
#[async_trait] | ||
impl SoloKeyToken for AnyToken { | ||
async fn get_solokey_uuid(&mut self) -> Result<Uuid, WebauthnCError> { | ||
match self { | ||
AnyToken::Stub => unimplemented!(), | ||
#[cfg(feature = "bluetooth")] | ||
AnyToken::Bluetooth(_) => Err(WebauthnCError::NotSupported), | ||
#[cfg(feature = "nfc")] | ||
AnyToken::Nfc(_) => Err(WebauthnCError::NotSupported), | ||
#[cfg(feature = "usb")] | ||
AnyToken::Usb(u) => u.get_solokey_uuid().await, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.