Text   |  XML   |  ReML   |   Visible Warnings:

Unused Value  at packet-ssl.c:3881

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

ssl_looks_like_valid_pct_handshake

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ssl.c)expand/collapse
Show more  
 3856  ssl_looks_like_valid_pct_handshake(tvbuff_t *tvb, guint32 offset,
 3857                     guint32 record_length)
 3858  {
 3859      /* first byte should be a msg_type.
 3860       *
 3861       *   - we know we only see client_hello, client_master_key,
 3862       *     and server_hello in the clear, so check to see if 
 3863       *     msg_type is one of those (this gives us a 3 in 2^8
 3864       *     chance of saying yes with random payload)
 3865       *
 3866       *   - for those three types that we know about, do some
 3867       *     further validation to reduce the chance of an error 
 3868       */
 3869      guint8 msg_type;
 3870      guint16 version;
 3871      guint32 sum;
 3872      gint ret = 0;
 3873   
 3874      /* fetch the msg_type */
 3875      msg_type = tvb_get_guint8(tvb, offset);
 3876   
 3877      switch (msg_type) {
 3878      case PCT_MSG_CLIENT_HELLO:
 3879          /* version follows msg byte, so verify that this is valid */
 3880          version = tvb_get_ntohs(tvb, offset+1);
 3881          ret = (version == PCT_VERSION_1);
 3882   
 3883      case PCT_MSG_SERVER_HELLO:
 3884          /* version is one byte after msg_type */
 3885          version = tvb_get_ntohs(tvb, offset+2);
 3886          ret = (version == PCT_VERSION_1);
 3887   
 3888      case PCT_MSG_CLIENT_MASTER_KEY:
 3889          /* sum of various length fields must be less than record length */
 3890          sum  = tvb_get_ntohs(tvb, offset + 6); /* clear_key_length */
 3891          sum += tvb_get_ntohs(tvb, offset + 8); /* encrypted_key_length */
 3892          sum += tvb_get_ntohs(tvb, offset + 10); /* key_arg_length */
 3893          sum += tvb_get_ntohs(tvb, offset + 12); /* verify_prelude_length */
 3894          sum += tvb_get_ntohs(tvb, offset + 14); /* client_cert_length */
 3895          sum += tvb_get_ntohs(tvb, offset + 16); /* response_length */
 3896          if (sum <= record_length) {
 3897              ret = 1;
 3898          }
 3899          break;
 3900   
 3901      case PCT_MSG_SERVER_VERIFY:
 3902          /* record is 36 bytes longer than response_length */
 3903          sum = tvb_get_ntohs(tvb, offset + 34); /* response_length */
 3904          if ((sum + 36) == record_length) {
 3905              ret = 1;
 3906          }
 3907          break;
 3908   
 3909      default:
 3910          break;
 3911      }
 3912   
 3913      return ret;
 3914  }
Show more  




Change Warning 3003.31291 : Unused Value

Priority:
State:
Finding:
Owner:
Note: