Remove used KDE addition code from EAPOL-Key msg 4/4

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>
This commit is contained in:
Jouni Malinen 2014-04-05 23:30:16 +03:00
parent 9a147ba18d
commit e1a273a61d
3 changed files with 4 additions and 14 deletions

View 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, if (wpa_supplicant_send_4_of_4(sm, peerkey->addr, key, ver,
WPA_GET_BE16(key->key_info), WPA_GET_BE16(key->key_info),
NULL, 0, &peerkey->stk)) &peerkey->stk))
return; return;
_key = (u8 *) peerkey->stk.tk1; _key = (u8 *) peerkey->stk.tk1;

View file

@ -1020,27 +1020,20 @@ static int wpa_supplicant_validate_ie(struct wpa_sm *sm,
* @key: Pointer to the EAPOL-Key frame header * @key: Pointer to the EAPOL-Key frame header
* @ver: Version bits from EAPOL-Key Key Info * @ver: Version bits from EAPOL-Key Key Info
* @key_info: 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 * @ptk: PTK to use for keyed hash and encryption
* Returns: 0 on success, -1 on failure * Returns: 0 on success, -1 on failure
*/ */
int wpa_supplicant_send_4_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, const struct wpa_eapol_key *key,
u16 ver, u16 key_info, u16 ver, u16 key_info,
const u8 *kde, size_t kde_len,
struct wpa_ptk *ptk) struct wpa_ptk *ptk)
{ {
size_t rlen; size_t rlen;
struct wpa_eapol_key *reply; struct wpa_eapol_key *reply;
u8 *rbuf; 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, rbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY, NULL,
sizeof(*reply) + kde_len, sizeof(*reply), &rlen, (void *) &reply);
&rlen, (void *) &reply);
if (rbuf == NULL) if (rbuf == NULL)
return -1; 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, os_memcpy(reply->replay_counter, key->replay_counter,
WPA_REPLAY_COUNTER_LEN); WPA_REPLAY_COUNTER_LEN);
WPA_PUT_BE16(reply->key_data_length, kde_len); WPA_PUT_BE16(reply->key_data_length, 0);
if (kde)
os_memcpy(reply + 1, kde, kde_len);
wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Sending EAPOL-Key 4/4"); 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, 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 */ #endif /* CONFIG_P2P */
if (wpa_supplicant_send_4_of_4(sm, sm->bssid, key, ver, key_info, if (wpa_supplicant_send_4_of_4(sm, sm->bssid, key, ver, key_info,
NULL, 0, &sm->ptk)) { &sm->ptk)) {
goto failed; goto failed;
} }

View 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, int wpa_supplicant_send_4_of_4(struct wpa_sm *sm, const unsigned char *dst,
const struct wpa_eapol_key *key, const struct wpa_eapol_key *key,
u16 ver, u16 key_info, u16 ver, u16 key_info,
const u8 *kde, size_t kde_len,
struct wpa_ptk *ptk); struct wpa_ptk *ptk);
int wpa_derive_ptk_ft(struct wpa_sm *sm, const unsigned char *src_addr, int wpa_derive_ptk_ft(struct wpa_sm *sm, const unsigned char *src_addr,