vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit aba9c28226d4f716d4f6fbc28baf98b84262ae00
parent 82e2b8a8c0ad01225058bafd487f2656afb81704
Author: Stepan Fedorko-Bartos <step7750@gmail.com>
Date:   Fri, 16 Nov 2018 12:07:00 -0700

Disable Yubikey 2FA if 0 Keys Provided

Diffstat:
Msrc/api/core/two_factor.rs | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/api/core/two_factor.rs b/src/api/core/two_factor.rs @@ -630,6 +630,13 @@ fn activate_yubikey(data: JsonUpcase<EnableYubikeyData>, headers: Headers, conn: let yubikeys = parse_yubikeys(&data); + if yubikeys.len() == 0 { + return Ok(Json(json!({ + "Enabled": false, + "Object": "twoFactorU2f", + }))); + } + // Ensure they are valid OTPs for yubikey in &yubikeys { if yubikey.len() == 12 {