diff options
Diffstat (limited to 'chromium/device/fido')
-rw-r--r-- | chromium/device/fido/fido_test_data.h | 2 | ||||
-rw-r--r-- | chromium/device/fido/u2f_register_operation.cc | 1 | ||||
-rw-r--r-- | chromium/device/fido/u2f_register_operation_unittest.cc | 10 |
3 files changed, 8 insertions, 5 deletions
diff --git a/chromium/device/fido/fido_test_data.h b/chromium/device/fido/fido_test_data.h index 95192fdeace..7381c21f9e9 100644 --- a/chromium/device/fido/fido_test_data.h +++ b/chromium/device/fido/fido_test_data.h @@ -385,6 +385,8 @@ constexpr uint8_t kU2fConditionNotSatisfiedApduResponse[] = {0x69, 0x85}; constexpr uint8_t kU2fWrongDataApduResponse[] = {0x6A, 0x80}; +constexpr uint8_t kU2fWrongLengthApduResponse[] = {0x67, 0x00}; + constexpr uint8_t kU2fKeyHandleSizeApduResponse[] = {0x00, 0x01}; constexpr uint8_t kApduEncodedNoErrorRegisterResponse[] = { diff --git a/chromium/device/fido/u2f_register_operation.cc b/chromium/device/fido/u2f_register_operation.cc index e80655a5f90..5a29ba0cc24 100644 --- a/chromium/device/fido/u2f_register_operation.cc +++ b/chromium/device/fido/u2f_register_operation.cc @@ -123,6 +123,7 @@ void U2fRegisterOperation::OnCheckForExcludedKeyHandle( } case apdu::ApduResponse::Status::SW_WRONG_DATA: + case apdu::ApduResponse::Status::SW_WRONG_LENGTH: // Continue to iterate through the provided key handles in the exclude // list and check for already registered keys. if (++it != request().exclude_list()->cend()) { diff --git a/chromium/device/fido/u2f_register_operation_unittest.cc b/chromium/device/fido/u2f_register_operation_unittest.cc index 567ce6186f4..89eb9a94e36 100644 --- a/chromium/device/fido/u2f_register_operation_unittest.cc +++ b/chromium/device/fido/u2f_register_operation_unittest.cc @@ -152,10 +152,10 @@ TEST_F(U2fRegisterOperationTest, TestRegistrationWithExclusionList) { auto device = std::make_unique<MockFidoDevice>(); EXPECT_CALL(*device, GetId()).WillRepeatedly(::testing::Return("device")); - // DeviceTransact() will be called three times including two check only - // sign-in calls and one registration call. For the first two calls, device - // will invoke MockFidoDevice::WrongData as the authenticator did not create - // the two key handles provided in the exclude list. At the third call, + // DeviceTransact() will be called three times including two check only sign- + // in calls and one registration call. For the first two calls, device will + // invoke MockFidoDevice::WrongData/WrongLength as the authenticator did not + // create the two key handles provided in the exclude list. At the third call, // MockFidoDevice::NoErrorRegister will be invoked after registration. ::testing::InSequence s; device->ExpectRequestAndRespondWith( @@ -163,7 +163,7 @@ TEST_F(U2fRegisterOperationTest, TestRegistrationWithExclusionList) { test_data::kU2fWrongDataApduResponse); device->ExpectRequestAndRespondWith( test_data::kU2fCheckOnlySignCommandApduWithKeyBeta, - test_data::kU2fWrongDataApduResponse); + test_data::kU2fWrongLengthApduResponse); device->ExpectRequestAndRespondWith( test_data::kU2fRegisterCommandApdu, test_data::kApduEncodedNoErrorRegisterResponse); |