Add MAX_MSG_SIZE in getInfo.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-12-07 17:01:01 +01:00
parent 8e9eafaec5
commit d7016f6065
2 changed files with 6 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ int cbor_get_info() {
CborEncoder encoder, mapEncoder, arrayEncoder, mapEncoder2;
CborError error = CborNoError;
cbor_encoder_init(&encoder, ctap_resp->init.data + 1, CTAP_MAX_PACKET_SIZE, 0);
CBOR_CHECK(cbor_encoder_create_map(&encoder, &mapEncoder, 13));
CBOR_CHECK(cbor_encoder_create_map(&encoder, &mapEncoder, 14));
CBOR_CHECK(cbor_encode_uint(&mapEncoder, 0x01));
CBOR_CHECK(cbor_encoder_create_array(&mapEncoder, &arrayEncoder, 3));
@@ -67,6 +67,9 @@ int cbor_get_info() {
CBOR_CHECK(cbor_encode_boolean(&arrayEncoder, true));
CBOR_CHECK(cbor_encoder_close_container(&mapEncoder, &arrayEncoder));
CBOR_CHECK(cbor_encode_uint(&mapEncoder, 0x05));
CBOR_CHECK(cbor_encode_uint(&mapEncoder, MAX_MSG_SIZE));
CBOR_CHECK(cbor_encode_uint(&mapEncoder, 0x06));
CBOR_CHECK(cbor_encoder_create_array(&mapEncoder, &arrayEncoder, 2));
CBOR_CHECK(cbor_encode_uint(&arrayEncoder, 1)); // PIN protocols

View File

@@ -79,6 +79,8 @@ extern void set_opts(uint8_t);
#define MAX_CRED_ID_LENGTH 1024
#define MAX_RESIDENT_CREDENTIALS 256
#define MAX_CREDBLOB_LENGTH 128
#define MAX_MSG_SIZE 1024
#define MAX_FRAGMENT_LENGTH (MAX_MSG_SIZE - 64)
typedef struct known_app {
const uint8_t *rp_id_hash;