Changeset 09044cb in mainline
- Timestamp:
- 2015-04-22T09:42:36Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8a64320e
- Parents:
- cc575ef9
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/ar9271/ar9271.c
rcc575ef9 r09044cb 463 463 } 464 464 465 if(key_conf->flags & IEEE80211_KEY_FLAG_TYPE_PAIRWISE) { 466 reg_ptr = AR9271_KEY_TABLE_STA; 467 mic_reg_ptr = AR9271_KEY_TABLE_MIC_STA; 468 } else { 469 reg_ptr = AR9271_KEY_TABLE_GRP; 470 mic_reg_ptr = AR9271_KEY_TABLE_MIC_GRP; 471 } 472 465 uint8_t key_id = 466 (key_conf->flags & IEEE80211_KEY_FLAG_TYPE_PAIRWISE) ? 467 AR9271_STA_KEY_INDEX : key_conf->id; 468 469 reg_ptr = AR9271_KEY_TABLE(key_id); 470 mic_reg_ptr = AR9271_KEY_TABLE(key_id + 64); 473 471 data_start = (void *) key_conf->data; 474 472 … … 558 556 ieee80211_setup_key_confirm(ieee80211_dev, true); 559 557 } else { 560 / / TODO: Delete keys from device558 /* TODO: Delete keys from device */ 561 559 ieee80211_setup_key_confirm(ieee80211_dev, false); 562 560 } … … 591 589 (htc_tx_data_header_t *) 592 590 (complete_buffer + sizeof(htc_frame_header_t)); 593 /* TODO: Distinguish data type. */594 591 data_header->data_type = HTC_DATA_NORMAL; 595 592 data_header->node_idx = 1; 596 593 data_header->vif_idx = 0; 597 /* TODO: There I should probably handle slot number. */598 594 data_header->cookie = 0; 599 595 … … 639 635 mgmt_header->node_idx = 0; 640 636 mgmt_header->vif_idx = 0; 641 /* TODO: There I should probably handle slot number. */642 637 mgmt_header->cookie = 0; 643 638 mgmt_header->keyix = 0xFF; -
uspace/drv/nic/ar9271/ar9271.h
rcc575ef9 r09044cb 136 136 137 137 /* Key related registers */ 138 AR9271_KEY_TABLE_GRP = 0x8820, 139 AR9271_KEY_TABLE_STA = 0x8880, 140 AR9271_KEY_TABLE_MIC_GRP = 0x9020, 141 AR9271_KEY_TABLE_MIC_STA = 0x9080, 138 AR9271_KEY_TABLE_BASE = 0x8800, 142 139 AR9271_KEY_TABLE_TYPE_WEP40 = 0x0, 143 140 AR9271_KEY_TABLE_TYPE_WEP104 = 0x1, … … 186 183 AR9271_FW_OFFSET = 0x903000, 187 184 } ar9271_registers_t; 185 186 /** Compute key table base position for key by its id. */ 187 #define AR9271_KEY_TABLE(id) (AR9271_KEY_TABLE_BASE + (id)*32) 188 188 189 189 /** AR9271 Requests */ -
uspace/lib/ieee80211/include/ieee80211_private.h
rcc575ef9 r09044cb 174 174 typedef enum { 175 175 IEEE80211_EAPOL_KEY_KEYINFO_KEYTYPE = 0x0008, 176 IEEE80211_EAPOL_KEY_KEYINFO_KEYID = 0x0010, 176 177 IEEE80211_EAPOL_KEY_KEYINFO_INSTALL = 0x0040, 177 178 IEEE80211_EAPOL_KEY_KEYINFO_ACK = 0x0080, -
uspace/lib/ieee80211/src/ieee80211.c
rcc575ef9 r09044cb 1181 1181 (ieee80211_ie_header_t *) it; 1182 1182 uint8_t *channel; 1183 uint32_t oui; 1183 1184 switch(ie_header->element_id) { 1184 1185 case IEEE80211_CHANNEL_IE: 1186 if(!ap_data) 1187 break; 1185 1188 channel = (uint8_t *) 1186 1189 (it + sizeof(ieee80211_ie_header_t)); … … 1197 1200 break; 1198 1201 case IEEE80211_VENDOR_IE: 1199 if(uint32be_from_seq(it + 1200 sizeof(ieee80211_ie_header_t)) == 1201 WPA_OUI) { 1202 oui = uint32be_from_seq(it + 1203 sizeof(ieee80211_ie_header_t)); 1204 if(oui == WPA_OUI) { 1205 if(!ap_data) 1206 break; 1202 1207 /* Prefering WPA2. */ 1203 1208 if(ap_data->scan_result.security.type == … … 1212 1217 sizeof(uint32_t)); 1213 1218 copy_auth_ie(ie_header, ap_data, it); 1214 } else if(uint32be_from_seq(it + 1215 sizeof(ieee80211_ie_header_t)) == 1216 GTK_OUI) { 1219 } else if(oui == GTK_OUI) { 1217 1220 return it + 1218 1221 sizeof(ieee80211_ie_header_t) + 1219 sizeof(uint32_t) + 2;1222 sizeof(uint32_t); 1220 1223 } 1221 1224 } … … 1390 1393 uint8_t *ptk = ieee80211_dev->bssid_info.ptk; 1391 1394 uint8_t *gtk = ieee80211_dev->bssid_info.gtk; 1395 uint8_t gtk_id = 1; 1392 1396 1393 1397 bool handshake_done = false; … … 1503 1507 1504 1508 if(rc == EOK) { 1505 uint8_t *key_ ptr = old_wpa ? key_data :1509 uint8_t *key_data_ptr = old_wpa ? key_data : 1506 1510 ieee80211_process_ies(ieee80211_dev, 1507 1511 NULL, key_data, key_data_length); 1508 1512 1509 if(key_ptr) { 1513 if(key_data_ptr) { 1514 uint8_t *key_ptr; 1515 if(old_wpa) { 1516 key_ptr = key_data_ptr; 1517 } else { 1518 gtk_id = *key_data_ptr & 0x3; 1519 key_ptr = key_data_ptr + 2; 1520 } 1521 1510 1522 memcpy(gtk, key_ptr, gtk_key_length); 1511 1523 handshake_done = true; … … 1588 1600 /* Insert Group key. */ 1589 1601 if(final_phase) { 1602 key_config.id = gtk_id; 1590 1603 key_config.suite = auth_data->security.group_alg; 1591 1604 key_config.flags =
Note:
See TracChangeset
for help on using the changeset viewer.