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.
YubiKey 5 vendor commands (kanidm#415)
* implement yubikey config dumping * document yubikey commands, fix warnings * add yubikey to CI * ber: add X690 references, reject some edge cases (and test for that), note yubikey weirdness
- Loading branch information
Showing
15 changed files
with
933 additions
and
3 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
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,37 @@ | ||
use async_trait::async_trait; | ||
|
||
use crate::{ | ||
prelude::WebauthnCError, | ||
transport::{ | ||
yubikey::{YubiKeyConfig, YubiKeyToken}, | ||
Token, | ||
}, | ||
ui::UiCallback, | ||
}; | ||
|
||
use super::Ctap20Authenticator; | ||
|
||
/// YubiKey vendor-specific commands. | ||
/// | ||
/// ## Warning | ||
/// | ||
/// These commands currently operate on *any* [`Ctap20Authenticator`][], and do | ||
/// not filter to just YubiKey devices. Due to the nature of CTAP | ||
/// vendor-specific commands, this may cause unexpected or undesirable behaviour | ||
/// on other vendors' keys. | ||
/// | ||
/// Protocol notes are in [`crate::transport::yubikey`]. | ||
#[async_trait] | ||
pub trait YubiKeyAuthenticator { | ||
async fn get_yubikey_config(&mut self) -> Result<YubiKeyConfig, WebauthnCError>; | ||
} | ||
|
||
#[async_trait] | ||
impl<'a, T: Token + YubiKeyToken, U: UiCallback> YubiKeyAuthenticator | ||
for Ctap20Authenticator<'a, T, U> | ||
{ | ||
#[inline] | ||
async fn get_yubikey_config(&mut self) -> Result<YubiKeyConfig, WebauthnCError> { | ||
self.token.get_yubikey_config().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
Oops, something went wrong.