packet-gssapi: add gssapi_{header,trailer}_tvb

Change-Id: I3a9cebec0b8cb39eee99d23b3609241f106c045a
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/35708
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Stefan Metzmacher 2019-12-23 13:51:05 +01:00 committed by Gerald Combs
parent 6afa37bb1a
commit 1b97f84785
4 changed files with 17 additions and 14 deletions

View File

@ -1212,11 +1212,8 @@ static void
gssapi_tvb = tvb_new_subset_length_caplen(sasl_tvb, 4, tmp_length, sasl_len);
/* Attempt decryption of the GSSAPI wrapped data if possible */
gssapi_encrypt.gssapi_data_encrypted = FALSE;
memset(&gssapi_encrypt, 0, sizeof(gssapi_encrypt));
gssapi_encrypt.decrypt_gssapi_tvb=DECRYPT_GSSAPI_NORMAL;
gssapi_encrypt.gssapi_wrap_tvb=NULL;
gssapi_encrypt.gssapi_encrypted_tvb=NULL;
gssapi_encrypt.gssapi_decrypted_tvb=NULL;
ver_len = call_dissector_with_data(gssapi_wrap_handle, gssapi_tvb, pinfo, sasl_tree, &gssapi_encrypt);
/* if we could unwrap, do a tvb shuffle */
if(gssapi_encrypt.gssapi_decrypted_tvb){

View File

@ -670,12 +670,12 @@ wrap_dissect_gssapi_verf(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
tvbuff_t *
wrap_dissect_gssapi_payload(tvbuff_t *header_tvb _U_,
wrap_dissect_gssapi_payload(tvbuff_t *header_tvb,
tvbuff_t *payload_tvb,
tvbuff_t *trailer_tvb _U_,
tvbuff_t *trailer_tvb,
tvbuff_t *auth_tvb,
packet_info *pinfo,
dcerpc_auth_info *auth_info _U_)
dcerpc_auth_info *auth_info)
{
tvbuff_t *result;
gssapi_encrypt_info_t gssapi_encrypt;
@ -689,8 +689,15 @@ wrap_dissect_gssapi_payload(tvbuff_t *header_tvb _U_,
return NULL;
}
if (!auth_info->hdr_signing) {
header_tvb = NULL;
trailer_tvb = NULL;
}
gssapi_encrypt.decrypt_gssapi_tvb=DECRYPT_GSSAPI_DCE;
gssapi_encrypt.gssapi_header_tvb=header_tvb;
gssapi_encrypt.gssapi_encrypted_tvb=payload_tvb;
gssapi_encrypt.gssapi_trailer_tvb=trailer_tvb;
dissect_gssapi(auth_tvb, pinfo, NULL, &gssapi_encrypt);
result=gssapi_encrypt.gssapi_decrypted_tvb;

View File

@ -39,7 +39,9 @@ typedef struct _gssapi_encrypt_info
{
guint16 decrypt_gssapi_tvb;
tvbuff_t *gssapi_wrap_tvb;
tvbuff_t *gssapi_header_tvb;
tvbuff_t *gssapi_encrypted_tvb;
tvbuff_t *gssapi_trailer_tvb;
tvbuff_t *gssapi_decrypted_tvb;
gboolean gssapi_data_encrypted;
} gssapi_encrypt_info_t;

View File

@ -4122,11 +4122,8 @@ static void
gssapi_tvb = tvb_new_subset_length_caplen(sasl_tvb, 4, tmp_length, sasl_len);
/* Attempt decryption of the GSSAPI wrapped data if possible */
gssapi_encrypt.gssapi_data_encrypted = FALSE;
memset(&gssapi_encrypt, 0, sizeof(gssapi_encrypt));
gssapi_encrypt.decrypt_gssapi_tvb=DECRYPT_GSSAPI_NORMAL;
gssapi_encrypt.gssapi_wrap_tvb=NULL;
gssapi_encrypt.gssapi_encrypted_tvb=NULL;
gssapi_encrypt.gssapi_decrypted_tvb=NULL;
ver_len = call_dissector_with_data(gssapi_wrap_handle, gssapi_tvb, pinfo, sasl_tree, &gssapi_encrypt);
/* if we could unwrap, do a tvb shuffle */
if(gssapi_encrypt.gssapi_decrypted_tvb){
@ -5636,7 +5633,7 @@ void proto_register_ldap(void) {
NULL, HFILL }},
/*--- End of included file: packet-ldap-hfarr.c ---*/
#line 2161 "./asn1/ldap/packet-ldap-template.c"
#line 2158 "./asn1/ldap/packet-ldap-template.c"
};
/* List of subtrees */
@ -5710,7 +5707,7 @@ void proto_register_ldap(void) {
&ett_ldap_T_warning,
/*--- End of included file: packet-ldap-ettarr.c ---*/
#line 2175 "./asn1/ldap/packet-ldap-template.c"
#line 2172 "./asn1/ldap/packet-ldap-template.c"
};
/* UAT for header fields */
static uat_field_t custom_attribute_types_uat_fields[] = {
@ -5899,7 +5896,7 @@ proto_reg_handoff_ldap(void)
/*--- End of included file: packet-ldap-dis-tab.c ---*/
#line 2347 "./asn1/ldap/packet-ldap-template.c"
#line 2344 "./asn1/ldap/packet-ldap-template.c"
dissector_add_uint_range_with_preference("tcp.port", TCP_PORT_RANGE_LDAP, ldap_handle);
}