Bug 1849423 - implement VirtualFidoDevice::CheckKeyHandle for virtual CTAP1 test tokens. r=keeler

Differential Revision: https://phabricator.services.mozilla.com/D186583
This commit is contained in:
John Schanck 2023-08-28 22:00:48 +00:00
Родитель d0d03369a4
Коммит 76febae414
6 изменённых файлов: 19 добавлений и 62 удалений

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

@ -265,8 +265,16 @@ impl FidoDeviceIO for TestToken {
}
impl VirtualFidoDevice for TestToken {
fn check_key_handle(&self, _req: &CheckKeyHandle) -> Result<(), HIDError> {
Err(HIDError::UnsupportedCommand)
fn check_key_handle(&self, req: &CheckKeyHandle) -> Result<(), HIDError> {
let credlist = self.credentials.borrow();
let req_rp_hash = req.rp.hash();
let eligible_cred_iter = credlist.iter().filter(|x| x.rp.hash() == req_rp_hash);
for credential in eligible_cred_iter {
if req.key_handle == credential.id {
return Ok(());
}
}
Err(HIDError::DeviceError)
}
fn client_pin(&self, req: &ClientPIN) -> Result<ClientPinResponse, HIDError> {

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

@ -0,0 +1,3 @@
[createcredential-excludecredentials.https.html]
[exclude existing credential]
expected: FAIL

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

@ -1,21 +1,9 @@
[getcredential-extensions.https.html]
[extensions is null]
expected: FAIL
[extensions is empty Array]
expected: FAIL
[extensions is empty ArrayBuffer]
expected: FAIL
[ignored extension]
expected: FAIL
[extension ID too long]
expected: FAIL
[credProps is only supported at registration]
expected: FAIL
[navigator.credentials.get() with prf requested but no support in authenticator]
expected: FAIL
[Payment extension is only supported at registration]
expected: FAIL

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

@ -1,42 +0,0 @@
[getcredential-passing.https.html]
[passing credentials.get() with default args]
expected: FAIL
[passing credentials.create() with no timeout]
expected: FAIL
[rpId undefined]
expected: FAIL
[passing credentials.get() with rpId (hostname)]
expected: FAIL
[authenticatorSelection userVerification undefined]
expected: FAIL
[authenticatorSelection userVerification preferred]
expected: FAIL
[authenticatorSelection userVerification discouraged]
expected: FAIL
[authenticatorSelection userVerification empty string]
expected: FAIL
[authenticatorSelection userVerification empty object]
expected: FAIL
[authenticatorSelection userVerification unknown value]
expected: FAIL
[authenticatorSelection userVerification null]
expected: FAIL
[extensions undefined]
expected: FAIL
[extensions are empty object]
expected: FAIL
[extensions are dict of empty strings]
expected: FAIL

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

@ -0,0 +1,3 @@
[getcredential-timeout.https.html]
[WebAuthn navigator.credentials.get() timeout Tests]
expected: FAIL

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

@ -1,3 +0,0 @@
[webauthn-testdriver-basic.https.html]
[Get an assertion]
expected: FAIL