Security review code linting

This commit is contained in:
Alexandre Paillier
2022-08-08 13:55:45 +02:00
parent b2ec3eff0a
commit 3e3dade0b4
3 changed files with 2 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ extern s_eip712_context *eip712_context;
bool eip712_context_init(void);
void eip712_context_deinit(void);
typedef enum {NOT_INITIALIZED, INITIALIZED} e_struct_init;
typedef enum { NOT_INITIALIZED, INITIALIZED } e_struct_init;
extern e_struct_init struct_state;
#endif // HAVE_EIP712_FULL_SUPPORT

View File

@@ -76,7 +76,7 @@ void *encode_int(const uint8_t *const value, uint8_t length, uint8_t typesize) {
if (length < 1) {
apdu_response_code = APDU_RESPONSE_INVALID_DATA;
return NULL;
return NULL;
}
if ((length == typesize) && (value[0] & (1 << 7))) // negative number

View File

@@ -703,7 +703,6 @@ bool set_struct_field(uint8_t length, const uint8_t *const data) {
// check TypeSize flag in TypeDesc
if (*typedesc_ptr & TYPESIZE_MASK) {
// TYPESIZE and TYPE_CUSTOM are mutually exclusive
if ((*typedesc_ptr & TYPE_MASK) == TYPE_CUSTOM) {
apdu_response_code = APDU_RESPONSE_CONDITION_NOT_SATISFIED;