History

macsec: restore uAPI after addition of GCM-AES-256

Commit ccfdec908922 ("macsec: Add support for GCM-AES-256 cipher suite") changed a few values in the uapi headers for MACsec. Because of existing userspace implementations, we need to preserve the value of MACSEC_DEFAULT_CIPHER_ID. Not doing that resulted in wpa_supplicant segfaults when a secure channel was created using the default cipher. Thus, swap MACSEC_DEFAULT_CIPHER_{ID,ALT} back to their original values. Changing the maximum length of the MACSEC_SA_ATTR_KEY attribute is unnecessary, as the previous value (MACSEC_MAX_KEY_LEN, which was 128B) is large enough to carry 32-bytes keys. This patch reverts MACSEC_MAX_KEY_LEN to 128B and restores the old length check on MACSEC_SA_ATTR_KEY.

Sabrina Dubroca committed 8 years ago

Commit e8660de1 parent 5e89cfa2 files · +8 −10Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/if_macsec.h+3−3
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 #define MACSEC_GENL_NAME "macsec"
1919 #define MACSEC_GENL_VERSION 1
2020
21−#define MACSEC_MAX_KEY_LEN 256
21+#define MACSEC_MAX_KEY_LEN 128
2222
2323 #define MACSEC_KEYID_LEN 16
2424
@@ -26,9 +26,9 @@ · 1 unmodified line
2626 #define MACSEC_CIPHER_ID_GCM_AES_128 0x0080C20001000001ULL
2727 #define MACSEC_CIPHER_ID_GCM_AES_256 0x0080C20001000002ULL
2828
29−#define MACSEC_DEFAULT_CIPHER_ID MACSEC_CIPHER_ID_GCM_AES_128
3029 /* deprecated cipher ID for GCM-AES-128 */
31−#define MACSEC_DEFAULT_CIPHER_ALT 0x0080020001000001ULL
30+#define MACSEC_DEFAULT_CIPHER_ID 0x0080020001000001ULL
31+#define MACSEC_DEFAULT_CIPHER_ALT MACSEC_CIPHER_ID_GCM_AES_128
3232
3333 #define MACSEC_MIN_ICV_LEN 8
3434 #define MACSEC_MAX_ICV_LEN 32