diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
commit | a86c5f7cae7ec9a3398300555a0b644689d946a1 (patch) | |
tree | 39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/dissectors/asn1/credssp | |
parent | Releasing progress-linux version 4.2.6-1~progress7.99u1. (diff) | |
download | wireshark-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/credssp')
-rw-r--r-- | epan/dissectors/asn1/credssp/credssp.cnf | 10 | ||||
-rw-r--r-- | epan/dissectors/asn1/credssp/packet-credssp-template.c | 55 |
2 files changed, 33 insertions, 32 deletions
diff --git a/epan/dissectors/asn1/credssp/credssp.cnf b/epan/dissectors/asn1/credssp/credssp.cnf index a55b1507..3a90e73c 100644 --- a/epan/dissectors/asn1/credssp/credssp.cnf +++ b/epan/dissectors/asn1/credssp/credssp.cnf @@ -19,7 +19,7 @@ TSRequest decr_tvb = gssapi_encrypt.gssapi_decrypted_tvb; if(decr_tvb != NULL) - dissect_credssp_TSCredentials(FALSE, decr_tvb, 0, actx, tree, hf_credssp_TSCredentials); + dissect_credssp_TSCredentials(false, decr_tvb, 0, actx, tree, hf_credssp_TSCredentials); #.FN_BODY TSRequest/pubKeyAuth VAL_PTR = &auth_tvb tvbuff_t *auth_tvb = NULL; @@ -64,13 +64,13 @@ TSRequest switch(creds_type) { case TS_PASSWORD_CREDS: - dissect_credssp_TSPasswordCreds(FALSE, creds_tvb, 0, actx, tree, hf_credssp_TSPasswordCreds); + dissect_credssp_TSPasswordCreds(false, creds_tvb, 0, actx, tree, hf_credssp_TSPasswordCreds); break; case TS_SMARTCARD_CREDS: - dissect_credssp_TSSmartCardCreds(FALSE, creds_tvb, 0, actx, tree, hf_credssp_TSSmartCardCreds); + dissect_credssp_TSSmartCardCreds(false, creds_tvb, 0, actx, tree, hf_credssp_TSSmartCardCreds); break; case TS_REMOTEGUARD_CREDS: - dissect_credssp_TSRemoteGuardCreds(FALSE, creds_tvb, 0, actx, tree, hf_credssp_TSRemoteGuardCreds); + dissect_credssp_TSRemoteGuardCreds(false, creds_tvb, 0, actx, tree, hf_credssp_TSRemoteGuardCreds); break; } @@ -95,7 +95,7 @@ TSRemoteGuardPackageCred/packageName TYPE = FT_STRING DISPLAY = BASE_NONE STRING offset = dissect_ber_octet_string(implicit_tag, actx, NULL, tvb, offset, hf_index, &pname); if(pname != NULL) { - gint nlen = tvb_captured_length(pname); + int nlen = tvb_captured_length(pname); if (nlen == sizeof(kerberos_pname) && memcmp(tvb_get_ptr(pname, 0, nlen), kerberos_pname, nlen) == 0) { credssp_TS_RGC_package = TS_RGC_KERBEROS; diff --git a/epan/dissectors/asn1/credssp/packet-credssp-template.c b/epan/dissectors/asn1/credssp/packet-credssp-template.c index 5eef5741..0100c8ce 100644 --- a/epan/dissectors/asn1/credssp/packet-credssp-template.c +++ b/epan/dissectors/asn1/credssp/packet-credssp-template.c @@ -15,6 +15,7 @@ #include <epan/asn1.h> #include <epan/tap.h> #include <epan/exported_pdu.h> +#include <wsutil/array.h> #include "packet-ber.h" #include "packet-gssapi.h" @@ -30,8 +31,8 @@ #define TS_SMARTCARD_CREDS 2 #define TS_REMOTEGUARD_CREDS 6 -static gint creds_type; -static gint credssp_ver; +static int creds_type; +static int credssp_ver; static char kerberos_pname[] = "K\0e\0r\0b\0e\0r\0o\0s"; static char ntlm_pname[] = "N\0T\0L\0M"; @@ -40,12 +41,12 @@ static char ntlm_pname[] = "N\0T\0L\0M"; #define TS_RGC_KERBEROS 1 #define TS_RGC_NTLM 2 -static gint credssp_TS_RGC_package; +static int credssp_TS_RGC_package; -static gint exported_pdu_tap = -1; +static int exported_pdu_tap = -1; /* Initialize the protocol and registered fields */ -static int proto_credssp = -1; +static int proto_credssp; /* List of dissectors to call for negoToken data */ static heur_dissector_list_t credssp_heur_subdissector_list; @@ -53,16 +54,16 @@ static heur_dissector_list_t credssp_heur_subdissector_list; static dissector_handle_t gssapi_handle; static dissector_handle_t gssapi_wrap_handle; -static int hf_credssp_TSPasswordCreds = -1; /* TSPasswordCreds */ -static int hf_credssp_TSSmartCardCreds = -1; /* TSSmartCardCreds */ -static int hf_credssp_TSRemoteGuardCreds = -1;/* TSRemoteGuardCreds */ -static int hf_credssp_TSCredentials = -1; /* TSCredentials */ -static int hf_credssp_decr_PublicKeyAuth = -1;/* decr_PublicKeyAuth */ +static int hf_credssp_TSPasswordCreds; /* TSPasswordCreds */ +static int hf_credssp_TSSmartCardCreds; /* TSSmartCardCreds */ +static int hf_credssp_TSRemoteGuardCreds;/* TSRemoteGuardCreds */ +static int hf_credssp_TSCredentials; /* TSCredentials */ +static int hf_credssp_decr_PublicKeyAuth;/* decr_PublicKeyAuth */ #include "packet-credssp-hf.c" /* Initialize the subtree pointers */ -static gint ett_credssp = -1; -static gint ett_credssp_RGC_CredBuffer = -1; +static int ett_credssp; +static int ett_credssp_RGC_CredBuffer; #include "packet-credssp-ett.c" @@ -90,23 +91,23 @@ dissect_credssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void return dissect_TSRequest_PDU(tvb, pinfo, tree, data); } -static gboolean -dissect_credssp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_) +static bool +dissect_credssp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data) { asn1_ctx_t asn1_ctx; int offset = 0; - gint8 ber_class; + int8_t ber_class; bool pc; - gint32 tag; - guint32 length; - gint8 ver; + int32_t tag; + uint32_t length; + int8_t ver; - asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo); /* Look for SEQUENCE, CONTEXT 0, and INTEGER 2 */ if(tvb_captured_length(tvb) > 7) { offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag); - if((ber_class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_SEQUENCE) && (pc == TRUE)) { + if((ber_class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_SEQUENCE) && (pc == true)) { offset = get_ber_length(tvb, offset, NULL, NULL); offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag); if((ber_class == BER_CLASS_CON) && (tag == 0)) { @@ -114,7 +115,7 @@ dissect_credssp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag); if((ber_class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_INTEGER)) { offset = get_ber_length(tvb, offset, &length, NULL); - ver = tvb_get_guint8(tvb, offset); + ver = tvb_get_uint8(tvb, offset); if((length == 1) && (ver > 1) && (ver < 99)) { if (have_tap_listener(exported_pdu_tap)) { exp_pdu_data_t *exp_pdu_data = export_pdu_create_common_tags(pinfo, "credssp", EXP_PDU_TAG_DISSECTOR_NAME); @@ -125,14 +126,14 @@ dissect_credssp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, tap_queue_packet(exported_pdu_tap, pinfo, exp_pdu_data); } - dissect_credssp(tvb, pinfo, parent_tree, NULL); - return TRUE; + dissect_credssp(tvb, pinfo, parent_tree, data); + return true; } } } } } - return FALSE; + return false; } @@ -166,7 +167,7 @@ void proto_register_credssp(void) { }; /* List of subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_credssp, &ett_credssp_RGC_CredBuffer, #include "packet-credssp-ettarr.c" @@ -181,8 +182,8 @@ void proto_register_credssp(void) { proto_register_field_array(proto_credssp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - /* heuristic dissectors for any premable e.g. CredSSP before RDP */ - credssp_heur_subdissector_list = register_heur_dissector_list("credssp", proto_credssp); + /* heuristic dissectors for any preamble e.g. CredSSP before RDP */ + credssp_heur_subdissector_list = register_heur_dissector_list_with_description("credssp", "Unused", proto_credssp); } |