aboutsummaryrefslogtreecommitdiffstats
path: root/packet-radius.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-03-20 18:51:08 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-03-20 18:51:08 +0000
commit45765523adaccd1b5b6c0d0bb4519cff0d5563ad (patch)
tree0d48b5d0e3098c7281c6d0cc4bb37eb2579728c3 /packet-radius.c
parent94b8c14ec05036b51ddda929f630f6afea004c37 (diff)
Make a separate display type for the user password, rather than having
the code to handle RADIUS_STRING know that User Password has an AVP type value of 2. As only the User Password field has that display type, we don't have to check whether we're handling vendor-specific VSAs. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10422 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-radius.c')
-rw-r--r--packet-radius.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/packet-radius.c b/packet-radius.c
index deb9e55b20..e2c10f6705 100644
--- a/packet-radius.c
+++ b/packet-radius.c
@@ -6,7 +6,7 @@
*
* RFC 2865, RFC 2866, RFC 2867, RFC 2868, RFC 2869
*
- * $Id: packet-radius.c,v 1.97 2004/03/09 01:08:27 jmayer Exp $
+ * $Id: packet-radius.c,v 1.98 2004/03/20 18:51:08 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -144,6 +144,7 @@ typedef struct _rd_vsa_buffer {
enum {
RADIUS_STRING,
RADIUS_BINSTRING,
+ RADIUS_USERPASSWORD,
RADIUS_INTEGER4,
RADIUS_IP_ADDRESS,
RADIUS_IP6_ADDRESS,
@@ -485,7 +486,7 @@ static const value_string radius_nas_port_type_vals[] =
static const radius_attr_info radius_attrib[] =
{
{1, RADIUS_STRING, "User Name", NULL},
- {2, RADIUS_STRING, "User Password", NULL},
+ {2, RADIUS_USERPASSWORD, "User Password", NULL},
{3, RADIUS_BINSTRING, "CHAP Password", NULL},
{4, RADIUS_IP_ADDRESS, "NAS IP Address", NULL},
{5, RADIUS_INTEGER4, "NAS Port", NULL},
@@ -2415,18 +2416,17 @@ static void rd_value_to_str(gchar *dest, rd_vsa_buffer (*vsabuffer)[VSABUFFER],
switch(attr_info->value_type)
{
case( RADIUS_STRING ):
- /* User Password, but only, if not inside vsa */
- if ( avph->avp_type == 2 && (*vsabuffer)[0].str == 0 ) {
- rddecryptpass(cont,tvb,offset+2,avph->avp_length-2);
- } else {
- rdconvertbufftostr(cont,tvb,offset+2,avph->avp_length-2);
- }
+ rdconvertbufftostr(cont,tvb,offset+2,avph->avp_length-2);
break;
case( RADIUS_BINSTRING ):
rdconvertbufftobinstr(cont,tvb,offset+2,avph->avp_length-2);
break;
+ case( RADIUS_USERPASSWORD ):
+ rddecryptpass(cont,tvb,offset+2,avph->avp_length-2);
+ break;
+
case( RADIUS_INTEGER4 ):
intval = tvb_get_ntohl(tvb,offset+2);
if (attr_info->vs != NULL)