mka: Move structs {transmit,receive}_{sa,sc} to a common header

These structs will be passed down to macsec drivers in a coming patch to
make the driver interface cleaner, so they need to be shared between the
core MKA implementation and the drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
This commit is contained in:
Sabrina Dubroca 2016-09-20 09:43:04 +02:00 committed by Jouni Malinen
parent c64b454a2f
commit f75f6e2b03
4 changed files with 85 additions and 86 deletions

View file

@ -21,6 +21,9 @@
#include "common/defs.h" #include "common/defs.h"
#include "common/ieee802_11_defs.h" #include "common/ieee802_11_defs.h"
#ifdef CONFIG_MACSEC
#include "pae/ieee802_1x_kay.h"
#endif /* CONFIG_MACSEC */
#include "utils/list.h" #include "utils/list.h"
#define HOSTAPD_CHAN_DISABLED 0x00000001 #define HOSTAPD_CHAN_DISABLED 0x00000001

View file

@ -49,6 +49,88 @@ enum mka_created_mode {
EAP_EXCHANGE, EAP_EXCHANGE,
}; };
struct data_key {
u8 *key;
int key_len;
struct ieee802_1x_mka_ki key_identifier;
enum confidentiality_offset confidentiality_offset;
u8 an;
Boolean transmits;
Boolean receives;
struct os_time created_time;
u32 next_pn;
/* not defined data */
Boolean rx_latest;
Boolean tx_latest;
int user; /* FIXME: to indicate if it can be delete safely */
struct dl_list list;
};
/* TransmitSC in IEEE Std 802.1AE-2006, Figure 10-6 */
struct transmit_sc {
struct ieee802_1x_mka_sci sci; /* const SCI sci */
Boolean transmitting; /* bool transmitting (read only) */
struct os_time created_time; /* Time createdTime */
u8 encoding_sa; /* AN encodingSA (read only) */
u8 enciphering_sa; /* AN encipheringSA (read only) */
/* not defined data */
unsigned int channel;
struct dl_list list;
struct dl_list sa_list;
};
/* TransmitSA in IEEE Std 802.1AE-2006, Figure 10-6 */
struct transmit_sa {
Boolean in_use; /* bool inUse (read only) */
u32 next_pn; /* PN nextPN (read only) */
struct os_time created_time; /* Time createdTime */
Boolean enable_transmit; /* bool EnableTransmit */
u8 an;
Boolean confidentiality;
struct data_key *pkey;
struct transmit_sc *sc;
struct dl_list list; /* list entry in struct transmit_sc::sa_list */
};
/* ReceiveSC in IEEE Std 802.1AE-2006, Figure 10-6 */
struct receive_sc {
struct ieee802_1x_mka_sci sci; /* const SCI sci */
Boolean receiving; /* bool receiving (read only) */
struct os_time created_time; /* Time createdTime */
unsigned int channel;
struct dl_list list;
struct dl_list sa_list;
};
/* ReceiveSA in IEEE Std 802.1AE-2006, Figure 10-6 */
struct receive_sa {
Boolean enable_receive; /* bool enableReceive */
Boolean in_use; /* bool inUse (read only) */
u32 next_pn; /* PN nextPN (read only) */
u32 lowest_pn; /* PN lowestPN (read only) */
u8 an;
struct os_time created_time;
struct data_key *pkey;
struct receive_sc *sc; /* list entry in struct receive_sc::sa_list */
struct dl_list list;
};
struct ieee802_1x_kay_ctx { struct ieee802_1x_kay_ctx {
/* pointer to arbitrary upper level context */ /* pointer to arbitrary upper level context */
void *ctx; void *ctx;

View file

@ -54,88 +54,6 @@ struct ieee802_1x_kay_peer {
struct dl_list list; struct dl_list list;
}; };
struct data_key {
u8 *key;
int key_len;
struct ieee802_1x_mka_ki key_identifier;
enum confidentiality_offset confidentiality_offset;
u8 an;
Boolean transmits;
Boolean receives;
struct os_time created_time;
u32 next_pn;
/* not defined data */
Boolean rx_latest;
Boolean tx_latest;
int user; /* FIXME: to indicate if it can be delete safely */
struct dl_list list;
};
/* TransmitSC in IEEE Std 802.1AE-2006, Figure 10-6 */
struct transmit_sc {
struct ieee802_1x_mka_sci sci; /* const SCI sci */
Boolean transmitting; /* bool transmitting (read only) */
struct os_time created_time; /* Time createdTime */
u8 encoding_sa; /* AN encodingSA (read only) */
u8 enciphering_sa; /* AN encipheringSA (read only) */
/* not defined data */
unsigned int channel;
struct dl_list list;
struct dl_list sa_list;
};
/* TransmitSA in IEEE Std 802.1AE-2006, Figure 10-6 */
struct transmit_sa {
Boolean in_use; /* bool inUse (read only) */
u32 next_pn; /* PN nextPN (read only) */
struct os_time created_time; /* Time createdTime */
Boolean enable_transmit; /* bool EnableTransmit */
u8 an;
Boolean confidentiality;
struct data_key *pkey;
struct transmit_sc *sc;
struct dl_list list; /* list entry in struct transmit_sc::sa_list */
};
/* ReceiveSC in IEEE Std 802.1AE-2006, Figure 10-6 */
struct receive_sc {
struct ieee802_1x_mka_sci sci; /* const SCI sci */
Boolean receiving; /* bool receiving (read only) */
struct os_time created_time; /* Time createdTime */
unsigned int channel;
struct dl_list list;
struct dl_list sa_list;
};
/* ReceiveSA in IEEE Std 802.1AE-2006, Figure 10-6 */
struct receive_sa {
Boolean enable_receive; /* bool enableReceive */
Boolean in_use; /* bool inUse (read only) */
u32 next_pn; /* PN nextPN (read only) */
u32 lowest_pn; /* PN lowestPN (read only) */
u8 an;
struct os_time created_time;
struct data_key *pkey;
struct receive_sc *sc; /* list entry in struct receive_sc::sa_list */
struct dl_list list;
};
struct macsec_ciphersuite { struct macsec_ciphersuite {
u64 id; u64 id;
char name[32]; char name[32];

View file

@ -13,10 +13,6 @@
#include "common/ieee802_1x_defs.h" #include "common/ieee802_1x_defs.h"
struct ieee802_1x_kay_conf; struct ieee802_1x_kay_conf;
struct receive_sa;
struct transmit_sa;
struct receive_sc;
struct transmit_sc;
int secy_init_macsec(struct ieee802_1x_kay *kay); int secy_init_macsec(struct ieee802_1x_kay *kay);
int secy_deinit_macsec(struct ieee802_1x_kay *kay); int secy_deinit_macsec(struct ieee802_1x_kay *kay);