1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/fido2/ctap: fix parsing validation

This commit is contained in:
Leandro Lanzieri 2022-03-17 09:43:42 +01:00
parent 43a927cbe9
commit 9bb6449a1e
No known key found for this signature in database
GPG Key ID: F4E9A721761C7593

View File

@ -819,8 +819,12 @@ int fido2_ctap_cbor_parse_get_assertion_req(ctap_get_assertion_req_t *req,
CborValue map;
CborType type;
ret = cbor_parser_init(req_raw, len, CborValidateCanonicalFormat, &parser,
&it);
ret = cbor_parser_init(req_raw, len, 0, &parser, &it);
if (ret != CborNoError) {
return CTAP2_ERR_CBOR_PARSING;
}
ret = cbor_value_validate(&it, CborValidateCanonicalFormat);
if (ret != CborNoError) {
return CTAP2_ERR_CBOR_PARSING;
}
@ -937,8 +941,12 @@ int fido2_ctap_cbor_parse_client_pin_req(ctap_client_pin_req_t *req,
CborValue it;
CborValue map;
ret = cbor_parser_init(req_raw, len, CborValidateCanonicalFormat, &parser,
&it);
ret = cbor_parser_init(req_raw, len, 0, &parser, &it);
if (ret != CborNoError) {
return CTAP2_ERR_CBOR_PARSING;
}
ret = cbor_value_validate(&it, CborValidateCanonicalFormat);
if (ret != CborNoError) {
return CTAP2_ERR_CBOR_PARSING;
}
@ -1048,8 +1056,12 @@ int fido2_ctap_cbor_parse_make_credential_req(ctap_make_credential_req_t *req,
CborValue map;
CborType type;
ret = cbor_parser_init(buf, size, CborValidateCanonicalFormat, &parser,
&it);
ret = cbor_parser_init(buf, size, 0, &parser, &it);
if (ret != CborNoError) {
return CTAP2_ERR_CBOR_PARSING;
}
ret = cbor_value_validate(&it, CborValidateCanonicalFormat);
if (ret != CborNoError) {
return CTAP2_ERR_CBOR_PARSING;
}