@@ -1,5 +1,3 @@
|
|||||||
from fido2.attestation import FidoU2FAttestation
|
|
||||||
|
|
||||||
# Test U2F register works with FIDO2 auth
|
# Test U2F register works with FIDO2 auth
|
||||||
def test_ctap1_register(RegRes):
|
def test_ctap1_register(RegRes):
|
||||||
pass
|
pass
|
||||||
@@ -8,7 +6,7 @@ def test_ctap1_authenticate(RegRes, AuthRes):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def test_authenticate_ctap1_through_ctap2(device, RegRes):
|
def test_authenticate_ctap1_through_ctap2(device, RegRes):
|
||||||
res = device.doGA(allow_list=[
|
res = device.doGA(ctap1=False, allow_list=[
|
||||||
{"id": RegRes['res'].attestation_object.auth_data.credential_data.credential_id, "type": "public-key"}
|
{"id": RegRes['res'].attestation_object.auth_data.credential_data.credential_id, "type": "public-key"}
|
||||||
])
|
])
|
||||||
assert res['res'].get_response(0).credential_id == RegRes['res'].attestation_object.auth_data.credential_data.credential_id
|
assert res['res'].get_response(0).credential_id == RegRes['res'].attestation_object.auth_data.credential_data.credential_id
|
||||||
@@ -18,7 +16,7 @@ def test_authenticate_ctap1_through_ctap2(device, RegRes):
|
|||||||
def test_ctap1_authenticate_attestation(MCRes, device):
|
def test_ctap1_authenticate_attestation(MCRes, device):
|
||||||
key_handle = MCRes['res'].attestation_object.auth_data.credential_data.credential_id
|
key_handle = MCRes['res'].attestation_object.auth_data.credential_data.credential_id
|
||||||
if len(key_handle) <= 255:
|
if len(key_handle) <= 255:
|
||||||
res = device.doGA(ctap1=True,allow_list=[
|
res = device.doGA(ctap1=True, allow_list=[
|
||||||
{"id": key_handle, "type": "public-key"}
|
{"id": key_handle, "type": "public-key"}
|
||||||
])
|
])
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1,18 +1,12 @@
|
|||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
from fido2.ctap import CtapError
|
from fido2.ctap import CtapError
|
||||||
from fido2.ctap2.pin import PinProtocolV1
|
|
||||||
from fido2.client import ClientPin
|
from fido2.client import ClientPin
|
||||||
from fido2.webauthn import UserVerificationRequirement
|
from fido2.webauthn import UserVerificationRequirement
|
||||||
from fido2.utils import hmac_sha256
|
from fido2.utils import hmac_sha256
|
||||||
|
|
||||||
from utils import *
|
from utils import *
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="class")
|
|
||||||
def client_pin(resetdevice):
|
|
||||||
return ClientPin(resetdevice.client()._backend.ctap2)
|
|
||||||
|
|
||||||
def test_lockout(device, resetdevice, client_pin):
|
def test_lockout(device, resetdevice, client_pin):
|
||||||
pin = "TestPin"
|
pin = "TestPin"
|
||||||
client_pin.set_pin(pin)
|
client_pin.set_pin(pin)
|
||||||
|
|||||||
Reference in New Issue
Block a user