]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove used KDE addition code from EAPOL-Key msg 4/4
authorJouni Malinen <j@w1.fi>
Sat, 5 Apr 2014 20:30:16 +0000 (23:30 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 5 Apr 2014 20:30:16 +0000 (23:30 +0300)
EAPOL-Key msg 4/4 has no specified KDE use, so remove the unused code to
simplify the implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/rsn_supp/peerkey.c
src/rsn_supp/wpa.c
src/rsn_supp/wpa_i.h

index cb86dfbcc4a66320385f57a61f5e259684283115..88550e4b8ad85d34f862b640aa1f6d513fa5e1cb 100644 (file)
@@ -858,7 +858,7 @@ static void wpa_supplicant_process_stk_3_of_4(struct wpa_sm *sm,
 
        if (wpa_supplicant_send_4_of_4(sm, peerkey->addr, key, ver,
                                       WPA_GET_BE16(key->key_info),
-                                      NULL, 0, &peerkey->stk))
+                                      &peerkey->stk))
                return;
 
        _key = (u8 *) peerkey->stk.tk1;
index 976ab798da9e65e8888f70a6a25c0a2a4031f27a..b0ef6a59daf41cc20b9a6ea669465c37de251a13 100644 (file)
@@ -1020,27 +1020,20 @@ static int wpa_supplicant_validate_ie(struct wpa_sm *sm,
  * @key: Pointer to the EAPOL-Key frame header
  * @ver: Version bits from EAPOL-Key Key Info
  * @key_info: Key Info
- * @kde: KDEs to include the EAPOL-Key frame
- * @kde_len: Length of KDEs
  * @ptk: PTK to use for keyed hash and encryption
  * Returns: 0 on success, -1 on failure
  */
 int wpa_supplicant_send_4_of_4(struct wpa_sm *sm, const unsigned char *dst,
                               const struct wpa_eapol_key *key,
                               u16 ver, u16 key_info,
-                              const u8 *kde, size_t kde_len,
                               struct wpa_ptk *ptk)
 {
        size_t rlen;
        struct wpa_eapol_key *reply;
        u8 *rbuf;
 
-       if (kde)
-               wpa_hexdump(MSG_DEBUG, "WPA: KDE for msg 4/4", kde, kde_len);
-
        rbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY, NULL,
-                                 sizeof(*reply) + kde_len,
-                                 &rlen, (void *) &reply);
+                                 sizeof(*reply), &rlen, (void *) &reply);
        if (rbuf == NULL)
                return -1;
 
@@ -1057,9 +1050,7 @@ int wpa_supplicant_send_4_of_4(struct wpa_sm *sm, const unsigned char *dst,
        os_memcpy(reply->replay_counter, key->replay_counter,
                  WPA_REPLAY_COUNTER_LEN);
 
-       WPA_PUT_BE16(reply->key_data_length, kde_len);
-       if (kde)
-               os_memcpy(reply + 1, kde, kde_len);
+       WPA_PUT_BE16(reply->key_data_length, 0);
 
        wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Sending EAPOL-Key 4/4");
        wpa_eapol_key_send(sm, ptk->kck, ver, dst, ETH_P_EAPOL,
@@ -1140,7 +1131,7 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
 #endif /* CONFIG_P2P */
 
        if (wpa_supplicant_send_4_of_4(sm, sm->bssid, key, ver, key_info,
-                                      NULL, 0, &sm->ptk)) {
+                                      &sm->ptk)) {
                goto failed;
        }
 
index f2fd2857956a920c232e46be0f1717cbf3bb9da2..e20e9dacbe62d804c3be88cece2ee21d4f62ad0a 100644 (file)
@@ -321,7 +321,6 @@ int wpa_supplicant_send_2_of_4(struct wpa_sm *sm, const unsigned char *dst,
 int wpa_supplicant_send_4_of_4(struct wpa_sm *sm, const unsigned char *dst,
                               const struct wpa_eapol_key *key,
                               u16 ver, u16 key_info,
-                              const u8 *kde, size_t kde_len,
                               struct wpa_ptk *ptk);
 
 int wpa_derive_ptk_ft(struct wpa_sm *sm, const unsigned char *src_addr,