(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ssl.c) |
| |
| 3856 | | | ssl_looks_like_valid_pct_handshake(tvbuff_t *tvb, guint32 offset, |
| 3857 | | | guint32 record_length) |
| 3858 | | | { |
| 3859 | | | |
| 3860 | | | |
| 3861 | | | |
| 3862 | | | |
| 3863 | | | |
| 3864 | | | |
| 3865 | | | |
| 3866 | | | |
| 3867 | | | |
| 3868 | | | |
| 3869 | | | guint8 msg_type; |
| 3870 | | | guint16 version; |
| 3871 | | | guint32 sum; |
| 3872 | | | gint ret = 0; |
| 3873 | | | |
| 3874 | | | |
| 3875 | | | msg_type = tvb_get_guint8(tvb, offset); |
| 3876 | | | |
| 3877 | | | switch (msg_type) { |
| 3878 | | | case PCT_MSG_CLIENT_HELLO: |
| 3879 | | | |
| 3880 | | | version = tvb_get_ntohs(tvb, offset+1); |
| 3881 | | | ret = (version == PCT_VERSION_1); |
Unused Value
The value assigned to ret is never subsequently used on any execution path. |
|
| 3882 | | | |
| 3883 | | | case PCT_MSG_SERVER_HELLO: |
| 3884 | | | |
| 3885 | | | version = tvb_get_ntohs(tvb, offset+2); |
| 3886 | | | ret = (version == PCT_VERSION_1); |
| 3887 | | | |
| 3888 | | | case PCT_MSG_CLIENT_MASTER_KEY: |
| 3889 | | | |
| 3890 | | | sum = tvb_get_ntohs(tvb, offset + 6); |
| 3891 | | | sum += tvb_get_ntohs(tvb, offset + 8); |
| 3892 | | | sum += tvb_get_ntohs(tvb, offset + 10); |
| 3893 | | | sum += tvb_get_ntohs(tvb, offset + 12); |
| 3894 | | | sum += tvb_get_ntohs(tvb, offset + 14); |
| 3895 | | | sum += tvb_get_ntohs(tvb, offset + 16); |
| 3896 | | | if (sum <= record_length) { |
| 3897 | | | ret = 1; |
| 3898 | | | } |
| 3899 | | | break; |
| 3900 | | | |
| 3901 | | | case PCT_MSG_SERVER_VERIFY: |
| 3902 | | | |
| 3903 | | | sum = tvb_get_ntohs(tvb, offset + 34); |
| 3904 | | | if ((sum + 36) == record_length) { |
| 3905 | | | ret = 1; |
| 3906 | | | } |
| 3907 | | | break; |
| 3908 | | | |
| 3909 | | | default: |
| 3910 | | | break; |
| 3911 | | | } |
| 3912 | | | |
| 3913 | | | return ret; |
| 3914 | | | } |
| |