summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2008-04-12 14:53:48 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2008-04-12 14:53:48 +0000
commit3098afe6ade2d9a1c4338e129e9f667f40533119 (patch)
tree81acf73dc3c6be86e698e057bb02f6215a074750
parent74766c736ad68c800f7d997f591dc29093d2cca0 (diff)
downloadwireshark-3098afe6ade2d9a1c4338e129e9f667f40533119.tar.gz
From Martin Peylo (bug 2245):
I'm providing a patch for the asn2wrs cmp.cnf file showing the types of the PKIBody and PKIStatus in the info column. svn path=/trunk/; revision=24935
-rw-r--r--asn1/pkixcmp/CMP.asn1
-rw-r--r--asn1/pkixcmp/cmp.cnf24
-rw-r--r--epan/dissectors/packet-cmp.c50
-rw-r--r--epan/dissectors/packet-cmp.h2
4 files changed, 69 insertions, 8 deletions
diff --git a/asn1/pkixcmp/CMP.asn b/asn1/pkixcmp/CMP.asn
index 79d16be9eb..94e80dde5e 100644
--- a/asn1/pkixcmp/CMP.asn
+++ b/asn1/pkixcmp/CMP.asn
@@ -147,6 +147,7 @@
cp [3] CertRepMessage, --Certification Response
-- p10cr [4] CertificationRequest,
--imported from [PKCS10]
+ p10cr [4] NULL, -- added for Wireshark to avoid miscounting of the branch_taken
popdecc [5] POPODecKeyChallContent, --pop Challenge
popdecr [6] POPODecKeyRespContent, --pop Response
kur [7] CertReqMessages, --Key Update Request
diff --git a/asn1/pkixcmp/cmp.cnf b/asn1/pkixcmp/cmp.cnf
index 5a1f1cc6c5..bf3ec93eb5 100644
--- a/asn1/pkixcmp/cmp.cnf
+++ b/asn1/pkixcmp/cmp.cnf
@@ -89,4 +89,28 @@ RevAnnContent/status pkistatus
#.FN_BODY InfoTypeAndValue/infoValue
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
+#.FN_PARS PKIBody
+ VAL_PTR = &branch_taken
+
+#.FN_BODY PKIBody
+ gint branch_taken;
+
+ %(DEFAULT_BODY)s
+
+ if (check_col(actx->pinfo->cinfo, COL_INFO)) {
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Body=%%s", val_to_str(branch_taken, cmp_PKIBody_vals, "unknown"));
+ }
+
+#.FN_PARS PKIStatus
+ VAL_PTR = &value
+
+#.FN_BODY PKIStatus
+ guint32 value;
+
+ %(DEFAULT_BODY)s
+
+ if (check_col(actx->pinfo->cinfo, COL_INFO)) {
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Status=%%s", val_to_str(value, cmp_PKIStatus_vals, "unknown"));
+ }
+
#.END_OF_CNF
diff --git a/epan/dissectors/packet-cmp.c b/epan/dissectors/packet-cmp.c
index 8119a5c1f2..414963a8c9 100644
--- a/epan/dissectors/packet-cmp.c
+++ b/epan/dissectors/packet-cmp.c
@@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-cmp.c */
-/* ../../tools/asn2wrs.py -b -p cmp -c cmp.cnf -s packet-cmp-template CMP.asn */
+/* ../../tools/asn2wrs.py -b -p cmp -c ./cmp.cnf -s ./packet-cmp-template -D . CMP.asn */
/* Input file: packet-cmp-template.c */
@@ -115,6 +115,7 @@ static int hf_cmp_ir = -1; /* CertReqMessages */
static int hf_cmp_ip = -1; /* CertRepMessage */
static int hf_cmp_cr = -1; /* CertReqMessages */
static int hf_cmp_cp = -1; /* CertRepMessage */
+static int hf_cmp_p10cr = -1; /* NULL */
static int hf_cmp_popdecc = -1; /* POPODecKeyChallContent */
static int hf_cmp_popdecr = -1; /* POPODecKeyRespContent */
static int hf_cmp_kur = -1; /* CertReqMessages */
@@ -334,7 +335,7 @@ static const value_string cmp_T_pvno_vals[] = {
static int
dissect_cmp_T_pvno(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
- NULL);
+ NULL);
return offset;
}
@@ -474,7 +475,7 @@ dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CMPCertificate(gboolean implicit_tag _U_, tvb
static int
dissect_cmp_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
- NULL);
+ NULL);
return offset;
}
@@ -494,8 +495,18 @@ const value_string cmp_PKIStatus_vals[] = {
int
dissect_cmp_PKIStatus(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
- NULL);
+#line 108 "cmp.cnf"
+ guint32 value;
+
+ offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
+ &value);
+
+
+ if (check_col(actx->pinfo->cinfo, COL_INFO)) {
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Status=%s", val_to_str(value, cmp_PKIStatus_vals, "unknown"));
+ }
+
+
return offset;
}
@@ -641,6 +652,15 @@ dissect_cmp_CertRepMessage(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
}
+
+static int
+dissect_cmp_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
+ offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
+
+ return offset;
+}
+
+
static const ber_sequence_t Challenge_sequence[] = {
{ &hf_cmp_owf , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_AlgorithmIdentifier },
{ &hf_cmp_witness , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cmp_OCTET_STRING },
@@ -1015,6 +1035,7 @@ const value_string cmp_PKIBody_vals[] = {
{ 1, "ip" },
{ 2, "cr" },
{ 3, "cp" },
+ { 4, "p10cr" },
{ 5, "popdecc" },
{ 6, "popdecr" },
{ 7, "kur" },
@@ -1045,6 +1066,7 @@ static const ber_choice_t PKIBody_choice[] = {
{ 1, &hf_cmp_ip , BER_CLASS_CON, 1, 0, dissect_cmp_CertRepMessage },
{ 2, &hf_cmp_cr , BER_CLASS_CON, 2, 0, dissect_crmf_CertReqMessages },
{ 3, &hf_cmp_cp , BER_CLASS_CON, 3, 0, dissect_cmp_CertRepMessage },
+ { 4, &hf_cmp_p10cr , BER_CLASS_CON, 4, 0, dissect_cmp_NULL },
{ 5, &hf_cmp_popdecc , BER_CLASS_CON, 5, 0, dissect_cmp_POPODecKeyChallContent },
{ 6, &hf_cmp_popdecr , BER_CLASS_CON, 6, 0, dissect_cmp_POPODecKeyRespContent },
{ 7, &hf_cmp_kur , BER_CLASS_CON, 7, 0, dissect_crmf_CertReqMessages },
@@ -1072,9 +1094,19 @@ static const ber_choice_t PKIBody_choice[] = {
int
dissect_cmp_PKIBody(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- offset = dissect_ber_choice(actx, tree, tvb, offset,
+#line 96 "cmp.cnf"
+ gint branch_taken;
+
+ offset = dissect_ber_choice(actx, tree, tvb, offset,
PKIBody_choice, hf_index, ett_cmp_PKIBody,
- NULL);
+ &branch_taken);
+
+
+ if (check_col(actx->pinfo->cinfo, COL_INFO)) {
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Body=%s", val_to_str(branch_taken, cmp_PKIBody_vals, "unknown"));
+ }
+
+
return offset;
}
@@ -1804,6 +1836,10 @@ void proto_register_cmp(void) {
{ "cp", "cmp.cp",
FT_NONE, BASE_NONE, NULL, 0,
"cmp.CertRepMessage", HFILL }},
+ { &hf_cmp_p10cr,
+ { "p10cr", "cmp.p10cr",
+ FT_NONE, BASE_NONE, NULL, 0,
+ "cmp.NULL", HFILL }},
{ &hf_cmp_popdecc,
{ "popdecc", "cmp.popdecc",
FT_UINT32, BASE_DEC, NULL, 0,
diff --git a/epan/dissectors/packet-cmp.h b/epan/dissectors/packet-cmp.h
index 5b90bf3742..e6b7356267 100644
--- a/epan/dissectors/packet-cmp.h
+++ b/epan/dissectors/packet-cmp.h
@@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-cmp.h */
-/* ../../tools/asn2wrs.py -b -p cmp -c cmp.cnf -s packet-cmp-template CMP.asn */
+/* ../../tools/asn2wrs.py -b -p cmp -c ./cmp.cnf -s ./packet-cmp-template -D . CMP.asn */
/* Input file: packet-cmp-template.h */