Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at crypt-rc4.c:98

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

AirPDcapDecryptWPABroadcastKey

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/crypt/airpdcap.c)expand/collapse
Show more  
 337  AirPDcapDecryptWPABroadcastKey(P_EAPOL_RSN_KEY pEAPKey, guint8  *decryption_key, PAIRPDCAP_SEC_ASSOCIATION sa)
 338  {
 339          guint8  new_key[32];
 340          guint8 key_version;
 341          guint8  *szEncryptedKey;
 342          guint16 key_len = 0;
 343          static AIRPDCAP_KEY_ITEM dummy_key; /* needed in case AirPDcapRsnaMng() wants the key structure */
 344   
 345          /* We skip verifying the MIC of the key. If we were implementing a WPA supplicant we'd want to verify, but for a sniffer it's not needed. */
 346   
 347          /* Preparation for decrypting the group key -  determine group key data length */
 348          /* depending on whether it's a TKIP or AES encryption key */
 349          key_version = AIRPDCAP_EAP_KEY_DESCR_VER(pEAPKey->key_information[1]);
 350          if (key_version == AIRPDCAP_WPA_KEY_VER_NOT_CCMP){
 351                  /* TKIP */
 352                  key_len = pntohs(pEAPKey->key_length);
 353          }else if (key_version == AIRPDCAP_WPA_KEY_VER_AES_CCMP){
 354                  /* AES */
 355                  key_len = pntohs(pEAPKey->key_data_len);
 356          }
 357      if (key_len > sizeof(RSN_IE) || key_len == 0) { /* Don't read past the end of pEAPKey->ie */
 358          return;
 359      }
 360   
 361          /* Encrypted key is in the information element field of the EAPOL key packet */
 362          szEncryptedKey = g_memdup(pEAPKey->ie, key_len);
 363   
 364          DEBUG_DUMP("Encrypted Broadcast key:", szEncryptedKey, key_len);
 365          DEBUG_DUMP("KeyIV:", pEAPKey->key_iv, 16);
 366          DEBUG_DUMP("decryption_key:", decryption_key, 16);
 367   
 368          /* Build the full decryption key based on the IV and part of the pairwise key */
 369          memcpy(new_key, pEAPKey->key_iv, 16);
 370          memcpy(new_key+16, decryption_key, 16);
 371          DEBUG_DUMP("FullDecrKey:", new_key, 32);
 372   
 373          if (key_version == AIRPDCAP_WPA_KEY_VER_NOT_CCMP){
 374                  guint8 dummy[256];
 375                  /* TKIP key */
 376                  /* Per 802.11i, Draft 3.0 spec, section 8.5.2, p. 97, line 4-8, */
 377                  /* group key is decrypted using RC4.  Concatenate the IV with the 16 byte EK (PTK+16) to get the decryption key */
 378   
 379                  rc4_state_struct rc4_state;
 380                  crypt_rc4_init(&rc4_state, new_key, sizeof(new_key));
 381   
 382                  /* Do dummy 256 iterations of the RC4 algorithm (per 802.11i, Draft 3.0, p. 97 line 6) */
 383[+]                 crypt_rc4(&rc4_state, dummy, 256);
expand/collapse

crypt_rc4

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/crypt/crypt-rc4.c)expand/collapse
Show more  
 72  void crypt_rc4(rc4_state_struct *rc4_state, unsigned char *data, int data_len)
 73  {
 74    unsigned char *s_box;
 75    unsigned char index_i;
 76    unsigned char index_j;
 77    int ind;
 78   
 79    /* retrieve current state from the state struct (so we can resume where
 80       we left off) */
 81    index_i = rc4_state->index_i;
 82    index_j = rc4_state->index_j;
 83    s_box = rc4_state->s_box;
 84   
 85    for( ind = 0; ind < data_len; ind++)
 86    {
 87      unsigned char tc;
 88      unsigned char t;
 89   
 90      index_i++;
 91      index_j += s_box[index_i];
 92   
 93      tc = s_box[index_i];
 94      s_box[index_i] = s_box[index_j];
 95      s_box[index_j] = tc;
 96   
 97      t = s_box[index_i] + s_box[index_j];
 98      data[ind] = data[ind] ^ s_box[t];
Show more  
Show more  




Change Warning 1097.29917 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: