Files
Jorge Martins 0b288cd924 Eip712 review (#355)
* Possible security fix.

It is possible to send a new structure definition after sending a structure implementation, which makes the app treat unrestricted data as if it was a well defined structure.
This commit tries to fix that behaviour. Once a structure implementation is sent, we consider all structures to be defined and we do not allow new definitions.

* Fix previous commit
2022-10-18 11:09:00 +02:00

26 lines
558 B
C

#ifndef EIP712_CTX_H_
#define EIP712_CTX_H_
#ifdef HAVE_EIP712_FULL_SUPPORT
#include <stdbool.h>
#include "ethUstream.h" // ADDRESS_LENGTH
typedef struct {
uint8_t contract_addr[ADDRESS_LENGTH];
uint64_t chain_id;
uint8_t schema_hash[224 / 8];
} s_eip712_context;
extern s_eip712_context *eip712_context;
bool eip712_context_init(void);
void eip712_context_deinit(void);
typedef enum { NOT_INITIALIZED, INITIALIZED, DEFINED } e_struct_init;
extern e_struct_init struct_state;
#endif // HAVE_EIP712_FULL_SUPPORT
#endif // EIP712_CTX_H_