Skip to content

Commit b6418be

Browse files
committed
Test that unkown additional arguments are allowed
1 parent dd3b4f6 commit b6418be

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

tests/device/test_sign_extension_v4.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,25 @@ def test_assert_missing_args(ctap2, on_keepalive, credential_cache, sign):
590590
assert exc_info.value.code == CtapError.ERR.MISSING_PARAMETER
591591

592592

593+
def test_assert_unknown_args(ctap2, on_keepalive, credential_cache, sign):
594+
cred = credential_cache.make_cred_or_skip(
595+
lambda cred: cred.algorithm == arkg.ARKG_P256_ESP256 and cred.flags == 0b000,
596+
[arkg.ARKG_P256_ESP256],
597+
)
598+
credential_id = cred.response.auth_data.credential_data.credential_id
599+
tbs = os.urandom(32)
600+
public_key, args = if_arkg(cred.algorithm, cred.public_key)
601+
if args is None:
602+
pytest.skip("Algorithm does not use additional arguments")
603+
ext_inputs = sign_inputs(cred, tbs, additional_args=args)
604+
605+
response1 = sign(cred, tbs, additional_args=args)
606+
assert response1 is not None
607+
608+
response2 = sign(cred, tbs, additional_args={**args, 42: 1337})
609+
assert response2 is not None
610+
611+
593612
def test_assert_up_required(ctap2, on_keepalive, credential_cache, sign):
594613
cred = credential_cache.make_cred_or_skip(
595614
lambda cred: cred.flags & 0b001 == 0b001,

0 commit comments

Comments
 (0)