summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-03-20 06:06:39 +0000
committerGuy Harris <guy@alum.mit.edu>2004-03-20 06:06:39 +0000
commitf44c2756783ed2c355f6fb05b0a9737710a76476 (patch)
tree53cbed71c5aa33fe2fabfee83be8866708346244
parent856d3816db60b3957fde67cda9cfb06bffaac1de (diff)
downloadwireshark-f44c2756783ed2c355f6fb05b0a9737710a76476.tar.gz
From Ronnie Sahlberg: Windows XP SP1 appears to send the OS and LANMAN
fields over the wire in ASCII in SessionSetupandX messages even though the "Unicode strings" flag is set. svn path=/trunk/; revision=10413
-rw-r--r--packet-smb.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/packet-smb.c b/packet-smb.c
index d024578707..d8ae524503 100644
--- a/packet-smb.c
+++ b/packet-smb.c
@@ -3,7 +3,7 @@
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
* 2001 Rewrite by Ronnie Sahlberg and Guy Harris
*
- * $Id: packet-smb.c,v 1.387 2004/03/01 08:34:34 sahlberg Exp $
+ * $Id: packet-smb.c,v 1.388 2004/03/20 06:06:39 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -5729,6 +5729,7 @@ dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
guint16 pwlen=0;
guint16 sbloblen=0;
guint16 apwlen=0, upwlen=0;
+ gboolean unicodeflag;
WORD_COUNT;
@@ -5864,9 +5865,20 @@ dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
COUNT_BYTES(sbloblen);
}
- /* OS */
+ /* OS
+ * Eventhough this field should honour the unicode flag
+ * some ms clients gets this wrong.
+ * At least XP SP1 sends this in ASCII
+ * even when the unicode flag is on.
+ * Test if the first three bytes are "Win"
+ * and if so just override the flag.
+ */
+ unicodeflag=si->unicode;
+ if( !strncmp(tvb_get_ptr(tvb, offset, 3), "Win", 3) ){
+ unicodeflag=FALSE;
+ }
an = get_unicode_or_ascii_string(tvb, &offset,
- si->unicode, &an_len, FALSE, FALSE, &bc);
+ unicodeflag, &an_len, FALSE, FALSE, &bc);
if (an == NULL)
goto endofcommand;
proto_tree_add_string(tree, hf_smb_os, tvb,
@@ -5879,9 +5891,20 @@ dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
* appear to. I suspect that's a bug that got fixed; I also
* suspect that, in practice, nobody ever looks at that field
* because the bug didn't appear to get fixed until NT 5.0....
+ *
+ * Eventhough this field should honour the unicode flag
+ * some ms clients gets this wrong.
+ * At least XP SP1 sends this in ASCII
+ * even when the unicode flag is on.
+ * Test if the first three bytes are "Win"
+ * and if so just override the flag.
*/
+ unicodeflag=si->unicode;
+ if( !strncmp(tvb_get_ptr(tvb, offset, 3), "Win", 3) ){
+ unicodeflag=FALSE;
+ }
an = get_unicode_or_ascii_string(tvb, &offset,
- si->unicode, &an_len, FALSE, FALSE, &bc);
+ unicodeflag, &an_len, FALSE, FALSE, &bc);
if (an == NULL)
goto endofcommand;
proto_tree_add_string(tree, hf_smb_lanman, tvb,