Text   |  XML   |  ReML   |   Visible Warnings:

Unreasonable Size Argument  at packet-ntlmssp.c:1519

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

dissect_ntlmssp_encrypted_payload

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ntlmssp.c)expand/collapse
Show more  
 1444  static tvbuff_t *
 1445  dissect_ntlmssp_encrypted_payload(tvbuff_t *data_tvb,
 1446                                    tvbuff_t *auth_tvb _U_,
 1447                                    int offset,
 1448                                    packet_info *pinfo,
 1449                                    dcerpc_auth_info *auth_info _U_)
 1450  {
 1451    tvbuff_t *decr_tvb; /* Used to display decrypted buffer */
 1452    guint8 *peer_block;
 1453    conversation_t *conversation;
 1454    guint32 encrypted_block_length;
 1455    rc4_state_struct *rc4_state;
 1456    rc4_state_struct *rc4_state_peer;
 1457    ntlmssp_info *conv_ntlmssp_info = NULL;
 1458    ntlmssp_packet_info *packet_ntlmssp_info = NULL;
 1459   
 1460[+]   encrypted_block_length = tvb_length_remaining (data_tvb, offset);
 1461   
 1462    /* Check to see if we already have state for this packet */
 1463    packet_ntlmssp_info = p_get_proto_data(pinfo->fd, proto_ntlmssp);
 1464    if (packet_ntlmssp_info == NULL) {
 1465      /* We don't have any packet state, so create one */
 1466      packet_ntlmssp_info = se_alloc(sizeof(ntlmssp_packet_info));
 1467      memset(packet_ntlmssp_info, 0, sizeof(ntlmssp_packet_info));
 1468      p_add_proto_data(pinfo->fd, proto_ntlmssp, packet_ntlmssp_info);
 1469    }
 1470   
 1471    if (!packet_ntlmssp_info->payload_decrypted) {
 1472      /* Pull the challenge info from the conversation */
 1473      conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
 1474                                       pinfo->ptype, pinfo->srcport,
 1475[+]                                      pinfo->destport, 0);
 1476      if (conversation == NULL) {
 1477        /* There is no conversation, thus no encryption state */
 1478        return NULL;
 1479      }
 1480   
 1481      conv_ntlmssp_info = conversation_get_proto_data(conversation,
 1482[+]                                                     proto_ntlmssp);
 1483      if (conv_ntlmssp_info == NULL) {
 1484        /* There is no NTLMSSP state tied to the conversation */
 1485              return NULL;
 1486      }
 1487   
 1488      /* Get the pair of RC4 state structures.  One is used for to decrypt the
 1489         payload.  The other is used to re-encrypt the payload to represent
 1490         the peer */
 1491      if (conv_ntlmssp_info->peer1_dest_port == pinfo->destport) {
 1492        rc4_state = get_encrypted_state(pinfo, 1);
 1493        rc4_state_peer = get_encrypted_state(pinfo, 0);
 1494      } else {
 1495[+]       rc4_state = get_encrypted_state(pinfo, 0);
 1496[+]       rc4_state_peer = get_encrypted_state(pinfo, 1);
 1497      }
 1498   
 1499      if (rc4_state == NULL || rc4_state_peer == NULL) {
 1500        /* There is no encryption state, so we cannot decrypt */
 1501        return NULL;
 1502      }
 1503   
 1504      /* Store the decrypted contents in the packet state struct 
 1505         (of course at this point, they aren't decrypted yet) */
 1506      packet_ntlmssp_info->decrypted_payload = tvb_memdup(data_tvb, offset,
 1507                                                          encrypted_block_length);
 1508      decrypted_payloads = g_slist_prepend(decrypted_payloads,
 1509                                           packet_ntlmssp_info->decrypted_payload);
 1510   
 1511      /* Do the decryption of the payload */
 1512      crypt_rc4(rc4_state, packet_ntlmssp_info->decrypted_payload,
 1513                encrypted_block_length);
 1514   
 1515      /* We setup a temporary buffer so we can re-encrypt the payload after 
 1516         decryption.  This is to update the opposite peer's RC4 state */
 1517      peer_block = g_malloc(encrypted_block_length);
 1518      memcpy(peer_block, packet_ntlmssp_info->decrypted_payload,
 1519             encrypted_block_length);
Show more  




Change Warning 2872.30864 : Unreasonable Size Argument

Priority:
State:
Finding:
Owner:
Note: