diff --git a/fido2/ctap.h b/fido2/ctap.h index 71bdb6d..42bab42 100644 --- a/fido2/ctap.h +++ b/fido2/ctap.h @@ -162,8 +162,8 @@ typedef struct { struct { uint8_t _pad[CREDENTIAL_NONCE_SIZE - 4]; uint32_t value; - } metadata; - } entropy; + }__attribute__((packed)) metadata; + }__attribute__((packed)) entropy; uint8_t rpIdHash[32]; uint32_t count; }__attribute__((packed)) CredentialId; diff --git a/fido2/ctap_parse.c b/fido2/ctap_parse.c index e9f5cde..d49ae1d 100644 --- a/fido2/ctap_parse.c +++ b/fido2/ctap_parse.c @@ -699,7 +699,7 @@ uint8_t ctap_parse_extensions(CborValue * val, CTAP_extensions * ext) } } else if (strncmp(key, "credProtect",11) == 0) { - if (cbor_value_get_type(&map) != CborIntegerType) { + if (cbor_value_get_type(&map) == CborIntegerType) { ret = cbor_value_get_int(&map, (int*)&ext->cred_protect); check_ret(ret); } else {