diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-05-10 01:54:33 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-05-10 01:54:33 +0000 |
commit | b50b6a5b0b5fd8d98d992de34023740d2328d715 (patch) | |
tree | d703d4b5939ae623f133858f676825dbc4b65c5a /epan/dissectors/packet-radius.c | |
parent | 359961a2efd18feb636c6ed8e08d93009f02caab (diff) |
Don't create alternative fields for the encrypted value of a string
attribute unless the attribute is encrypted.
svn path=/trunk/; revision=42535
Diffstat (limited to 'epan/dissectors/packet-radius.c')
-rw-r--r-- | epan/dissectors/packet-radius.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c index bb3d37f3a5..f475ecff5b 100644 --- a/epan/dissectors/packet-radius.c +++ b/epan/dissectors/packet-radius.c @@ -1744,13 +1744,19 @@ static void register_attrs(gpointer k _U_, gpointer v, gpointer p) { hfri[0].hfinfo.type = FT_STRING; hfri[0].hfinfo.display = BASE_NONE; - hfri[2].p_id = &(a->hf_alt); - hfri[2].hfinfo.name = g_strdup_printf("%s (encrypted)", a->name); - hfri[2].hfinfo.abbrev = g_strdup_printf("%s_encrypted", abbrev); - hfri[2].hfinfo.type = FT_BYTES; - hfri[2].hfinfo.display = BASE_NONE; + if (a->encrypt != 0) { + /* + * This attribute is encrypted, so create an + * alternative field for the encrypted value. + */ + hfri[2].p_id = &(a->hf_alt); + hfri[2].hfinfo.name = g_strdup_printf("%s (encrypted)", a->name); + hfri[2].hfinfo.abbrev = g_strdup_printf("%s_encrypted", abbrev); + hfri[2].hfinfo.type = FT_BYTES; + hfri[2].hfinfo.display = BASE_NONE; - len_hf++; + len_hf++; + } } else if (a->type == radius_octets) { hfri[0].hfinfo.type = FT_BYTES; hfri[0].hfinfo.display = BASE_NONE; |