diff options
author | Dario Lombardo <lomato@gmail.com> | 2020-03-22 23:55:31 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2020-03-23 14:53:51 +0000 |
commit | c6ea36d9811f21be2979bed133d4283d8fa25f82 (patch) | |
tree | 0b4b4f18fc6bc7b0b9674cc8213a0785ee3fb68a | |
parent | 3f92e4173b082c4ff8133e0c762f1464bf77e679 (diff) |
kerberos: fix compilation when kerberos is unavailable.
Small indentation fixes.
Change-Id: I62ba59f71dd530f82b5f0982fc0600737c5778c0
Reviewed-on: https://code.wireshark.org/review/36547
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/asn1/kerberos/kerberos.cnf | 1 | ||||
-rw-r--r-- | epan/dissectors/asn1/kerberos/packet-kerberos-template.c | 55 | ||||
-rw-r--r-- | epan/dissectors/packet-kerberos.c | 158 |
3 files changed, 135 insertions, 79 deletions
diff --git a/epan/dissectors/asn1/kerberos/kerberos.cnf b/epan/dissectors/asn1/kerberos/kerberos.cnf index d6d7e179b4..7d9a22fcd3 100644 --- a/epan/dissectors/asn1/kerberos/kerberos.cnf +++ b/epan/dissectors/asn1/kerberos/kerberos.cnf @@ -41,6 +41,7 @@ Krb5int32 Krb5uint32 PA-ClientCanonicalized PA-ClientCanonicalizedNames +PA-ENC-TS-ENC PA-ENC-SAM-RESPONSE-ENC PA-SAM-CHALLENGE-2 PA-SAM-CHALLENGE-2-BODY diff --git a/epan/dissectors/asn1/kerberos/packet-kerberos-template.c b/epan/dissectors/asn1/kerberos/packet-kerberos-template.c index a53f1c3f62..f52f9f4cb5 100644 --- a/epan/dissectors/asn1/kerberos/packet-kerberos-template.c +++ b/epan/dissectors/asn1/kerberos/packet-kerberos-template.c @@ -19,7 +19,7 @@ * * and * - * https://tools.ietf.org/html/draft-ietf-krb-wg-kerberos-referrals-05 + * https://tools.ietf.org/html/draft-ietf-krb-wg-kerberos-referrals-05 * * Some structures from RFC2630 * @@ -107,7 +107,9 @@ static dissector_handle_t kerberos_handle_udp; static int dissect_kerberos_Applications(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_AuthorizationData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_PA_ENC_TIMESTAMP(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); +#ifdef HAVE_KERBEROS static int dissect_kerberos_PA_ENC_TS_ENC(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); +#endif static int dissect_kerberos_PA_PAC_REQUEST(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_PA_S4U2Self(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_PA_S4U_X509_USER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); @@ -195,6 +197,10 @@ static gint hf_krb_pa_supported_enctypes_resource_sid_compression_disabled = -1; static gint hf_krb_ad_ap_options = -1; static gint hf_krb_ad_ap_options_cbt = -1; static gint hf_krb_ad_target_principal = -1; +#ifdef HAVE_KERBEROS +static gint hf_krb_patimestamp = -1; +static gint hf_krb_pausec = -1; +#endif #include "packet-kerberos-hf.c" /* Initialize the subtree pointers */ @@ -212,6 +218,9 @@ static gint ett_krb_pac_privsvr_checksum = -1; static gint ett_krb_pac_client_info_type = -1; static gint ett_krb_pa_supported_enctypes = -1; static gint ett_krb_ad_ap_options = -1; +#ifdef HAVE_KERBEROS +static gint ett_krb_pa_enc_ts_enc = -1; +#endif #include "packet-kerberos-ett.c" static expert_field ei_kerberos_decrypted_keytype = EI_INIT; @@ -2158,13 +2167,15 @@ dissect_krb5_PAC_CREDENTIAL_INFO(proto_tree *parent_tree, tvbuff_t *tvb, int off { proto_item *item; proto_tree *tree; - guint32 etype; guint8 *plaintext = NULL; int plainlen = 0; - int length; - tvbuff_t *next_tvb; + int length = 0; #define KRB5_KU_OTHER_ENCRYPTED 16 +#ifdef HAVE_KERBEROS + guint32 etype; + tvbuff_t *next_tvb; int usage = KRB5_KU_OTHER_ENCRYPTED; +#endif item = proto_tree_add_item(parent_tree, hf_krb_pac_credential_info, tvb, offset, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_krb_pac_credential_info); @@ -2174,17 +2185,21 @@ dissect_krb5_PAC_CREDENTIAL_INFO(proto_tree *parent_tree, tvbuff_t *tvb, int off offset, 4, ENC_LITTLE_ENDIAN); offset+=4; +#ifdef HAVE_KERBEROS /* etype */ etype = tvb_get_letohl(tvb, offset); +#endif proto_tree_add_item(tree, hf_krb_pac_credential_info_etype, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; +#ifdef HAVE_KERBEROS /* data */ next_tvb=tvb_new_subset_remaining(tvb, offset); length=tvb_captured_length_remaining(tvb, offset); plaintext=decrypt_krb5_data(tree, actx->pinfo, usage, next_tvb, (int)etype, &plainlen); +#endif if (plaintext != NULL) { tvbuff_t *child_tvb; @@ -2452,6 +2467,21 @@ dissect_krb5_AD_WIN2K_PAC(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, #include "packet-kerberos-fn.c" +#ifdef HAVE_KERBEROS +static const ber_sequence_t PA_ENC_TS_ENC_sequence[] = { + { &hf_krb_patimestamp, BER_CLASS_CON, 0, 0, dissect_kerberos_KerberosTime }, + { &hf_krb_pausec , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_kerberos_Microseconds }, + { NULL, 0, 0, 0, NULL } +}; + +static int +dissect_kerberos_PA_ENC_TS_ENC(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, + PA_ENC_TS_ENC_sequence, hf_index, ett_krb_pa_enc_ts_enc); + return offset; +} +#endif + /* Make wrappers around exported functions for now */ int dissect_krb5_Checksum(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) @@ -2893,9 +2923,17 @@ void proto_register_kerberos(void) { { &hf_krb_ad_ap_options_cbt, { "ChannelBindings", "kerberos.ad_ap_options.cbt", FT_BOOLEAN, 32, TFS(&set_tfs), 0x00004000, NULL, HFILL }}, - { &hf_krb_ad_target_principal, { - "Target Principal", "kerberos.ad_target_principal", FT_STRING, BASE_NONE, - NULL, 0, NULL, HFILL }}, + { &hf_krb_ad_target_principal, + { "Target Principal", "kerberos.ad_target_principal", + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, +#ifdef HAVE_KERBEROS + { &hf_krb_patimestamp, + { "patimestamp", "kerberos.patimestamp", + FT_STRING, BASE_NONE, NULL, 0, "KerberosTime", HFILL }}, + { &hf_krb_pausec, + { "pausec", "kerberos.pausec", + FT_UINT32, BASE_DEC, NULL, 0, "Microseconds", HFILL }}, +#endif #include "packet-kerberos-hfarr.c" }; @@ -2916,6 +2954,9 @@ void proto_register_kerberos(void) { &ett_krb_pac_client_info_type, &ett_krb_pa_supported_enctypes, &ett_krb_ad_ap_options, +#ifdef HAVE_KERBEROS + &ett_krb_pa_enc_ts_enc, +#endif #include "packet-kerberos-ettarr.c" }; diff --git a/epan/dissectors/packet-kerberos.c b/epan/dissectors/packet-kerberos.c index e399c7c531..51c9ba42ea 100644 --- a/epan/dissectors/packet-kerberos.c +++ b/epan/dissectors/packet-kerberos.c @@ -27,7 +27,7 @@ * * and * - * https://tools.ietf.org/html/draft-ietf-krb-wg-kerberos-referrals-05 + * https://tools.ietf.org/html/draft-ietf-krb-wg-kerberos-referrals-05 * * Some structures from RFC2630 * @@ -115,7 +115,9 @@ static dissector_handle_t kerberos_handle_udp; static int dissect_kerberos_Applications(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_AuthorizationData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_PA_ENC_TIMESTAMP(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); +#ifdef HAVE_KERBEROS static int dissect_kerberos_PA_ENC_TS_ENC(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); +#endif static int dissect_kerberos_PA_PAC_REQUEST(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_PA_S4U2Self(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_PA_S4U_X509_USER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); @@ -203,6 +205,10 @@ static gint hf_krb_pa_supported_enctypes_resource_sid_compression_disabled = -1; static gint hf_krb_ad_ap_options = -1; static gint hf_krb_ad_ap_options_cbt = -1; static gint hf_krb_ad_target_principal = -1; +#ifdef HAVE_KERBEROS +static gint hf_krb_patimestamp = -1; +static gint hf_krb_pausec = -1; +#endif /*--- Included file: packet-kerberos-hf.c ---*/ #line 1 "./asn1/kerberos/packet-kerberos-hf.c" @@ -326,8 +332,6 @@ static int hf_kerberos_e_data = -1; /* T_e_data */ static int hf_kerberos_e_checksum = -1; /* Checksum */ static int hf_kerberos_METHOD_DATA_item = -1; /* PA_DATA */ static int hf_kerberos_pA_ENC_TIMESTAMP_cipher = -1; /* T_pA_ENC_TIMESTAMP_cipher */ -static int hf_kerberos_patimestamp = -1; /* KerberosTime */ -static int hf_kerberos_pausec = -1; /* Microseconds */ static int hf_kerberos_info_salt = -1; /* OCTET_STRING */ static int hf_kerberos_ETYPE_INFO_item = -1; /* ETYPE_INFO_ENTRY */ static int hf_kerberos_info2_salt = -1; /* KerberosString */ @@ -418,7 +422,7 @@ static int hf_kerberos_PAC_OPTIONS_FLAGS_forward_to_full_dc = -1; static int hf_kerberos_PAC_OPTIONS_FLAGS_resource_based_constrained_delegation = -1; /*--- End of included file: packet-kerberos-hf.c ---*/ -#line 199 "./asn1/kerberos/packet-kerberos-template.c" +#line 205 "./asn1/kerberos/packet-kerberos-template.c" /* Initialize the subtree pointers */ static gint ett_kerberos = -1; @@ -435,6 +439,9 @@ static gint ett_krb_pac_privsvr_checksum = -1; static gint ett_krb_pac_client_info_type = -1; static gint ett_krb_pa_supported_enctypes = -1; static gint ett_krb_ad_ap_options = -1; +#ifdef HAVE_KERBEROS +static gint ett_krb_pa_enc_ts_enc = -1; +#endif /*--- Included file: packet-kerberos-ett.c ---*/ #line 1 "./asn1/kerberos/packet-kerberos-ett.c" @@ -487,7 +494,6 @@ static gint ett_kerberos_KrbCredInfo = -1; static gint ett_kerberos_KRB_ERROR_U = -1; static gint ett_kerberos_METHOD_DATA = -1; static gint ett_kerberos_PA_ENC_TIMESTAMP = -1; -static gint ett_kerberos_PA_ENC_TS_ENC = -1; static gint ett_kerberos_ETYPE_INFO_ENTRY = -1; static gint ett_kerberos_ETYPE_INFO = -1; static gint ett_kerberos_ETYPE_INFO2_ENTRY = -1; @@ -512,7 +518,7 @@ static gint ett_kerberos_PA_FX_FAST_REPLY = -1; static gint ett_kerberos_KrbFastArmoredRep = -1; /*--- End of included file: packet-kerberos-ett.c ---*/ -#line 216 "./asn1/kerberos/packet-kerberos-template.c" +#line 225 "./asn1/kerberos/packet-kerberos-template.c" static expert_field ei_kerberos_decrypted_keytype = EI_INIT; static expert_field ei_kerberos_address = EI_INIT; @@ -633,7 +639,7 @@ typedef enum _KERBEROS_PADATA_TYPE_enum { } KERBEROS_PADATA_TYPE_enum; /*--- End of included file: packet-kerberos-val.h ---*/ -#line 228 "./asn1/kerberos/packet-kerberos-template.c" +#line 237 "./asn1/kerberos/packet-kerberos-template.c" static void call_kerberos_callbacks(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int tag, kerberos_callbacks *cb) @@ -2567,13 +2573,15 @@ dissect_krb5_PAC_CREDENTIAL_INFO(proto_tree *parent_tree, tvbuff_t *tvb, int off { proto_item *item; proto_tree *tree; - guint32 etype; guint8 *plaintext = NULL; int plainlen = 0; - int length; - tvbuff_t *next_tvb; + int length = 0; #define KRB5_KU_OTHER_ENCRYPTED 16 +#ifdef HAVE_KERBEROS + guint32 etype; + tvbuff_t *next_tvb; int usage = KRB5_KU_OTHER_ENCRYPTED; +#endif item = proto_tree_add_item(parent_tree, hf_krb_pac_credential_info, tvb, offset, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_krb_pac_credential_info); @@ -2583,17 +2591,21 @@ dissect_krb5_PAC_CREDENTIAL_INFO(proto_tree *parent_tree, tvbuff_t *tvb, int off offset, 4, ENC_LITTLE_ENDIAN); offset+=4; +#ifdef HAVE_KERBEROS /* etype */ etype = tvb_get_letohl(tvb, offset); +#endif proto_tree_add_item(tree, hf_krb_pac_credential_info_etype, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; +#ifdef HAVE_KERBEROS /* data */ next_tvb=tvb_new_subset_remaining(tvb, offset); length=tvb_captured_length_remaining(tvb, offset); plaintext=decrypt_krb5_data(tree, actx->pinfo, usage, next_tvb, (int)etype, &plainlen); +#endif if (plaintext != NULL) { tvbuff_t *child_tvb; @@ -3005,7 +3017,7 @@ static const value_string kerberos_ENCTYPE_vals[] = { static int dissect_kerberos_ENCTYPE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 284 "./asn1/kerberos/kerberos.cnf" +#line 285 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t *private_data = kerberos_get_private_data(actx); offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &(private_data->etype)); @@ -3030,7 +3042,7 @@ dissect_kerberos_UInt32(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_kerberos_T_encryptedTicketData_cipher(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 288 "./asn1/kerberos/kerberos.cnf" +#line 289 "./asn1/kerberos/kerberos.cnf" #ifdef HAVE_KERBEROS offset=dissect_ber_octet_string_wcb(FALSE, actx, tree, tvb, offset, hf_index, dissect_krb5_decrypt_ticket_data); #else @@ -3157,7 +3169,7 @@ static const value_string kerberos_CKSUMTYPE_vals[] = { static int dissect_kerberos_CKSUMTYPE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 344 "./asn1/kerberos/kerberos.cnf" +#line 345 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t *private_data = kerberos_get_private_data(actx); offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &(private_data->checksum_type)); @@ -3172,7 +3184,7 @@ dissect_kerberos_CKSUMTYPE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_kerberos_T_checksum(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 348 "./asn1/kerberos/kerberos.cnf" +#line 349 "./asn1/kerberos/kerberos.cnf" tvbuff_t *next_tvb; kerberos_private_data_t *private_data = kerberos_get_private_data(actx); @@ -3238,7 +3250,7 @@ dissect_kerberos_Int32(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_kerberos_T_keytype(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 361 "./asn1/kerberos/kerberos.cnf" +#line 362 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t *private_data = kerberos_get_private_data(actx); offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, @@ -3254,7 +3266,7 @@ dissect_kerberos_T_keytype(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_kerberos_T_keyvalue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 368 "./asn1/kerberos/kerberos.cnf" +#line 369 "./asn1/kerberos/kerberos.cnf" tvbuff_t *out_tvb; kerberos_private_data_t *private_data = kerberos_get_private_data(actx); @@ -3279,7 +3291,7 @@ static const ber_sequence_t EncryptionKey_sequence[] = { static int dissect_kerberos_EncryptionKey(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 377 "./asn1/kerberos/kerberos.cnf" +#line 378 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t *private_data = kerberos_get_private_data(actx); offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, @@ -3328,7 +3340,7 @@ static const value_string kerberos_AUTHDATA_TYPE_vals[] = { static int dissect_kerberos_AUTHDATA_TYPE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 388 "./asn1/kerberos/kerberos.cnf" +#line 389 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t *private_data = kerberos_get_private_data(actx); offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &(private_data->ad_type)); @@ -3343,7 +3355,7 @@ dissect_kerberos_AUTHDATA_TYPE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_kerberos_T_ad_data(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 392 "./asn1/kerberos/kerberos.cnf" +#line 393 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t *private_data = kerberos_get_private_data(actx); switch(private_data->ad_type){ @@ -3506,7 +3518,7 @@ static const value_string kerberos_ADDR_TYPE_vals[] = { static int dissect_kerberos_ADDR_TYPE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 421 "./asn1/kerberos/kerberos.cnf" +#line 422 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t *private_data = kerberos_get_private_data(actx); offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &(private_data->addr_type)); @@ -3521,7 +3533,7 @@ dissect_kerberos_ADDR_TYPE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_kerberos_T_address(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 234 "./asn1/kerberos/kerberos.cnf" +#line 235 "./asn1/kerberos/kerberos.cnf" gint8 appclass; gboolean pc; gint32 tag; @@ -3653,7 +3665,7 @@ static const value_string kerberos_MESSAGE_TYPE_vals[] = { static int dissect_kerberos_MESSAGE_TYPE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 77 "./asn1/kerberos/kerberos.cnf" +#line 78 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t *private_data = kerberos_get_private_data(actx); guint32 msgtype; @@ -3663,7 +3675,7 @@ dissect_kerberos_MESSAGE_TYPE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int -#line 83 "./asn1/kerberos/kerberos.cnf" +#line 84 "./asn1/kerberos/kerberos.cnf" if (gbl_do_col_info) { col_add_str(actx->pinfo->cinfo, COL_INFO, val_to_str(msgtype, krb5_msg_types, @@ -3755,14 +3767,14 @@ static const value_string kerberos_PADATA_TYPE_vals[] = { static int dissect_kerberos_PADATA_TYPE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 142 "./asn1/kerberos/kerberos.cnf" +#line 143 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t* private_data = kerberos_get_private_data(actx); offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &(private_data->padata_type)); -#line 145 "./asn1/kerberos/kerberos.cnf" +#line 146 "./asn1/kerberos/kerberos.cnf" if(tree){ proto_item_append_text(tree, " %s", val_to_str(private_data->padata_type, kerberos_PADATA_TYPE_vals, @@ -3777,7 +3789,7 @@ dissect_kerberos_PADATA_TYPE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_kerberos_T_padata_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 152 "./asn1/kerberos/kerberos.cnf" +#line 153 "./asn1/kerberos/kerberos.cnf" proto_tree *sub_tree=tree; kerberos_private_data_t* private_data = kerberos_get_private_data(actx); @@ -3955,7 +3967,7 @@ dissect_kerberos_SEQUENCE_OF_ENCTYPE(gboolean implicit_tag _U_, tvbuff_t *tvb _U static int dissect_kerberos_T_encryptedAuthorizationData_cipher(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 295 "./asn1/kerberos/kerberos.cnf" +#line 296 "./asn1/kerberos/kerberos.cnf" #ifdef HAVE_KERBEROS offset=dissect_ber_octet_string_wcb(FALSE, actx, tree, tvb, offset, hf_index, dissect_krb5_decrypt_authorization_data); #else @@ -4017,7 +4029,7 @@ static const ber_sequence_t KDC_REQ_BODY_sequence[] = { static int dissect_kerberos_KDC_REQ_BODY(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 425 "./asn1/kerberos/kerberos.cnf" +#line 426 "./asn1/kerberos/kerberos.cnf" conversation_t *conversation; /* @@ -4078,7 +4090,7 @@ dissect_kerberos_AS_REQ(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_kerberos_T_encryptedKDCREPData_cipher(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 309 "./asn1/kerberos/kerberos.cnf" +#line 310 "./asn1/kerberos/kerberos.cnf" #ifdef HAVE_KERBEROS offset=dissect_ber_octet_string_wcb(FALSE, actx, tree, tvb, offset, hf_index, dissect_krb5_decrypt_KDC_REP_data); #else @@ -4179,7 +4191,7 @@ dissect_kerberos_APOptions(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_kerberos_T_encryptedAuthenticator_cipher(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 302 "./asn1/kerberos/kerberos.cnf" +#line 303 "./asn1/kerberos/kerberos.cnf" #ifdef HAVE_KERBEROS offset=dissect_ber_octet_string_wcb(FALSE, actx, tree, tvb, offset, hf_index, dissect_krb5_decrypt_authenticator_data); #else @@ -4241,7 +4253,7 @@ dissect_kerberos_AP_REQ(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_kerberos_T_encryptedAPREPData_cipher(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 323 "./asn1/kerberos/kerberos.cnf" +#line 324 "./asn1/kerberos/kerberos.cnf" #ifdef HAVE_KERBEROS offset=dissect_ber_octet_string_wcb(FALSE, actx, tree, tvb, offset, hf_index, dissect_krb5_decrypt_AP_REP_data); #else @@ -4301,7 +4313,7 @@ dissect_kerberos_AP_REP(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_kerberos_T_kRB_SAFE_BODY_user_data(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 448 "./asn1/kerberos/kerberos.cnf" +#line 449 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t* private_data = kerberos_get_private_data(actx); tvbuff_t *new_tvb; offset=dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &new_tvb); @@ -4364,7 +4376,7 @@ dissect_kerberos_KRB_SAFE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs static int dissect_kerberos_T_encryptedKrbPrivData_cipher(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 330 "./asn1/kerberos/kerberos.cnf" +#line 331 "./asn1/kerberos/kerberos.cnf" #ifdef HAVE_KERBEROS offset=dissect_ber_octet_string_wcb(FALSE, actx, tree, tvb, offset, hf_index, dissect_krb5_decrypt_PRIV_data); #else @@ -4424,7 +4436,7 @@ dissect_kerberos_KRB_PRIV(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs static int dissect_kerberos_T_encryptedKrbCredData_cipher(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 337 "./asn1/kerberos/kerberos.cnf" +#line 338 "./asn1/kerberos/kerberos.cnf" #ifdef HAVE_KERBEROS offset=dissect_ber_octet_string_wcb(FALSE, actx, tree, tvb, offset, hf_index, dissect_krb5_decrypt_CRED_data); #else @@ -4548,14 +4560,14 @@ dissect_kerberos_METHOD_DATA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_kerberos_T_encrypted_pa_data(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 464 "./asn1/kerberos/kerberos.cnf" +#line 465 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t* private_data = kerberos_get_private_data(actx); private_data->is_enc_padata = TRUE; offset = dissect_kerberos_METHOD_DATA(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 468 "./asn1/kerberos/kerberos.cnf" +#line 469 "./asn1/kerberos/kerberos.cnf" private_data->is_enc_padata = FALSE; @@ -4639,7 +4651,7 @@ dissect_kerberos_EncAPRepPart(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_kerberos_T_encKrbPrivPart_user_data(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 456 "./asn1/kerberos/kerberos.cnf" +#line 457 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t* private_data = kerberos_get_private_data(actx); tvbuff_t *new_tvb; offset=dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &new_tvb); @@ -4852,7 +4864,7 @@ static const value_string kerberos_ERROR_CODE_vals[] = { static int dissect_kerberos_ERROR_CODE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 99 "./asn1/kerberos/kerberos.cnf" +#line 100 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t *private_data = kerberos_get_private_data(actx); offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &private_data->errorcode); @@ -4860,7 +4872,7 @@ dissect_kerberos_ERROR_CODE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of -#line 103 "./asn1/kerberos/kerberos.cnf" +#line 104 "./asn1/kerberos/kerberos.cnf" if (private_data->errorcode) { col_add_fstr(actx->pinfo->cinfo, COL_INFO, "KRB Error: %s", @@ -4876,7 +4888,7 @@ dissect_kerberos_ERROR_CODE(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of static int dissect_kerberos_T_e_data(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 112 "./asn1/kerberos/kerberos.cnf" +#line 113 "./asn1/kerberos/kerberos.cnf" kerberos_private_data_t *private_data = kerberos_get_private_data(actx); switch (private_data->errorcode) { @@ -5000,7 +5012,7 @@ dissect_kerberos_EncryptedData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_kerberos_T_pA_ENC_TIMESTAMP_cipher(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 316 "./asn1/kerberos/kerberos.cnf" +#line 317 "./asn1/kerberos/kerberos.cnf" #ifdef HAVE_KERBEROS offset=dissect_ber_octet_string_wcb(FALSE, actx, tree, tvb, offset, hf_index, dissect_krb5_decrypt_PA_ENC_TIMESTAMP); #else @@ -5031,21 +5043,6 @@ dissect_kerberos_PA_ENC_TIMESTAMP(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, } -static const ber_sequence_t PA_ENC_TS_ENC_sequence[] = { - { &hf_kerberos_patimestamp, BER_CLASS_CON, 0, 0, dissect_kerberos_KerberosTime }, - { &hf_kerberos_pausec , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_kerberos_Microseconds }, - { NULL, 0, 0, 0, NULL } -}; - -static int -dissect_kerberos_PA_ENC_TS_ENC(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, - PA_ENC_TS_ENC_sequence, hf_index, ett_kerberos_PA_ENC_TS_ENC); - - return offset; -} - - static const ber_sequence_t ETYPE_INFO_ENTRY_sequence[] = { { &hf_kerberos_etype , BER_CLASS_CON, 0, 0, dissect_kerberos_ENCTYPE }, { &hf_kerberos_info_salt , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_kerberos_OCTET_STRING }, @@ -5166,7 +5163,7 @@ dissect_kerberos_PA_S4U2Self(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_kerberos_T_subject_certificate(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 418 "./asn1/kerberos/kerberos.cnf" +#line 419 "./asn1/kerberos/kerberos.cnf" offset=dissect_ber_octet_string_wcb(implicit_tag, actx, tree, tvb, offset,hf_index, dissect_x509af_Certificate); @@ -5406,7 +5403,22 @@ dissect_kerberos_EncryptedChallenge(gboolean implicit_tag _U_, tvbuff_t *tvb _U_ /*--- End of included file: packet-kerberos-fn.c ---*/ -#line 2454 "./asn1/kerberos/packet-kerberos-template.c" +#line 2469 "./asn1/kerberos/packet-kerberos-template.c" + +#ifdef HAVE_KERBEROS +static const ber_sequence_t PA_ENC_TS_ENC_sequence[] = { + { &hf_krb_patimestamp, BER_CLASS_CON, 0, 0, dissect_kerberos_KerberosTime }, + { &hf_krb_pausec , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_kerberos_Microseconds }, + { NULL, 0, 0, 0, NULL } +}; + +static int +dissect_kerberos_PA_ENC_TS_ENC(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, + PA_ENC_TS_ENC_sequence, hf_index, ett_krb_pa_enc_ts_enc); + return offset; +} +#endif /* Make wrappers around exported functions for now */ int @@ -5849,9 +5861,17 @@ void proto_register_kerberos(void) { { &hf_krb_ad_ap_options_cbt, { "ChannelBindings", "kerberos.ad_ap_options.cbt", FT_BOOLEAN, 32, TFS(&set_tfs), 0x00004000, NULL, HFILL }}, - { &hf_krb_ad_target_principal, { - "Target Principal", "kerberos.ad_target_principal", FT_STRING, BASE_NONE, - NULL, 0, NULL, HFILL }}, + { &hf_krb_ad_target_principal, + { "Target Principal", "kerberos.ad_target_principal", + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, +#ifdef HAVE_KERBEROS + { &hf_krb_patimestamp, + { "patimestamp", "kerberos.patimestamp", + FT_STRING, BASE_NONE, NULL, 0, "KerberosTime", HFILL }}, + { &hf_krb_pausec, + { "pausec", "kerberos.pausec", + FT_UINT32, BASE_DEC, NULL, 0, "Microseconds", HFILL }}, +#endif /*--- Included file: packet-kerberos-hfarr.c ---*/ @@ -6336,14 +6356,6 @@ void proto_register_kerberos(void) { { "cipher", "kerberos.cipher", FT_BYTES, BASE_NONE, NULL, 0, "T_pA_ENC_TIMESTAMP_cipher", HFILL }}, - { &hf_kerberos_patimestamp, - { "patimestamp", "kerberos.patimestamp", - FT_STRING, BASE_NONE, NULL, 0, - "KerberosTime", HFILL }}, - { &hf_kerberos_pausec, - { "pausec", "kerberos.pausec", - FT_UINT32, BASE_DEC, NULL, 0, - "Microseconds", HFILL }}, { &hf_kerberos_info_salt, { "salt", "kerberos.salt", FT_BYTES, BASE_NONE, NULL, 0, @@ -6694,7 +6706,7 @@ void proto_register_kerberos(void) { NULL, HFILL }}, /*--- End of included file: packet-kerberos-hfarr.c ---*/ -#line 2901 "./asn1/kerberos/packet-kerberos-template.c" +#line 2939 "./asn1/kerberos/packet-kerberos-template.c" }; /* List of subtrees */ @@ -6713,6 +6725,9 @@ void proto_register_kerberos(void) { &ett_krb_pac_client_info_type, &ett_krb_pa_supported_enctypes, &ett_krb_ad_ap_options, +#ifdef HAVE_KERBEROS + &ett_krb_pa_enc_ts_enc, +#endif /*--- Included file: packet-kerberos-ettarr.c ---*/ #line 1 "./asn1/kerberos/packet-kerberos-ettarr.c" @@ -6765,7 +6780,6 @@ void proto_register_kerberos(void) { &ett_kerberos_KRB_ERROR_U, &ett_kerberos_METHOD_DATA, &ett_kerberos_PA_ENC_TIMESTAMP, - &ett_kerberos_PA_ENC_TS_ENC, &ett_kerberos_ETYPE_INFO_ENTRY, &ett_kerberos_ETYPE_INFO, &ett_kerberos_ETYPE_INFO2_ENTRY, @@ -6790,7 +6804,7 @@ void proto_register_kerberos(void) { &ett_kerberos_KrbFastArmoredRep, /*--- End of included file: packet-kerberos-ettarr.c ---*/ -#line 2920 "./asn1/kerberos/packet-kerberos-template.c" +#line 2961 "./asn1/kerberos/packet-kerberos-template.c" }; static ei_register_info ei[] = { |