]> git.proxmox.com Git - proxmox-backup.git/blobdiff - src/config/tfa.rs
typo fixes all over the place
[proxmox-backup.git] / src / config / tfa.rs
index 29e0fb48cf27b2927c29e65d2b3fa5b7ae90925d..6b65f6a555b354188178ce1fe65399fff475322a 100644 (file)
@@ -590,7 +590,7 @@ impl TfaUserChallengeData {
     }
 
     /// Save the current data. Note that we do not replace the file here since we lock the file
-    /// itself, as it is in `/run`, and the typicall error case for this particular situation
+    /// itself, as it is in `/run`, and the typical error case for this particular situation
     /// (machine loses power) simply prevents some login, but that'll probably fail anyway for
     /// other reasons then...
     ///
@@ -803,9 +803,20 @@ impl TfaUserData {
         userid: &Userid,
         description: String,
     ) -> Result<String, Error> {
+        let cred_ids: Vec<_> = self
+            .enabled_webauthn_entries()
+            .map(|cred| cred.cred_id.clone())
+            .collect();
+
         let userid_str = userid.to_string();
-        let (challenge, state) = webauthn
-            .generate_challenge_register(&userid_str, Some(UserVerificationPolicy::Discouraged))?;
+        let (challenge, state) = webauthn.generate_challenge_register_options(
+            userid_str.as_bytes().to_vec(),
+            userid_str.clone(),
+            userid_str.clone(),
+            Some(cred_ids),
+            Some(UserVerificationPolicy::Discouraged),
+        )?;
+
         let challenge_string = challenge.public_key.challenge.to_string();
         let challenge = serde_json::to_string(&challenge)?;