dont fail when public key type is too large

pull/196/head
Conor Patrick 2019-05-18 14:34:54 -04:00
rodzic 035b1a8632
commit 31328fe7e7
2 zmienionych plików z 19 dodań i 1 usunięć

Wyświetl plik

@ -929,7 +929,15 @@ uint8_t parse_credential_descriptor(CborValue * arr, CTAP_credentialDescriptor *
buflen = sizeof(type);
ret = cbor_value_copy_text_string(&val, type, &buflen, NULL);
check_ret(ret);
if (ret == CborErrorOutOfMemory)
{
cred->type = PUB_KEY_CRED_UNKNOWN;
}
else
{
check_ret(ret);
}
if (strncmp(type, "public-key",11) == 0)
{

Wyświetl plik

@ -621,6 +621,16 @@ class FIDO2Tests(Tester):
other={"exclude_list": [{"id": b"1234", "type": "rot13"}]},
)
self.testMC(
"Send MC request with excludeList item with bogus type, expect SUCCESS",
cdh,
rp,
user,
key_params,
expectedError=CtapError.ERR.SUCCESS,
other={"exclude_list": [{"id": b"1234", "type": "mangoPapayaCoconutNotAPublicKey"}]},
)
self.testMC(
"Send MC request with excludeList with bad item, expect error",
cdh,