summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/x509af
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/asn1/x509af')
-rw-r--r--epan/dissectors/asn1/x509af/packet-x509af-template.c19
-rw-r--r--epan/dissectors/asn1/x509af/x509af.cnf24
2 files changed, 23 insertions, 20 deletions
diff --git a/epan/dissectors/asn1/x509af/packet-x509af-template.c b/epan/dissectors/asn1/x509af/packet-x509af-template.c
index 314007f2..ac46594a 100644
--- a/epan/dissectors/asn1/x509af/packet-x509af-template.c
+++ b/epan/dissectors/asn1/x509af/packet-x509af-template.c
@@ -15,6 +15,7 @@
#include <epan/oids.h>
#include <epan/asn1.h>
#include <epan/strutil.h>
+#include <wsutil/array.h>
#include "packet-ber.h"
#include "packet-x509af.h"
@@ -37,15 +38,15 @@ void proto_reg_handoff_x509af(void);
static dissector_handle_t pkix_crl_handle;
/* Initialize the protocol and registered fields */
-static int proto_x509af = -1;
-static int hf_x509af_algorithm_id = -1;
-static int hf_x509af_extension_id = -1;
+static int proto_x509af;
+static int hf_x509af_algorithm_id;
+static int hf_x509af_extension_id;
#include "packet-x509af-hf.c"
/* Initialize the subtree pointers */
-static gint ett_pkix_crl = -1;
+static int ett_pkix_crl;
#include "packet-x509af-ett.c"
-static const char *algorithm_id = NULL;
+static const char *algorithm_id;
static void
x509af_export_publickey(tvbuff_t *tvb, asn1_ctx_t *actx, int offset, int len);
#include "packet-x509af-fn.c"
@@ -59,7 +60,7 @@ x509af_export_publickey(tvbuff_t *tvb _U_, asn1_ctx_t *actx _U_, int offset _U_,
#if defined(HAVE_LIBGNUTLS)
gnutls_datum_t *subjectPublicKeyInfo = (gnutls_datum_t *)actx->private_data;
if (subjectPublicKeyInfo) {
- subjectPublicKeyInfo->data = (guchar *) tvb_get_ptr(tvb, offset, len);
+ subjectPublicKeyInfo->data = (unsigned char *) tvb_get_ptr(tvb, offset, len);
subjectPublicKeyInfo->size = len;
actx->private_data = NULL;
}
@@ -76,7 +77,7 @@ dissect_pkix_crl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
{
proto_tree *tree;
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);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIX-CRL");
@@ -85,7 +86,7 @@ dissect_pkix_crl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
tree=proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_pkix_crl, NULL, "Certificate Revocation List");
- return dissect_x509af_CertificateList(FALSE, tvb, 0, &asn1_ctx, tree, -1);
+ return dissect_x509af_CertificateList(false, tvb, 0, &asn1_ctx, tree, -1);
}
static void
@@ -111,7 +112,7 @@ void proto_register_x509af(void) {
};
/* List of subtrees */
- static gint *ett[] = {
+ static int *ett[] = {
&ett_pkix_crl,
#include "packet-x509af-ettarr.c"
};
diff --git a/epan/dissectors/asn1/x509af/x509af.cnf b/epan/dissectors/asn1/x509af/x509af.cnf
index 3061ed2c..0bda7a1f 100644
--- a/epan/dissectors/asn1/x509af/x509af.cnf
+++ b/epan/dissectors/asn1/x509af/x509af.cnf
@@ -5,6 +5,9 @@
#.IMPORT ../x509if/x509if-exp.cnf
#.IMPORT ../x509sat/x509sat-exp.cnf
+#.MODULE_EXPORTS EXTERN WS_DLL
+Certificate
+
#.MODULE_EXPORTS
EXTENSION
ACPathData
@@ -14,7 +17,6 @@ AttributeCertificate
AttributeCertificateAssertion
AttributeCertificateInfo
AttributeCertificationPath
-Certificate
Certificate_PDU
Certificates
CertificateList
@@ -100,25 +102,25 @@ CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate
tvbuff_t *bs_tvb = NULL;
# proto_tree *subtree;
- dissect_ber_bitstring(FALSE, actx, NULL, tvb, offset,
+ dissect_ber_bitstring(false, actx, NULL, tvb, offset,
NULL, 0, hf_index, -1, &bs_tvb);
/* See RFC 3279 for possible subjectPublicKey values given an Algorithm ID.
* The contents of subjectPublicKey are always explicitly tagged. */
if (bs_tvb && !g_strcmp0(algorithm_id, "1.2.840.113549.1.1.1")) { /* id-rsa */
- offset += dissect_pkcs1_RSAPublicKey(FALSE, bs_tvb, 0, actx, tree, hf_index);
+ offset += dissect_pkcs1_RSAPublicKey(false, bs_tvb, 0, actx, tree, hf_index);
# TODO: PKCS#1 only defines RSA; DH and DSA are from PKIX1Algorithms2008
# } else if (bs_tvb && !g_strcmp0(algorithm_id, "1.2.840.10040.4.1")) { /* id-dsa */
# subtree = proto_item_add_subtree(actx->created_item, ett_subjectpublickey);
-# offset += dissect_DSAPublicKey(FALSE, bs_tvb, 0, actx, subtree, hf_dsa_y);
+# offset += dissect_DSAPublicKey(false, bs_tvb, 0, actx, subtree, hf_dsa_y);
#
# } else if (bs_tvb && !g_strcmp0(algorithm_id, "1.2.840.10046.2.1")) { /* dhpublicnumber */
# subtree = proto_item_add_subtree(actx->created_item, ett_subjectpublickey);
-# offset += dissect_DHPublicKey(FALSE, bs_tvb, 0, actx, subtree, hf_dh_y);
+# offset += dissect_DHPublicKey(false, bs_tvb, 0, actx, subtree, hf_dh_y);
#
} else {
- offset = dissect_ber_bitstring(FALSE, actx, tree, tvb, offset,
+ offset = dissect_ber_bitstring(false, actx, tree, tvb, offset,
NULL, 0, hf_index, -1, NULL);
}
@@ -137,10 +139,10 @@ CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate
}
#.FN_BODY Extension/extnValue
- gint8 ber_class;
+ int8_t ber_class;
bool pc, ind;
- gint32 tag;
- guint32 len;
+ int32_t tag;
+ uint32_t len;
/* skip past the T and L */
offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind);
@@ -148,11 +150,11 @@ CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate
#.FN_BODY Time/utcTime
char *outstr, *newstr;
- guint32 tvblen;
+ uint32_t tvblen;
/* the 2-digit year can only be in the range 1950..2049 https://tools.ietf.org/html/rfc5280#section-4.1.2.5.1 */
offset = dissect_ber_UTCTime(implicit_tag, actx, tree, tvb, offset, hf_index, &outstr, &tvblen);
- if (hf_index >= 0 && outstr) {
+ if (hf_index > 0 && outstr) {
newstr = wmem_strconcat(actx->pinfo->pool, outstr[0] < '5' ? "20": "19", outstr, NULL);
proto_tree_add_string(tree, hf_index, tvb, offset - tvblen, tvblen, newstr);
}