aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-09-15 18:46:36 +0200
committerMichael Mann <mmann78@netscape.net>2015-09-15 22:51:18 +0000
commitbec65ab1ac33ddf7e7694dfe361f4e55ae5c1dc7 (patch)
tree0eb2f576ab643787a80db821a32abcf5bd9fc0d9
parent0472d1ecadf3577c6a7f880f785f94c7006e8c34 (diff)
x509,ber: fix header field of large integers
In the past large integers would be displayed as text, later on this was changed into a "proper" header field. In most cases you do not want to see "ber.64bit_uint_as_bytes" though, but the original field name. This patch allows fields that are marked as FT_BYTES to be displayed with their original header field details (name, description, etc.). Change-Id: I4ab1a4cce649a225c73298fbf4dcf1692c693a03 Reviewed-on: https://code.wireshark.org/review/10539 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--asn1/x509af/x509af.cnf3
-rw-r--r--epan/dissectors/packet-ber.c8
-rw-r--r--epan/dissectors/packet-x509af.c6
3 files changed, 12 insertions, 5 deletions
diff --git a/asn1/x509af/x509af.cnf b/asn1/x509af/x509af.cnf
index e0e6a82166..de4d171348 100644
--- a/asn1/x509af/x509af.cnf
+++ b/asn1/x509af/x509af.cnf
@@ -115,6 +115,9 @@ CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate
#.TYPE_ATTR
CertificateSerialNumber TYPE = FT_INT64
+DSS-Params/p TYPE = FT_BYTES DISPLAY = BASE_NONE
+DSS-Params/q TYPE = FT_BYTES DISPLAY = BASE_NONE
+DSS-Params/g TYPE = FT_BYTES DISPLAY = BASE_NONE
#.FN_PARS CertificateSerialNumber FN_VARIANT = 64
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index eeff690f73..9f286c39c6 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -1892,8 +1892,12 @@ printf("INTEGERnew dissect_ber_integer(%s) entered implicit_tag:%d \n", name, im
if (hf_id >= 0) {
header_field_info *hfinfo = proto_registrar_get_nth(hf_id);
- proto_tree_add_bytes_format(tree, hf_ber_64bit_uint_as_bytes, tvb, offset, len, NULL,
- "%s : 0x%s", hfinfo->name, tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, len));
+ /* use the original field only if it is suitable for bytes */
+ if (hfinfo->type != FT_BYTES)
+ hf_id = hf_ber_64bit_uint_as_bytes;
+
+ proto_tree_add_bytes_format(tree, hf_id, tvb, offset, len, NULL,
+ "%s: 0x%s", hfinfo->name, tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, len));
}
offset += len;
diff --git a/epan/dissectors/packet-x509af.c b/epan/dissectors/packet-x509af.c
index e3cabe6295..3e261ae79e 100644
--- a/epan/dissectors/packet-x509af.c
+++ b/epan/dissectors/packet-x509af.c
@@ -1222,15 +1222,15 @@ void proto_register_x509af(void) {
NULL, HFILL }},
{ &hf_x509af_p,
{ "p", "x509af.p",
- FT_INT32, BASE_DEC, NULL, 0,
+ FT_BYTES, BASE_NONE, NULL, 0,
"INTEGER", HFILL }},
{ &hf_x509af_q,
{ "q", "x509af.q",
- FT_INT32, BASE_DEC, NULL, 0,
+ FT_BYTES, BASE_NONE, NULL, 0,
"INTEGER", HFILL }},
{ &hf_x509af_g,
{ "g", "x509af.g",
- FT_INT32, BASE_DEC, NULL, 0,
+ FT_BYTES, BASE_NONE, NULL, 0,
"INTEGER", HFILL }},
/*--- End of included file: packet-x509af-hfarr.c ---*/