]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MACsec: Fix policy configuration
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 30 Oct 2014 09:43:47 +0000 (11:43 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 30 Oct 2014 09:43:47 +0000 (11:43 +0200)
macsec_validate variable was set incorrectly to FALSE(0) or TRUE(1)
instead of the enum validate_frames values (Disabled(0), Checked(1),
Strict(2). This ended up policy == SHOULD_SECURE to be mapped to
macsec_validate == Checked instead of Strict. This could have resulted
in unintended SecY forwarding of invalid packets rather than dropping
them.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/pae/ieee802_1x_kay.c

index 7069c207fa9aabaa4ae077d35f30120000a524c7..176a31230065551425f3f156a761d28ec6ddc6a5 100644 (file)
@@ -3169,7 +3169,7 @@ ieee802_1x_kay_init(struct ieee802_1x_kay_ctx *ctx, enum macsec_policy policy,
                kay->macsec_capable = MACSEC_CAP_NOT_IMPLEMENTED;
                kay->macsec_desired = FALSE;
                kay->macsec_protect = FALSE;
-               kay->macsec_validate = FALSE;
+               kay->macsec_validate = Disabled;
                kay->macsec_replay_protect = FALSE;
                kay->macsec_replay_window = 0;
                kay->macsec_confidentiality = CONFIDENTIALITY_NONE;
@@ -3177,7 +3177,7 @@ ieee802_1x_kay_init(struct ieee802_1x_kay_ctx *ctx, enum macsec_policy policy,
                kay->macsec_capable = MACSEC_CAP_INTEG_AND_CONF_0_30_50;
                kay->macsec_desired = TRUE;
                kay->macsec_protect = TRUE;
-               kay->macsec_validate = TRUE;
+               kay->macsec_validate = Strict;
                kay->macsec_replay_protect = FALSE;
                kay->macsec_replay_window = 0;
                kay->macsec_confidentiality = CONFIDENTIALITY_OFFSET_0;