Changeset d7dadcb4 in mainline for uspace/lib/ieee80211/src/ieee80211_impl.c
- Timestamp:
- 2015-04-08T10:54:31Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 053fc2b
- Parents:
- 1dcc0b9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ieee80211/src/ieee80211_impl.c
r1dcc0b9 rd7dadcb4 181 181 return ENOMEM; 182 182 183 size_t hash_length, result_length; 184 switch(hash_sel) { 185 case HASH_MD5: 186 hash_length = MD5_HASH_LENGTH; 187 result_length = IEEE80211_PTK_TKIP_LENGTH; 188 break; 189 case HASH_SHA1: 190 hash_length = SHA1_HASH_LENGTH; 191 result_length = IEEE80211_PTK_CCMP_LENGTH; 192 break; 193 default: 194 hash_length = 0; 195 result_length = 0; 196 } 197 183 size_t result_length = (hash_sel == HASH_MD5) ? 184 IEEE80211_PTK_TKIP_LENGTH : IEEE80211_PTK_CCMP_LENGTH; 198 185 size_t iters = ((result_length * 8) + 159) / 160; 199 186 200 187 const char *a = "Pairwise key expansion"; 201 uint8_t result[hash_ length*iters];202 uint8_t temp[hash_ length];188 uint8_t result[hash_sel*iters]; 189 uint8_t temp[hash_sel]; 203 190 size_t data_size = PRF_CRYPT_DATA_LENGTH + str_size(a) + 2; 204 191 uint8_t work_arr[data_size]; … … 212 199 hmac(key, PBKDF2_KEY_LENGTH, work_arr, data_size, temp, 213 200 hash_sel); 214 memcpy(result + i*hash_ length, temp, hash_length);201 memcpy(result + i*hash_sel, temp, hash_sel); 215 202 } 216 203
Note:
See TracChangeset
for help on using the changeset viewer.