Skip to content

Commit

Permalink
Corrected security protocol data alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Mika Leppänen committed Mar 12, 2019
1 parent 439e051 commit b0b804d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion source/Security/protocols/sec_prot.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ typedef sec_prot_t *sec_prot_by_type_get(sec_prot_t *prot, uint8_t type);
*/
typedef void sec_prot_receive_disable(sec_prot_t *prot);

typedef struct sec_prot_int_data_s sec_prot_int_data_t;

// Security protocol data
struct sec_prot_s {
sec_prot_create_request *create_req; /**< Create request */
Expand Down Expand Up @@ -246,7 +248,7 @@ struct sec_prot_s {

sec_prot_keys_t *sec_keys; /**< Security keys storage pointer */
uint8_t header_size; /**< Header size */
uint8_t data; /**< Protocol internal data */
sec_prot_int_data_t *data; /**< Protocol internal data */
};

#endif /* SEC_PROT_H_ */
4 changes: 3 additions & 1 deletion source/Security/protocols/tls_sec_prot/tls_sec_prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ typedef enum {
TLS_STATE_FINISHED = SEC_STATE_FINISHED
} eap_tls_sec_prot_state_e;

typedef struct tls_sec_prot_lib_int_s tls_sec_prot_lib_int_t;

typedef struct {
sec_prot_common_t common; /**< Common data */
uint8_t new_pmk[PMK_LEN]; /**< New Pair Wise Master Key */
Expand All @@ -64,7 +66,7 @@ typedef struct {
bool timer_running; /**< TLS timer running */
bool finished; /**< TLS finished */
bool calculating; /**< TLS is calculating */
uint8_t tls_sec_inst; /**< TLS security library storage, SHALL BE THE LAST FIELD */
tls_sec_prot_lib_int_t *tls_sec_inst; /**< TLS security library storage, SHALL BE THE LAST FIELD */
} tls_sec_prot_int_t;

static uint16_t tls_sec_prot_size(void);
Expand Down

0 comments on commit b0b804d

Please sign in to comment.