diff options
author | Michael Mann <mmann78@netscape.net> | 2015-11-02 16:47:26 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-11-04 02:45:58 +0000 |
commit | 795b5c196303032e102189da80acd9d1f64ca8d7 (patch) | |
tree | b834e1aec2ad009a20a18d50459b2aef573b31d3 /asn1 | |
parent | 58431e2f6a939022261e1f54a9bf3e4fa39958ca (diff) |
Refactor some GSS-API dissectors to accept dissector data instead of using packet_info.
This can hopefully lead to the removal of the GSS-API specific members of the packet_info structure.
Change-Id: I7622d66e9f02c6e4cb76adcf0737b35c6ec88cdd
Reviewed-on: https://code.wireshark.org/review/11509
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/ldap/packet-ldap-template.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c index eff9506ff7..5c4e447802 100644 --- a/asn1/ldap/packet-ldap-template.c +++ b/asn1/ldap/packet-ldap-template.c @@ -104,6 +104,7 @@ #include "packet-ssl.h" #include "packet-ssl-utils.h" #include "packet-smb-common.h" +#include "packet-gssapi.h" #include "packet-ber.h" #include "packet-per.h" @@ -1213,6 +1214,7 @@ static void tvbuff_t *gssapi_tvb, *plain_tvb = NULL, *decr_tvb= NULL; int ver_len; int tmp_length; + gssapi_encrypt_info_t gssapi_encrypt; /* * This is GSS-API (using SPNEGO, but we should be done with @@ -1228,22 +1230,18 @@ static void gssapi_tvb = tvb_new_subset(sasl_tvb, 4, tmp_length, sasl_len); /* Attempt decryption of the GSSAPI wrapped data if possible */ - pinfo->decrypt_gssapi_tvb=DECRYPT_GSSAPI_NORMAL; - pinfo->gssapi_wrap_tvb=NULL; - pinfo->gssapi_encrypted_tvb=NULL; - pinfo->gssapi_decrypted_tvb=NULL; - ver_len = call_dissector(gssapi_wrap_handle, gssapi_tvb, pinfo, sasl_tree); + gssapi_encrypt.gssapi_data_encrypted = FALSE; + 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(pinfo->gssapi_decrypted_tvb){ - decr_tvb=pinfo->gssapi_decrypted_tvb; - } else if (pinfo->gssapi_wrap_tvb) { - plain_tvb=pinfo->gssapi_wrap_tvb; + if(gssapi_encrypt.gssapi_decrypted_tvb){ + decr_tvb=gssapi_encrypt.gssapi_decrypted_tvb; + } else if (gssapi_encrypt.gssapi_wrap_tvb) { + plain_tvb=gssapi_encrypt.gssapi_wrap_tvb; } - /* tidy up */ - pinfo->decrypt_gssapi_tvb=0; - pinfo->gssapi_wrap_tvb=NULL; - pinfo->gssapi_encrypted_tvb=NULL; - pinfo->gssapi_decrypted_tvb=NULL; /* * if len is 0 it probably mean that we got a PDU that is not @@ -1259,7 +1257,7 @@ static void * data; if not, just use the plaintext data. */ if (!decr_tvb && !plain_tvb) { - if(!pinfo->gssapi_data_encrypted){ + if(!gssapi_encrypt.gssapi_data_encrypted){ plain_tvb = tvb_new_subset_remaining(gssapi_tvb, ver_len); } } |