Bug 1822429 - Don't require PIN if user verification is discouraged. r=msirringhaus,keeler

Differential Revision: https://phabricator.services.mozilla.com/D175475
This commit is contained in:
M. Sirringhaus 2023-04-19 18:19:29 +00:00
Родитель 540b2f5a7c
Коммит 0aaa5cce18
1 изменённых файлов: 16 добавлений и 4 удалений

Просмотреть файл

@ -485,7 +485,13 @@ impl AuthrsTransport {
let mut user_verification = nsString::new();
unsafe { args.GetUserVerification(&mut *user_verification) }.to_result()?;
let require_user_verification = user_verification.eq("required");
let user_verification = if user_verification.eq("required") {
Some(true)
} else if user_verification.eq("discouraged") {
Some(false)
} else {
None
};
let mut attestation_conveyance_preference = nsString::new();
unsafe { args.GetAttestationConveyancePreference(&mut *attestation_conveyance_preference) }
@ -518,7 +524,7 @@ impl AuthrsTransport {
exclude_list,
options: MakeCredentialsOptions {
resident_key: require_resident_key.then_some(true),
user_verification: require_user_verification.then_some(true),
user_verification,
},
extensions: Default::default(),
pin: None,
@ -612,7 +618,13 @@ impl AuthrsTransport {
let mut user_verification = nsString::new();
unsafe { args.GetUserVerification(&mut *user_verification) }.to_result()?;
let require_user_verification = user_verification.eq("required");
let user_verification = if user_verification.eq("required") {
Some(true)
} else if user_verification.eq("discouraged") {
Some(false)
} else {
None
};
let mut alternate_rp_id = None;
let mut maybe_alternate_rp_id = nsString::new();
@ -678,7 +690,7 @@ impl AuthrsTransport {
allow_list,
options: GetAssertionOptions {
user_presence: Some(true),
user_verification: require_user_verification.then_some(true),
user_verification,
},
extensions: Default::default(),
pin: None,