]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Reserve AKM and cipher suite values
authorJouni Malinen <j@w1.fi>
Sun, 30 Sep 2012 17:26:55 +0000 (20:26 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 30 Sep 2012 17:26:55 +0000 (20:26 +0300)
These values are used with WAPI and CCX and reserving the definitions
here reduces the number of merge conflicts with repositories that
include these functions.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/common/defs.h
src/common/ieee802_11_defs.h
src/common/wpa_common.h
src/drivers/driver.h
src/drivers/driver_nl80211.c
src/rsn_supp/wpa.c
src/rsn_supp/wpa_ie.c

index f50a13302a44e3e68f764292ab054d4499031b7b..9a0300f8c2f91a12946fa97abc81bb19e49d76b4 100644 (file)
@@ -27,6 +27,7 @@ typedef enum { FALSE = 0, TRUE = 1 } Boolean;
 #define WPA_CIPHER_AES_128_CMAC BIT(5)
 #endif /* CONFIG_IEEE80211W */
 #define WPA_CIPHER_GCMP BIT(6)
+#define WPA_CIPHER_SMS4 BIT(7)
 
 #define WPA_KEY_MGMT_IEEE8021X BIT(0)
 #define WPA_KEY_MGMT_PSK BIT(1)
@@ -40,11 +41,15 @@ typedef enum { FALSE = 0, TRUE = 1 } Boolean;
 #define WPA_KEY_MGMT_WPS BIT(9)
 #define WPA_KEY_MGMT_SAE BIT(10)
 #define WPA_KEY_MGMT_FT_SAE BIT(11)
+#define WPA_KEY_MGMT_WAPI_PSK BIT(12)
+#define WPA_KEY_MGMT_WAPI_CERT BIT(13)
+#define WPA_KEY_MGMT_CCKM BIT(14)
 
 static inline int wpa_key_mgmt_wpa_ieee8021x(int akm)
 {
        return !!(akm & (WPA_KEY_MGMT_IEEE8021X |
                         WPA_KEY_MGMT_FT_IEEE8021X |
+                        WPA_KEY_MGMT_CCKM |
                         WPA_KEY_MGMT_IEEE8021X_SHA256));
 }
 
@@ -86,9 +91,15 @@ static inline int wpa_key_mgmt_wpa_any(int akm)
        return wpa_key_mgmt_wpa(akm) || (akm & WPA_KEY_MGMT_WPA_NONE);
 }
 
+static inline int wpa_key_mgmt_cckm(int akm)
+{
+       return akm == WPA_KEY_MGMT_CCKM;
+}
+
 
 #define WPA_PROTO_WPA BIT(0)
 #define WPA_PROTO_RSN BIT(1)
+#define WPA_PROTO_WAPI BIT(2)
 
 #define WPA_AUTH_ALG_OPEN BIT(0)
 #define WPA_AUTH_ALG_SHARED BIT(1)
@@ -104,7 +115,9 @@ enum wpa_alg {
        WPA_ALG_CCMP,
        WPA_ALG_IGTK,
        WPA_ALG_PMK,
-       WPA_ALG_GCMP
+       WPA_ALG_GCMP,
+       WPA_ALG_SMS4,
+       WPA_ALG_KRK
 };
 
 /**
@@ -116,7 +129,8 @@ enum wpa_cipher {
        CIPHER_TKIP,
        CIPHER_CCMP,
        CIPHER_WEP104,
-       CIPHER_GCMP
+       CIPHER_GCMP,
+       CIPHER_SMS4
 };
 
 /**
@@ -134,7 +148,10 @@ enum wpa_key_mgmt {
        KEY_MGMT_PSK_SHA256,
        KEY_MGMT_WPS,
        KEY_MGMT_SAE,
-       KEY_MGMT_FT_SAE
+       KEY_MGMT_FT_SAE,
+       KEY_MGMT_WAPI_PSK,
+       KEY_MGMT_WAPI_CERT,
+       KEY_MGMT_CCKM
 };
 
 /**
index 8b21c5321eb559501974d4c114d54da623ef92d4..ee8578f7603098a931b8d8ef1a09134ceb665310 100644 (file)
 #define WLAN_EID_RIC_DATA 57
 #define WLAN_EID_HT_OPERATION 61
 #define WLAN_EID_SECONDARY_CHANNEL_OFFSET 62
+#define WLAN_EID_WAPI 68
 #define WLAN_EID_TIME_ADVERTISEMENT 69
 #define WLAN_EID_20_40_BSS_COEXISTENCE 72
 #define WLAN_EID_20_40_BSS_INTOLERANT 73
 #define WLAN_EID_ADV_PROTO 108
 #define WLAN_EID_ROAMING_CONSORTIUM 111
 #define WLAN_EID_EXT_CAPAB 127
+#define WLAN_EID_CCKM 156
 #define WLAN_EID_VHT_CAP 191
 #define WLAN_EID_VHT_OPERATION 192
 #define WLAN_EID_VHT_EXTENDED_BSS_LOAD 193
@@ -969,9 +971,17 @@ enum wifi_display_subelem {
 #define WLAN_CIPHER_SUITE_NO_GROUP_ADDR        0x000FAC07
 #define WLAN_CIPHER_SUITE_GCMP         0x000FAC08
 
+#define WLAN_CIPHER_SUITE_SMS4         0x00147201
+
+#define WLAN_CIPHER_SUITE_CKIP         0x00409600
+#define WLAN_CIPHER_SUITE_CKIP_CMIC    0x00409601
+#define WLAN_CIPHER_SUITE_CMIC         0x00409602
+#define WLAN_CIPHER_SUITE_KRK          0x004096FF /* for nl80211 use only */
+
 /* AKM suite selectors */
 #define WLAN_AKM_SUITE_8021X           0x000FAC01
 #define WLAN_AKM_SUITE_PSK             0x000FAC02
+#define WLAN_AKM_SUITE_CCKM            0x00409600
 
 
 /* IEEE 802.11v - WNM Action field values */
index d9b32d09a3fe1a079897a0829c1a020fabbb4cea..20c79d8099b30ae855695680cb91173a13c41355 100644 (file)
@@ -32,6 +32,7 @@
 #define WPA_AUTH_KEY_MGMT_NONE RSN_SELECTOR(0x00, 0x50, 0xf2, 0)
 #define WPA_AUTH_KEY_MGMT_UNSPEC_802_1X RSN_SELECTOR(0x00, 0x50, 0xf2, 1)
 #define WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X RSN_SELECTOR(0x00, 0x50, 0xf2, 2)
+#define WPA_AUTH_KEY_MGMT_CCKM RSN_SELECTOR(0x00, 0x40, 0x96, 0)
 #define WPA_CIPHER_SUITE_NONE RSN_SELECTOR(0x00, 0x50, 0xf2, 0)
 #define WPA_CIPHER_SUITE_WEP40 RSN_SELECTOR(0x00, 0x50, 0xf2, 1)
 #define WPA_CIPHER_SUITE_TKIP RSN_SELECTOR(0x00, 0x50, 0xf2, 2)
@@ -53,6 +54,7 @@
 #define RSN_AUTH_KEY_MGMT_TPK_HANDSHAKE RSN_SELECTOR(0x00, 0x0f, 0xac, 7)
 #define RSN_AUTH_KEY_MGMT_SAE RSN_SELECTOR(0x00, 0x0f, 0xac, 8)
 #define RSN_AUTH_KEY_MGMT_FT_SAE RSN_SELECTOR(0x00, 0x0f, 0xac, 9)
+#define RSN_AUTH_KEY_MGMT_CCKM RSN_SELECTOR(0x00, 0x40, 0x96, 0x00)
 
 #define RSN_CIPHER_SUITE_NONE RSN_SELECTOR(0x00, 0x0f, 0xac, 0)
 #define RSN_CIPHER_SUITE_WEP40 RSN_SELECTOR(0x00, 0x0f, 0xac, 1)
index 38d0180d30aa123e281aefe884004019aaa5c74f..03481e078819948dbe9bd0f96444cf7aff796be9 100644 (file)
@@ -761,6 +761,7 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE      0x00000010
 #define WPA_DRIVER_CAPA_KEY_MGMT_FT            0x00000020
 #define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK                0x00000040
+#define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK      0x00000080
        unsigned int key_mgmt;
 
 #define WPA_DRIVER_CAPA_ENC_WEP40      0x00000001
index 2ab1314edc456a4a79de303366cceda30c13e0c8..58ede8e1067308b112acdefc3c0ff384babc0f81 100644 (file)
@@ -4209,6 +4209,14 @@ static int wpa_driver_nl80211_set_key(const char *ifname, void *priv,
                        NLA_PUT_U32(msg, NL80211_ATTR_KEY_CIPHER,
                                    WLAN_CIPHER_SUITE_AES_CMAC);
                        break;
+               case WPA_ALG_SMS4:
+                       NLA_PUT_U32(msg, NL80211_ATTR_KEY_CIPHER,
+                                   WLAN_CIPHER_SUITE_SMS4);
+                       break;
+               case WPA_ALG_KRK:
+                       NLA_PUT_U32(msg, NL80211_ATTR_KEY_CIPHER,
+                                   WLAN_CIPHER_SUITE_KRK);
+                       break;
                default:
                        wpa_printf(MSG_ERROR, "%s: Unsupported encryption "
                                   "algorithm %d", __func__, alg);
@@ -6709,6 +6717,9 @@ skip_auth_type:
                int cipher;
 
                switch (params->pairwise_suite) {
+               case CIPHER_SMS4:
+                       cipher = WLAN_CIPHER_SUITE_SMS4;
+                       break;
                case CIPHER_WEP40:
                        cipher = WLAN_CIPHER_SUITE_WEP40;
                        break;
@@ -6733,6 +6744,9 @@ skip_auth_type:
                int cipher;
 
                switch (params->group_suite) {
+               case CIPHER_SMS4:
+                       cipher = WLAN_CIPHER_SUITE_SMS4;
+                       break;
                case CIPHER_WEP40:
                        cipher = WLAN_CIPHER_SUITE_WEP40;
                        break;
@@ -6754,10 +6768,14 @@ skip_auth_type:
        }
 
        if (params->key_mgmt_suite == KEY_MGMT_802_1X ||
-           params->key_mgmt_suite == KEY_MGMT_PSK) {
+           params->key_mgmt_suite == KEY_MGMT_PSK ||
+           params->key_mgmt_suite == KEY_MGMT_CCKM) {
                int mgmt = WLAN_AKM_SUITE_PSK;
 
                switch (params->key_mgmt_suite) {
+               case KEY_MGMT_CCKM:
+                       mgmt = WLAN_AKM_SUITE_CCKM;
+                       break;
                case KEY_MGMT_802_1X:
                        mgmt = WLAN_AKM_SUITE_8021X;
                        break;
index 5cf32df8e6a9632464d25e607fefd04077fd6e64..918dcfa36d9ce004dbe04e1d900debe37dae44a8 100644 (file)
@@ -1836,6 +1836,10 @@ static u32 wpa_key_mgmt_suite(struct wpa_sm *sm)
        case WPA_KEY_MGMT_PSK_SHA256:
                return RSN_AUTH_KEY_MGMT_PSK_SHA256;
 #endif /* CONFIG_IEEE80211W */
+       case WPA_KEY_MGMT_CCKM:
+               return (sm->proto == WPA_PROTO_RSN ?
+                       RSN_AUTH_KEY_MGMT_CCKM:
+                       WPA_AUTH_KEY_MGMT_CCKM);
        case WPA_KEY_MGMT_WPA_NONE:
                return WPA_AUTH_KEY_MGMT_NONE;
        default:
index 429f1e5cda382694a919d547ff0a3d7e0ae9c061..3d7536595773cb885d4115b528503437d583b83a 100644 (file)
@@ -83,6 +83,8 @@ static int wpa_gen_wpa_ie_wpa(u8 *wpa_ie, size_t wpa_ie_len,
                RSN_SELECTOR_PUT(pos, WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X);
        } else if (key_mgmt == WPA_KEY_MGMT_WPA_NONE) {
                RSN_SELECTOR_PUT(pos, WPA_AUTH_KEY_MGMT_NONE);
+       } else if (key_mgmt == WPA_KEY_MGMT_CCKM) {
+               RSN_SELECTOR_PUT(pos, WPA_AUTH_KEY_MGMT_CCKM);
        } else {
                wpa_printf(MSG_WARNING, "Invalid key management type (%d).",
                           key_mgmt);
@@ -152,6 +154,8 @@ static int wpa_gen_wpa_ie_rsn(u8 *rsn_ie, size_t rsn_ie_len,
                RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_UNSPEC_802_1X);
        } else if (key_mgmt == WPA_KEY_MGMT_PSK) {
                RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X);
+       } else if (key_mgmt == WPA_KEY_MGMT_CCKM) {
+               RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_CCKM);
 #ifdef CONFIG_IEEE80211R
        } else if (key_mgmt == WPA_KEY_MGMT_FT_IEEE8021X) {
                RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FT_802_1X);