fix(esp_hosted_ng): fix errorneous installation of tkip unicast keys
authorShreyas Sheth <shreyas.sheth@espressif.com>
Thu, 9 Nov 2023 14:30:56 +0000 (20:00 +0530)
committerShreyas Sheth <shreyas.sheth@espressif.com>
Thu, 9 Nov 2023 14:47:26 +0000 (20:17 +0530)
esp_hosted_ng/host/esp_cmd.c

index 29bc3c99e64d40337ec96fa0c870d2786626270c..4aff274af05d252be1aa5ec20d3a8d3bae24c887 100644 (file)
@@ -1171,6 +1171,15 @@ int cmd_add_key(struct esp_wifi_device *priv, u8 key_index, bool pairwise,
        }
 #endif
 
+       /* Supplicant swaps tx/rx Mic keys whereas esp needs it normal format */
+       if (key->algo == WIFI_WPA_ALG_TKIP && !key->index) {
+               u8 buf[8];
+               memcpy(buf, &key->data[16], 8);
+               memcpy(&key->data[16], &key->data[24], 8);
+               memcpy(&key->data[24], buf, 8);
+               memset(buf, 0, 8);
+       }
+
 #if 0
        esp_err("%u algo: %u idx: %u seq_len: %u len:%u\n", __LINE__,
                        key->algo, key->index, key->seq_len, key->len);
This page took 0.035331 seconds and 4 git commands to generate.