Revert "Cumulative patch from commit a9491695b30a7f750dc45cb563d813b03f1d4b8d"

This reverts commit bbcc4391bed89e8cd0dd235760cd2983f65721cf.

Bug: 34869019
Test: Load image and start soft AP

Change-Id: I85f39c134c1321d6a78f9f25a34f71ad7b1173fb
diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c
index 521a692..53d7d57 100644
--- a/wpa_supplicant/ibss_rsn.c
+++ b/wpa_supplicant/ibss_rsn.c
@@ -408,15 +408,7 @@
 				    const u8 *own_addr, struct wpa_ssid *ssid)
 {
 	struct wpa_auth_config conf;
-	static const struct wpa_auth_callbacks cb = {
-		.logger = auth_logger,
-		.set_eapol = auth_set_eapol,
-		.send_eapol = auth_send_eapol,
-		.get_psk = auth_get_psk,
-		.set_key = auth_set_key,
-		.for_each_sta = auth_for_each_sta,
-		.disconnect = ibss_rsn_disconnect,
-	};
+	struct wpa_auth_callbacks cb;
 
 	wpa_printf(MSG_DEBUG, "AUTH: Initializing group state machine");
 
@@ -429,7 +421,17 @@
 	conf.eapol_version = 2;
 	conf.wpa_group_rekey = ssid->group_rekey ? ssid->group_rekey : 600;
 
-	ibss_rsn->auth_group = wpa_init(own_addr, &conf, &cb, ibss_rsn);
+	os_memset(&cb, 0, sizeof(cb));
+	cb.ctx = ibss_rsn;
+	cb.logger = auth_logger;
+	cb.set_eapol = auth_set_eapol;
+	cb.send_eapol = auth_send_eapol;
+	cb.get_psk = auth_get_psk;
+	cb.set_key = auth_set_key;
+	cb.for_each_sta = auth_for_each_sta;
+	cb.disconnect = ibss_rsn_disconnect;
+
+	ibss_rsn->auth_group = wpa_init(own_addr, &conf, &cb);
 	if (ibss_rsn->auth_group == NULL) {
 		wpa_printf(MSG_DEBUG, "AUTH: wpa_init() failed");
 		return -1;
@@ -836,18 +838,6 @@
 		   MAC2STR(addr));
 
 	if (peer &&
-	    peer->authentication_status & (IBSS_RSN_SET_PTK_SUPP |
-					   IBSS_RSN_SET_PTK_AUTH)) {
-		/* Clear the TK for this pair to allow recovery from the case
-		 * where the peer STA has restarted and lost its key while we
-		 * still have a pairwise key configured. */
-		wpa_printf(MSG_DEBUG, "RSN: Clear pairwise key for peer "
-			   MACSTR, MAC2STR(addr));
-		wpa_drv_set_key(ibss_rsn->wpa_s, WPA_ALG_NONE, addr, 0, 0,
-				NULL, 0, NULL, 0);
-	}
-
-	if (peer &&
 	    peer->authentication_status & IBSS_RSN_AUTH_EAPOL_BY_PEER) {
 		if (peer->own_auth_tx.sec) {
 			struct os_reltime now, diff;