1 /* Do not modify this file. Changes will be overwritten. */ 2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ 3 /* packet-kerberos.h */ 4 /* asn2wrs.py -b -p kerberos -c ./kerberos.cnf -s ./packet-kerberos-template -D . -O ../.. KerberosV5Spec2.asn k5.asn RFC3244.asn RFC6113.asn SPAKE.asn */ 5 6 /* Input file: packet-kerberos-template.h */ 7 8 #line 1 "./asn1/kerberos/packet-kerberos-template.h" 9 /* packet-kerberos.h 10 * Routines for kerberos packet dissection 11 * Copyright 2007, Anders Broman <anders.broman@ericsson.com> 12 * 13 * Wireshark - Network traffic analyzer 14 * By Gerald Combs <gerald@wireshark.org> 15 * Copyright 1998 Gerald Combs 16 * 17 * SPDX-License-Identifier: GPL-2.0-or-later 18 */ 19 20 #ifndef __PACKET_KERBEROS_H 21 #define __PACKET_KERBEROS_H 22 23 #include "ws_symbol_export.h" 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif /* __cplusplus */ 28 29 #ifndef KRB5_KU_USAGE_ACCEPTOR_SEAL 30 #define KRB5_KU_USAGE_ACCEPTOR_SEAL 22 31 #endif 32 #ifndef KRB5_KU_USAGE_ACCEPTOR_SIGN 33 #define KRB5_KU_USAGE_ACCEPTOR_SIGN 23 34 #endif 35 #ifndef KRB5_KU_USAGE_INITIATOR_SEAL 36 #define KRB5_KU_USAGE_INITIATOR_SEAL 24 37 #endif 38 #ifndef KRB5_KU_USAGE_INITIATOR_SIGN 39 #define KRB5_KU_USAGE_INITIATOR_SIGN 25 40 #endif 41 42 /* This is a list of callback functions a caller can use to specify that 43 octet strings in kerberos to be passed back to application specific 44 dissectors, outside of kerberos. 45 This is used for dissection of application specific data for PacketCable 46 KRB_SAFE user data and eventually to pass kerberos session keys 47 to future DCERPC decryption and other uses. 48 The list is terminated by {0, NULL } 49 */ 50 #define KRB_CBTAG_SAFE_USER_DATA 1 51 #define KRB_CBTAG_PRIV_USER_DATA 2 52 typedef struct _kerberos_callbacks { 53 int tag; 54 int (*callback)(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree); 55 } kerberos_callbacks; 56 57 /* Function prototypes */ 58 59 gboolean 60 kerberos_is_win2k_pkinit(asn1_ctx_t *actx); 61 62 gint 63 dissect_kerberos_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean do_col_info, kerberos_callbacks *cb); 64 65 int 66 dissect_krb5_Checksum(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_); 67 68 int 69 dissect_krb5_ctime(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_); 70 71 int dissect_krb5_cname(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_); 72 int dissect_krb5_realm(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_); 73 guint32 kerberos_output_keytype(void); 74 75 guint get_krb_pdu_len(packet_info *, tvbuff_t *tvb, int offset, void *data _U_); 76 77 gint kerberos_rm_to_reclen(guint krb_rm); 78 79 void 80 show_krb_recordmark(proto_tree *tree, tvbuff_t *tvb, gint start, guint32 krb_rm); 81 82 int 83 dissect_kerberos_KERB_TICKET_LOGON(tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree); 84 85 #ifdef HAVE_KERBEROS 86 #define KRB_MAX_ORIG_LEN 256 87 #define KRB_MAX_KEY_LENGTH 32 88 /* 89 * "18446744073709551615.18446744073709551615" 90 * sizeof("18446744073709551615") includes '\0', 91 * which is used once for '.' and then for '\0'. 92 */ 93 #define KRB_MAX_ID_STR_LEN (sizeof("18446744073709551615")*2) 94 95 #if defined(HAVE_HEIMDAL_KERBEROS) || defined(HAVE_MIT_KERBEROS) 96 typedef struct _enc_key_t { 97 struct _enc_key_t *next; 98 int keytype; 99 int keylength; 100 guint8 keyvalue[KRB_MAX_KEY_LENGTH]; 101 char key_origin[KRB_MAX_ORIG_LEN+1]; 102 int fd_num; /* remember where we learned a key */ 103 guint id; /* a unique id of the key, relative to fd_num */ 104 char id_str[KRB_MAX_ID_STR_LEN+1]; 105 struct _enc_key_t *same_list; 106 guint num_same; 107 struct _enc_key_t *src1; 108 struct _enc_key_t *src2; 109 } enc_key_t; 110 extern enc_key_t *enc_key_list; 111 extern wmem_map_t *kerberos_longterm_keys; 112 113 guint8 * 114 decrypt_krb5_data(proto_tree *tree, packet_info *pinfo, 115 int usage, 116 tvbuff_t *crypototvb, 117 int keytype, 118 int *datalen); 119 120 tvbuff_t * 121 decrypt_krb5_krb_cfx_dce(proto_tree *tree, 122 packet_info *pinfo, 123 int usage, 124 int keytype, 125 tvbuff_t *gssapi_header_tvb, 126 tvbuff_t *gssapi_encrypted_tvb, 127 tvbuff_t *gssapi_trailer_tvb, 128 tvbuff_t *checksum_tvb); 129 130 #endif /* HAVE_HEIMDAL_KERBEROS || HAVE_MIT_KERBEROS */ 131 132 extern gboolean krb_decrypt; 133 134 #endif /* HAVE_KERBEROS */ 135 136 #ifdef __cplusplus 137 } 138 #endif /* __cplusplus */ 139 140 141 /*--- Included file: packet-kerberos-exp.h ---*/ 142 #line 1 "./asn1/kerberos/packet-kerberos-exp.h" 143 144 /* enumerated values for Applications */ 145 #define KERBEROS_APPLICATIONS_TICKET 1 146 #define KERBEROS_APPLICATIONS_AUTHENTICATOR 2 147 #define KERBEROS_APPLICATIONS_ENCTICKETPART 3 148 #define KERBEROS_APPLICATIONS_AS_REQ 10 149 #define KERBEROS_APPLICATIONS_AS_REP 11 150 #define KERBEROS_APPLICATIONS_TGS_REQ 12 151 #define KERBEROS_APPLICATIONS_TGS_REP 13 152 #define KERBEROS_APPLICATIONS_AP_REQ 14 153 #define KERBEROS_APPLICATIONS_AP_REP 15 154 #define KERBEROS_APPLICATIONS_KRB_SAFE 20 155 #define KERBEROS_APPLICATIONS_KRB_PRIV 21 156 #define KERBEROS_APPLICATIONS_KRB_CRED 22 157 #define KERBEROS_APPLICATIONS_ENCASREPPART 25 158 #define KERBEROS_APPLICATIONS_ENCTGSREPPART 26 159 #define KERBEROS_APPLICATIONS_ENCAPREPPART 27 160 #define KERBEROS_APPLICATIONS_ENCKRBPRIVPART 28 161 #define KERBEROS_APPLICATIONS_ENCKRBCREDPART 29 162 #define KERBEROS_APPLICATIONS_KRB_ERROR 30 163 int dissect_kerberos_TGT_REQ(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); 164 int dissect_kerberos_TGT_REP(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); 165 int dissect_kerberos_ChangePasswdData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); 166 167 /*--- End of included file: packet-kerberos-exp.h ---*/ 168 #line 133 "./asn1/kerberos/packet-kerberos-template.h" 169 170 #endif /* __PACKET_KERBEROS_H */ 171