]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make wpa_insert_pmkid() more generic
authorJouni Malinen <jouni@codeaurora.org>
Wed, 14 Aug 2019 14:47:58 +0000 (17:47 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 14 Aug 2019 14:47:58 +0000 (17:47 +0300)
This is not used only with FT, so make the comments less confusing and
include the function in all builds to make it available for
non-FT/non-FILS builds.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/common/wpa_common.c

index 64e5c5f4cd8494f8169dfbbdc3bda720b17d9fba..4c4b8999220e63085a8df1cf4d066bdb8a9c0a62 100644 (file)
@@ -2126,7 +2126,6 @@ int wpa_compare_rsn_ie(int ft_initial_assoc,
 }
 
 
-#if defined(CONFIG_IEEE80211R) || defined(CONFIG_FILS)
 int wpa_insert_pmkid(u8 *ies, size_t *ies_len, const u8 *pmkid)
 {
        u8 *start, *end, *rpos, *rend;
@@ -2141,11 +2140,10 @@ int wpa_insert_pmkid(u8 *ies, size_t *ies_len, const u8 *pmkid)
                start += 2 + start[1];
        }
        if (start >= end) {
-               wpa_printf(MSG_ERROR, "FT: Could not find RSN IE in "
-                          "IEs data");
+               wpa_printf(MSG_ERROR, "RSN: Could not find RSNE in IEs data");
                return -1;
        }
-       wpa_hexdump(MSG_DEBUG, "FT: RSN IE before modification",
+       wpa_hexdump(MSG_DEBUG, "RSN: RSNE before modification",
                    start, 2 + start[1]);
 
        /* Find start of PMKID-Count */
@@ -2171,8 +2169,8 @@ int wpa_insert_pmkid(u8 *ies, size_t *ies_len, const u8 *pmkid)
                /* Skip RSN Capabilities */
                rpos += 2;
                if (rpos > rend) {
-                       wpa_printf(MSG_ERROR, "FT: Could not parse RSN IE in "
-                                  "IEs data");
+                       wpa_printf(MSG_ERROR,
+                                  "RSN: Could not parse RSNE in IEs data");
                        return -1;
                }
        }
@@ -2203,7 +2201,7 @@ int wpa_insert_pmkid(u8 *ies, size_t *ies_len, const u8 *pmkid)
                         * PMKID(s) first before adding the new one.
                         */
                        wpa_printf(MSG_DEBUG,
-                                  "FT: Remove %u old PMKID(s) from RSN IE",
+                                  "RSN: Remove %u old PMKID(s) from RSNE",
                                   num_pmkid);
                        after = rpos + 2 + num_pmkid * PMKID_LEN;
                        os_memmove(rpos + 2, after, rend - after);
@@ -2218,14 +2216,13 @@ int wpa_insert_pmkid(u8 *ies, size_t *ies_len, const u8 *pmkid)
                start[1] += PMKID_LEN;
        }
 
-       wpa_hexdump(MSG_DEBUG, "FT: RSN IE after modification "
-                   "(PMKID inserted)", start, 2 + start[1]);
+       wpa_hexdump(MSG_DEBUG, "RSN: RSNE after modification (PMKID inserted)",
+                   start, 2 + start[1]);
 
        *ies_len += added;
 
        return 0;
 }
-#endif /* CONFIG_IEEE80211R || CONFIG_FILS */
 
 
 int wpa_cipher_key_len(int cipher)