You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was told that getTransports was recently added to the master branch; however I don't believe that is true. I cloned master just yesterday (i.e., after the comment was made), and I am still seeing null for transports in the JSON:
Here is a snippet of the application that registers the key:
#[derive(Deserialize)]#[serde(rename_all = "camelCase")]structEnableWebauthnData{id:u32,name:String,device_response:RegisterPublicKeyCredential,master_password_hash:String,}fnbuild_webauthn() -> Result<Webauthn,WebauthnError>{WebauthnBuilder::new(
config::get_config().domain.domain().expect("a valid domain"),&Url::parse(&config::get_config().domain_origin()).expect("a valid URL"),)?
.build()}#[post("/two-factor/get-webauthn-challenge", data = "<data>")]asyncfngenerate_webauthn_challenge(data:JsonUpcase<PasswordOrOtpData>,headers:Headers,conn:DbConn,) -> JsonResult{let data:PasswordOrOtpData = data.into_inner().data;let user = headers.user;
data.validate(&user,false,&conn).await?;letmut ca_builder = webauthn_rs::prelude::AttestationCaListBuilder::new();// We only allow YubiKeys with firmware 5.2 or 5.4.
ca_builder
.insert_device_pem(b"-----BEGIN CERTIFICATE-----MIIDHjCCAgagAwIBAgIEG0BT9zANBgkqhkiG9w0BAQsFADAuMSwwKgYDVQQDEyNZdWJpY28gVTJGIFJvb3QgQ0EgU2VyaWFsIDQ1NzIwMDYzMTAgFw0xNDA4MDEwMDAwMDBaGA8yMDUwMDkwNDAwMDAwMFowLjEsMCoGA1UEAxMjWXViaWNvIFUyRiBSb290IENBIFNlcmlhbCA0NTcyMDA2MzEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC/jwYuhBVlqaiYWEMsrWFisgJ+PtM91eSrpI4TK7U53mwCIawSDHy8vUmk5N2KAj9abvT9NP5SMS1hQi3usxoYGonXQgfO6ZXyUA9a+KAkqdFnBnlyugSeCOep8EdZFfsaRFtMjkwz5Gcz2Py4vIYvCdMHPtwaz0bVuzneueIEz6TnQjE63Rdt2zbwnebwTG5ZybeWSwbzy+BJ34ZHcUhPAY89yJQXuE0IzMZFcEBbPNRbWECRKgjq//qT9nmDOFVlSRCt2wiqPSzluwn+v+suQEBsUjTGMEd25tKXXTkNW21wIWbxeSyUoTXwLvGS6xlwQSgNpk2qXYwf8iXg7VWZAgMBAAGjQjBAMB0GA1UdDgQWBBQgIvz0bNGJhjgpToksyKpP9xv9oDAPBgNVHRMECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAQEAjvjuOMDSa+JXFCLyBKsycXtBVZsJ4Ue3LbaEsPY4MYN/hIQ5ZM5p7EjfcnMG4CtYkNsfNHc0AhBLdq45rnT87q/6O3vUEtNMafbhU6kthX7Y+9XFN9NpmYxr+ekVY5xOxi8h9JDIgoMP4VB1uS0aunL1IGqrNooL9mmFnL2kLVVee6/VR6C5+KSTCMCWppMuJIZII2v9o4dkoZ8Y7QRjQlLfYzd3qGtKbw7xaF1UsG/5xUb/Btwb2X2g4InpiB/yt/3CpQXpiWX/K4mBvUKiGn05ZsqeY1gx4g0xLBqcU9psmyPzK+Vsgw2jeRQ5JlKDyqE0hebfC1tvFu0CCrJFcw==-----END CERTIFICATE-----".as_slice(),Uuid::try_parse("ee882879-721c-4913-9775-3dfcce97072a").expect("invaild UUID"),String::from("YubiKey 5"),
alloc::collections::BTreeMap::new(),).expect("unable to insert YubiKey 5C firwmare 5.2 and 5.4 attestation");let(challenge, registration) = build_webauthn()?.start_securitykey_registration(Uuid::try_parse(user.uuid.as_str()).expect("unable to create UUID"),
user.email.as_str(),
user.name.as_str(),Some(WebAuthn::get_all_credentials_by_user(&user.uuid,&conn).await?),Some(ca_builder.build()),Some(AuthenticatorAttachment::CrossPlatform),)?;// We replace any existing registration challenges.TwoFactor::new(
user.uuid,TwoFactorType::WebauthnRegisterChallenge,
serde_json::to_string(®istration)?,).replace_challenge(&conn).await?;letmut challenge_value = serde_json::to_value(challenge.public_key)?;
challenge_value["status"] = "ok".into();
challenge_value["errorMessage"] = "".into();Ok(Json(challenge_value))}#[post("/two-factor/webauthn", data = "<data>")]asyncfnactivate_webauthn(data:Json<EnableWebauthnData>,headers:Headers,conn:DbConn,) -> JsonResult{let data = data.into_inner();let user = headers.user;PasswordOrOtpData{MasterPasswordHash:Some(data.master_password_hash),Otp:None,}.validate(&user,true,&conn).await?;// Retrieve and delete the saved challenge statelet tf_challenge = get_tf_entry(&user.uuid,
i32::from(TwoFactorType::WebauthnRegisterChallenge),&conn,).await.ok_or_else(|| Error::from(String::from("no webauthn challenge")))?;let registration = serde_json::from_str::<SecurityKeyRegistration>(&tf_challenge.data)?;
tf_challenge.delete_challenge(&conn).await?;// Verify the credentials with the saved statelet security_key =
build_webauthn()?.finish_securitykey_registration(&data.device_response,®istration)?;let cred_id = security_key.cred_id().to_string();let regs = matchget_tf_entry(&user.uuid, i32::from(TwoFactorType::Webauthn),&conn).await{None => {let regs = vec![WebauthnRegistration{
id: data.id,
name: data.name,
security_key,}];let tf = TwoFactor::new(
user.uuid,TwoFactorType::Webauthn,
serde_json::to_string(®s)?,);
tf.insert_insert_webauthn(tf.create_webauthn(cred_id),&conn).await?;
regs
}Some(mut tf) => {letmut regs = tf.get_webauthn_registrations()?;
regs.push(WebauthnRegistration{id: data.id,name: data.name,
security_key,});
tf.data = serde_json::to_string(®s)?;
tf.update_insert_webauthn(tf.create_webauthn(cred_id),&conn).await?;
regs
}};Ok(Json(json!({"Enabled":true,"Keys": regs.iter().map(WebauthnRegistration::to_json).collect::<Value>(),"Object":"twoFactorU2f"})))}
I am saving the raw JSON payload to the database. Registration succeeds, and the payload is mostly correct. Can someone point to me where this was allegedly added, so I can help debug the issue? Perhaps this is a browser problem?
System information
[zack@laptop ~]$ uname -a
Linux laptop 6.6.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 21 Dec 2023 19:01:01 +0000 x86_64 GNU/Linux
[zack@laptop ~]$ openssl version
OpenSSL 3.2.0 23 Nov 2023 (Library: OpenSSL 3.2.0 23 Nov 2023)
OS: Arch Linux
Browser: Firefox 121.0
Client: Vaultwarden's patch to Bitwarden's web-vault v2023.12.0
The text was updated successfully, but these errors were encountered:
I was told that
getTransports
was recently added to themaster
branch; however I don't believe that is true. Iclone
dmaster
just yesterday (i.e., after the comment was made), and I am still seeingnull
fortransports
in the JSON:Here is a snippet of the application that registers the key:
I am saving the raw JSON payload to the database. Registration succeeds, and the payload is mostly correct. Can someone point to me where this was allegedly added, so I can help debug the issue? Perhaps this is a browser problem?
System information
OS: Arch Linux
Browser: Firefox 121.0
Client: Vaultwarden's patch to Bitwarden's web-vault v2023.12.0
The text was updated successfully, but these errors were encountered: