aboutsummaryrefslogtreecommitdiff
path: root/src/api/identity.rs
diff options
context:
space:
mode:
authorBlackDex <[email protected]>2022-03-27 17:25:04 +0200
committerBlackDex <[email protected]>2022-03-27 17:25:04 +0200
commitfb0c23b71fe8ff95bc421a8e6dbbc6d4a46a38d5 (patch)
treea7d5ba0f0283f817a5c4c2fb0a527eead2983436 /src/api/identity.rs
parent6643e83b61bccefc24d7265bd1bbbcd9a786f85e (diff)
downloadvaultwarden-fb0c23b71fe8ff95bc421a8e6dbbc6d4a46a38d5.tar.gz
vaultwarden-fb0c23b71fe8ff95bc421a8e6dbbc6d4a46a38d5.zip
Remove u2f implementation
For a while now WebAuthn has replaced u2f. And since web-vault v2.27.0 the connector files for u2f have been removed. Also, on the official bitwarden server the endpoint to `/two-factor/get-u2f` results in a 404. - Removed all u2f code except the migration code from u2f to WebAuthn
Diffstat (limited to 'src/api/identity.rs')
-rw-r--r--src/api/identity.rs21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/api/identity.rs b/src/api/identity.rs
index fc7ffcec..df1112bb 100644
--- a/src/api/identity.rs
+++ b/src/api/identity.rs
@@ -314,7 +314,6 @@ async fn twofactor_auth(
Some(TwoFactorType::Authenticator) => {
_tf::authenticator::validate_totp_code_str(user_uuid, twofactor_code, &selected_data?, ip, conn).await?
}
- Some(TwoFactorType::U2f) => _tf::u2f::validate_u2f_login(user_uuid, twofactor_code, conn).await?,
Some(TwoFactorType::Webauthn) => {
_tf::webauthn::validate_webauthn_login(user_uuid, twofactor_code, conn).await?
}
@@ -372,26 +371,6 @@ async fn _json_err_twofactor(providers: &[i32], user_uuid: &str, conn: &DbConn)
match TwoFactorType::from_i32(*provider) {
Some(TwoFactorType::Authenticator) => { /* Nothing to do for TOTP */ }
- Some(TwoFactorType::U2f) if CONFIG.domain_set() => {
- let request = two_factor::u2f::generate_u2f_login(user_uuid, conn).await?;
- let mut challenge_list = Vec::new();
-
- for key in request.registered_keys {
- challenge_list.push(json!({
- "appId": request.app_id,
- "challenge": request.challenge,
- "version": key.version,
- "keyHandle": key.key_handle,
- }));
- }
-
- let challenge_list_str = serde_json::to_string(&challenge_list).unwrap();
-
- result["TwoFactorProviders2"][provider.to_string()] = json!({
- "Challenges": challenge_list_str,
- });
- }
-
Some(TwoFactorType::Webauthn) if CONFIG.domain_set() => {
let request = two_factor::webauthn::generate_webauthn_login(user_uuid, conn).await?;
result["TwoFactorProviders2"][provider.to_string()] = request.0;