From b47854c3355345dc174af042fe395f269e5ea267 Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Sun, 28 Jul 2019 21:41:11 -0400 Subject: [PATCH] use error code PIN_AUTH_INVALID --- fido2/ctap.c | 4 ++-- tools/testing/tests/fido2.py | 26 ++++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/fido2/ctap.c b/fido2/ctap.c index 5a69037..7413c17 100644 --- a/fido2/ctap.c +++ b/fido2/ctap.c @@ -704,7 +704,7 @@ uint8_t ctap_make_credential(CborEncoder * encoder, uint8_t * request, int lengt { return CTAP2_ERR_OPERATION_DENIED; } - return ctap_is_pin_set() == 1 ? CTAP2_ERR_PIN_INVALID : CTAP2_ERR_PIN_NOT_SET; + return ctap_is_pin_set() == 1 ? CTAP2_ERR_PIN_AUTH_INVALID : CTAP2_ERR_PIN_NOT_SET; } if ((MC.paramsParsed & MC_requiredMask) != MC_requiredMask) { @@ -1140,7 +1140,7 @@ uint8_t ctap_get_assertion(CborEncoder * encoder, uint8_t * request, int length) { return CTAP2_ERR_OPERATION_DENIED; } - return ctap_is_pin_set() == 1 ? CTAP2_ERR_PIN_INVALID : CTAP2_ERR_PIN_NOT_SET; + return ctap_is_pin_set() == 1 ? CTAP2_ERR_PIN_AUTH_INVALID : CTAP2_ERR_PIN_NOT_SET; } if (GA.pinAuthPresent) { diff --git a/tools/testing/tests/fido2.py b/tools/testing/tests/fido2.py index 339826a..dc76df3 100644 --- a/tools/testing/tests/fido2.py +++ b/tools/testing/tests/fido2.py @@ -1134,7 +1134,10 @@ class FIDO2Tests(Tester): rp["id"], cdh, other={"pin_auth": b"", "pin_protocol": pin_protocol}, - expectedError=CtapError.ERR.PIN_NOT_SET, + expectedError=[ + CtapError.ERR.PIN_AUTH_INVALID, + CtapError.ERR.NO_CREDENTIALS, + ], ) with Test("Setting pin code, expect SUCCESS"): @@ -1148,14 +1151,17 @@ class FIDO2Tests(Tester): user, key_params, other={"pin_auth": b"", "pin_protocol": pin_protocol}, - expectedError=CtapError.ERR.PIN_INVALID, + expectedError=CtapError.ERR.PIN_AUTH_INVALID, ) self.testGA( "Send MC request with new pin auth", rp["id"], cdh, other={"pin_auth": b"", "pin_protocol": pin_protocol}, - expectedError=CtapError.ERR.PIN_INVALID, + expectedError=[ + CtapError.ERR.PIN_AUTH_INVALID, + CtapError.ERR.NO_CREDENTIALS, + ], ) self.testReset() @@ -1311,13 +1317,13 @@ class FIDO2Tests(Tester): self.testReset() - self.test_get_info() - - self.test_get_assertion() - - self.test_make_credential() - - self.test_rk(None) + # self.test_get_info() + # + # self.test_get_assertion() + # + # self.test_make_credential() + # + # self.test_rk(None) self.test_client_pin()