summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/cmp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
commita86c5f7cae7ec9a3398300555a0b644689d946a1 (patch)
tree39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/dissectors/asn1/cmp
parentReleasing progress-linux version 4.2.6-1~progress7.99u1. (diff)
downloadwireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz
wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/asn1/cmp')
-rw-r--r--epan/dissectors/asn1/cmp/cmp.cnf8
-rw-r--r--epan/dissectors/asn1/cmp/packet-cmp-template.c61
2 files changed, 35 insertions, 34 deletions
diff --git a/epan/dissectors/asn1/cmp/cmp.cnf b/epan/dissectors/asn1/cmp/cmp.cnf
index 05d3b5e4..fd135d67 100644
--- a/epan/dissectors/asn1/cmp/cmp.cnf
+++ b/epan/dissectors/asn1/cmp/cmp.cnf
@@ -59,20 +59,20 @@ RevRepContent/status ABBREV=rvrpcnt_status
VAL_PTR = &branch_taken
#.FN_BODY PKIBody
- gint branch_taken;
+ int branch_taken;
%(DEFAULT_BODY)s
- col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Body=%%s", val_to_str(branch_taken, cmp_PKIBody_vals, "unknown"));
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Body=%%s", val_to_str_const(branch_taken, cmp_PKIBody_vals, "unknown"));
#.FN_PARS PKIStatus
VAL_PTR = &value
#.FN_BODY PKIStatus
- guint32 value;
+ uint32_t value;
%(DEFAULT_BODY)s
- col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Status=%%s", val_to_str(value, cmp_PKIStatus_vals, "unknown"));
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Status=%%s", val_to_str_const(value, cmp_PKIStatus_vals, "unknown"));
#.END_OF_CNF
diff --git a/epan/dissectors/asn1/cmp/packet-cmp-template.c b/epan/dissectors/asn1/cmp/packet-cmp-template.c
index 888c01ff..fc32893d 100644
--- a/epan/dissectors/asn1/cmp/packet-cmp-template.c
+++ b/epan/dissectors/asn1/cmp/packet-cmp-template.c
@@ -19,6 +19,7 @@
#include <epan/oids.h>
#include <epan/asn1.h>
#include <epan/proto_data.h>
+#include <wsutil/array.h>
#include "packet-ber.h"
#include "packet-cmp.h"
#include "packet-crmf.h"
@@ -42,25 +43,25 @@ static dissector_handle_t cmp_tcp_style_http_handle;
static dissector_handle_t cmp_tcp_handle;
/* desegmentation of CMP over TCP */
-static gboolean cmp_desegment = TRUE;
+static bool cmp_desegment = true;
-static guint cmp_alternate_http_port = 0;
-static guint cmp_alternate_tcp_style_http_port = 0;
+static unsigned cmp_alternate_http_port;
+static unsigned cmp_alternate_tcp_style_http_port;
/* Initialize the protocol and registered fields */
-static int proto_cmp = -1;
-static int hf_cmp_type_oid = -1;
-static int hf_cmp_tcptrans_len = -1;
-static int hf_cmp_tcptrans_type = -1;
-static int hf_cmp_tcptrans_poll_ref = -1;
-static int hf_cmp_tcptrans_next_poll_ref = -1;
-static int hf_cmp_tcptrans_ttcb = -1;
-static int hf_cmp_tcptrans10_version = -1;
-static int hf_cmp_tcptrans10_flags = -1;
+static int proto_cmp;
+static int hf_cmp_type_oid;
+static int hf_cmp_tcptrans_len;
+static int hf_cmp_tcptrans_type;
+static int hf_cmp_tcptrans_poll_ref;
+static int hf_cmp_tcptrans_next_poll_ref;
+static int hf_cmp_tcptrans_ttcb;
+static int hf_cmp_tcptrans10_version;
+static int hf_cmp_tcptrans10_flags;
#include "packet-cmp-hf.c"
/* Initialize the subtree pointers */
-static gint ett_cmp = -1;
+static int ett_cmp;
#include "packet-cmp-ett.c"
#include "packet-cmp-fn.c"
@@ -68,9 +69,9 @@ static int
dissect_cmp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
asn1_ctx_t asn1_ctx;
- asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
+ asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
- return dissect_cmp_PKIMessage(FALSE, tvb, 0, &asn1_ctx, tree, -1);
+ return dissect_cmp_PKIMessage(false, tvb, 0, &asn1_ctx, tree, -1);
}
#define CMP_TYPE_PKIMSG 0
@@ -95,8 +96,8 @@ static const value_string cmp_pdu_types[] = {
static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
{
tvbuff_t *next_tvb;
- guint32 pdu_len;
- guint8 pdu_type;
+ uint32_t pdu_len;
+ uint8_t pdu_type;
proto_item *item=NULL;
proto_item *ti=NULL;
proto_tree *tree=NULL;
@@ -112,7 +113,7 @@ static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pa
}
pdu_len=tvb_get_ntohl(tvb, 0);
- pdu_type=tvb_get_guint8(tvb, 4);
+ pdu_type=tvb_get_uint8(tvb, 4);
if (pdu_type < 10) {
/* RFC2510 TCP transport */
@@ -124,7 +125,7 @@ static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pa
} else {
/* post RFC2510 TCP transport - the former "type" field is now "version" */
tcptrans_tree = proto_tree_add_subtree(tree, tvb, offset, 7, ett_cmp, NULL, "TCP transport");
- pdu_type=tvb_get_guint8(tvb, 6);
+ pdu_type=tvb_get_uint8(tvb, 6);
proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans_len, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans10_version, tvb, offset++, 1, ENC_BIG_ENDIAN);
@@ -177,10 +178,10 @@ static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pa
return offset;
}
-static guint get_cmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
+static unsigned get_cmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
int offset, void *data _U_)
{
- guint32 plen;
+ uint32_t plen;
/*
* Get the length of the CMP-over-TCP packet.
@@ -195,8 +196,8 @@ static guint get_cmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
static int
dissect_cmp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data)
{
- guint32 pdu_len;
- guint8 pdu_type;
+ uint32_t pdu_len;
+ uint8_t pdu_type;
int offset=4; /* RFC2510 TCP transport header length */
/* only attempt to dissect it as CMP over TCP if we have
@@ -207,11 +208,11 @@ dissect_cmp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void
}
pdu_len=tvb_get_ntohl(tvb, 0);
- pdu_type=tvb_get_guint8(tvb, 4);
+ pdu_type=tvb_get_uint8(tvb, 4);
if(pdu_type == 10) {
/* post RFC2510 TCP transport */
- pdu_type = tvb_get_guint8(tvb, 7);
+ pdu_type = tvb_get_uint8(tvb, 7);
offset = 7; /* post RFC2510 TCP transport header length */
/* arbitrary limit: assume a CMP over TCP pdu is never >10000 bytes
* in size.
@@ -308,7 +309,7 @@ void proto_register_cmp(void) {
};
/* List of subtrees */
- static gint *ett[] = {
+ static int *ett[] = {
&ett_cmp,
#include "packet-cmp-ettarr.c"
};
@@ -353,9 +354,9 @@ void proto_register_cmp(void) {
/*--- proto_reg_handoff_cmp -------------------------------------------*/
void proto_reg_handoff_cmp(void) {
- static gboolean inited = FALSE;
- static guint cmp_alternate_http_port_prev = 0;
- static guint cmp_alternate_tcp_style_http_port_prev = 0;
+ static bool inited = false;
+ static unsigned cmp_alternate_http_port_prev = 0;
+ static unsigned cmp_alternate_tcp_style_http_port_prev = 0;
if (!inited) {
dissector_add_string("media_type", "application/pkixcmp", cmp_http_handle);
@@ -375,7 +376,7 @@ void proto_reg_handoff_cmp(void) {
oid_add_from_string("HMAC RIPEMD-160","1.3.6.1.5.5.8.1.4");
#include "packet-cmp-dis-tab.c"
- inited = TRUE;
+ inited = true;
}
/* change alternate HTTP port if changed in the preferences */