mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-31 09:14:03 -05:00
MKA: Mark frame structs packed
Mark the data structures used in construction/parsing frames packed to prevent compiler from being able to pad them. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
91ad2f441a
commit
f1ac2b8e6a
@ -38,7 +38,7 @@ struct ieee802_1x_mka_ki {
|
|||||||
struct ieee802_1x_mka_sci {
|
struct ieee802_1x_mka_sci {
|
||||||
u8 addr[ETH_ALEN];
|
u8 addr[ETH_ALEN];
|
||||||
be16 port;
|
be16 port;
|
||||||
};
|
} STRUCT_PACKED;
|
||||||
|
|
||||||
struct mka_key {
|
struct mka_key {
|
||||||
u8 key[MAX_KEY_LEN];
|
u8 key[MAX_KEY_LEN];
|
||||||
|
@ -165,7 +165,7 @@ struct ieee802_1x_mka_hdr {
|
|||||||
#endif
|
#endif
|
||||||
/* octet 4 */
|
/* octet 4 */
|
||||||
u8 length1;
|
u8 length1;
|
||||||
};
|
} STRUCT_PACKED;
|
||||||
|
|
||||||
#define MKA_HDR_LEN sizeof(struct ieee802_1x_mka_hdr)
|
#define MKA_HDR_LEN sizeof(struct ieee802_1x_mka_hdr)
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ struct ieee802_1x_mka_basic_body {
|
|||||||
|
|
||||||
/* followed by CAK Name */
|
/* followed by CAK Name */
|
||||||
u8 ckn[0];
|
u8 ckn[0];
|
||||||
};
|
} STRUCT_PACKED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct ieee802_1x_mka_peer_body - Live Peer List and Potential Peer List
|
* struct ieee802_1x_mka_peer_body - Live Peer List and Potential Peer List
|
||||||
@ -238,9 +238,9 @@ struct ieee802_1x_mka_peer_body {
|
|||||||
/* octet 4 */
|
/* octet 4 */
|
||||||
u8 length1;
|
u8 length1;
|
||||||
|
|
||||||
u8 peer[0];
|
|
||||||
/* followed by Peers */
|
/* followed by Peers */
|
||||||
};
|
u8 peer[0];
|
||||||
|
} STRUCT_PACKED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct ieee802_1x_mka_sak_use_body - MACsec SAK Use parameter set (Figure
|
* struct ieee802_1x_mka_sak_use_body - MACsec SAK Use parameter set (Figure
|
||||||
@ -315,7 +315,7 @@ struct ieee802_1x_mka_sak_use_body {
|
|||||||
be32 okn;
|
be32 okn;
|
||||||
/* octet 41 - 44 */
|
/* octet 41 - 44 */
|
||||||
be32 olpn;
|
be32 olpn;
|
||||||
};
|
} STRUCT_PACKED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct ieee802_1x_mka_dist_sak_body - Distributed SAK parameter set
|
* struct ieee802_1x_mka_dist_sak_body - Distributed SAK parameter set
|
||||||
@ -362,7 +362,7 @@ struct ieee802_1x_mka_dist_sak_body {
|
|||||||
* for other cipher suite: octet 9-16: cipher suite id, octet 17-: SAK
|
* for other cipher suite: octet 9-16: cipher suite id, octet 17-: SAK
|
||||||
*/
|
*/
|
||||||
u8 sak[0];
|
u8 sak[0];
|
||||||
};
|
} STRUCT_PACKED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct ieee802_1x_mka_dist_cak_body - Distributed CAK parameter set (Figure
|
* struct ieee802_1x_mka_dist_cak_body - Distributed CAK parameter set (Figure
|
||||||
@ -398,7 +398,7 @@ struct ieee802_1x_mka_dist_cak_body {
|
|||||||
|
|
||||||
/* followed by CAK Name, 29- */
|
/* followed by CAK Name, 29- */
|
||||||
u8 ckn[0];
|
u8 ckn[0];
|
||||||
};
|
} STRUCT_PACKED;
|
||||||
|
|
||||||
struct ieee802_1x_mka_icv_body {
|
struct ieee802_1x_mka_icv_body {
|
||||||
/* octet 1 */
|
/* octet 1 */
|
||||||
@ -418,6 +418,6 @@ struct ieee802_1x_mka_icv_body {
|
|||||||
|
|
||||||
/* octet 5 - */
|
/* octet 5 - */
|
||||||
u8 icv[0];
|
u8 icv[0];
|
||||||
};
|
} STRUCT_PACKED;
|
||||||
|
|
||||||
#endif /* IEEE802_1X_KAY_I_H */
|
#endif /* IEEE802_1X_KAY_I_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user