Wireshark 4.5.0
The Wireshark network protocol analyzer
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
packet-kerberos.h
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 -q -L -p kerberos -c ./kerberos.cnf -s ./packet-kerberos-template -D . -O ../.. KerberosV5Spec2.asn k5.asn RFC3244.asn RFC6113.asn SPAKE.asn */
5
6/* packet-kerberos.h
7 * Routines for kerberos packet dissection
8 * Copyright 2007, Anders Broman <anders.broman@ericsson.com>
9 *
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1998 Gerald Combs
13 *
14 * SPDX-License-Identifier: GPL-2.0-or-later
15 */
16
17#ifndef __PACKET_KERBEROS_H
18#define __PACKET_KERBEROS_H
19
20#include "ws_symbol_export.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif /* __cplusplus */
25
26#ifndef KRB5_KU_USAGE_ACCEPTOR_SEAL
27#define KRB5_KU_USAGE_ACCEPTOR_SEAL 22
28#endif
29#ifndef KRB5_KU_USAGE_ACCEPTOR_SIGN
30#define KRB5_KU_USAGE_ACCEPTOR_SIGN 23
31#endif
32#ifndef KRB5_KU_USAGE_INITIATOR_SEAL
33#define KRB5_KU_USAGE_INITIATOR_SEAL 24
34#endif
35#ifndef KRB5_KU_USAGE_INITIATOR_SIGN
36#define KRB5_KU_USAGE_INITIATOR_SIGN 25
37#endif
38
39/* This is a list of callback functions a caller can use to specify that
40 octet strings in kerberos to be passed back to application specific
41 dissectors, outside of kerberos.
42 This is used for dissection of application specific data for PacketCable
43 KRB_SAFE user data and eventually to pass kerberos session keys
44 to future DCERPC decryption and other uses.
45 The list is terminated by {0, NULL }
46*/
47#define KRB_CBTAG_SAFE_USER_DATA 1
48#define KRB_CBTAG_PRIV_USER_DATA 2
49typedef struct _kerberos_callbacks {
50 int tag;
51 int (*callback)(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree);
53
54/* Function prototypes */
55
56bool
57kerberos_is_win2k_pkinit(asn1_ctx_t *actx);
58
59int
60dissect_kerberos_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, bool do_col_info, kerberos_callbacks *cb);
61
62int
63dissect_krb5_Checksum(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
64
65int
66dissect_krb5_ctime(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
67
68int dissect_krb5_cname(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
69int dissect_krb5_realm(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
70uint32_t kerberos_output_keytype(void);
71
72unsigned get_krb_pdu_len(packet_info *, tvbuff_t *tvb, int offset, void *data _U_);
73
74int kerberos_rm_to_reclen(unsigned krb_rm);
75
76void
77show_krb_recordmark(proto_tree *tree, tvbuff_t *tvb, int start, uint32_t krb_rm);
78
79int
80dissect_kerberos_KERB_TICKET_LOGON(tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree);
81
82#ifdef HAVE_KERBEROS
83#define KRB_MAX_KEY_LENGTH 32
84
85#if defined(HAVE_HEIMDAL_KERBEROS) || defined(HAVE_MIT_KERBEROS)
86typedef struct _enc_key_t {
87 struct _enc_key_t *next;
88 int keytype;
89 int keylength;
90 uint8_t keyvalue[KRB_MAX_KEY_LENGTH];
91 char* key_origin;
92 int fd_num; /* remember where we learned a key */
93 unsigned id; /* a unique id of the key, relative to fd_num */
94 char* id_str;
95 /* EncTicketPart_key */
96 bool is_ticket_key;
97 /* EncAPRepPart_subkey */
98 bool is_ap_rep_key;
99 /*
100 * for now taken from dissect_krb5_PAC_UPN_DNS_INFO,
101 * we could also use dissect_krb5_PAC_LOGON_INFO if needed
102 *
103 * we get device_sid from dissect_krb5_PAC_DEVICE_INFO if available.
104 *
105 * We remember these from the PAC and
106 * attach it to EncTicketPart_key so it
107 * might be valid if is_ticket_key is true.
108 *
109 * When learning a EncAPRepPart_subkey
110 * we copy the details from the EncTicketPart_key,
111 * so when is_ap_rep_key is true we may also have it.
112 *
113 * So application protocols like SMB2 could use the
114 * is_ap_rep_key=true key details in order to identify
115 * the authenticated user.
116 */
117 struct {
118 const char *account_name;
119 const char *account_domain;
120 const char *account_sid;
121 const char *device_sid;
122 } pac_names;
123 struct _enc_key_t *same_list;
124 unsigned num_same;
125 struct _enc_key_t *src1;
126 struct _enc_key_t *src2;
127} enc_key_t;
128extern enc_key_t *enc_key_list;
129extern wmem_map_t *kerberos_longterm_keys;
130
131uint8_t *
132decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
133 int usage,
134 tvbuff_t *crypototvb,
135 int keytype,
136 int *datalen);
137
138tvbuff_t *
139decrypt_krb5_krb_cfx_dce(proto_tree *tree,
140 packet_info *pinfo,
141 int usage,
142 int keytype,
143 tvbuff_t *gssapi_header_tvb,
144 tvbuff_t *gssapi_encrypted_tvb,
145 tvbuff_t *gssapi_trailer_tvb,
146 tvbuff_t *checksum_tvb);
147
148#endif /* HAVE_HEIMDAL_KERBEROS || HAVE_MIT_KERBEROS */
149
150extern bool krb_decrypt;
151
152#endif /* HAVE_KERBEROS */
153
154#ifdef __cplusplus
155}
156#endif /* __cplusplus */
157
158
159/* enumerated values for Applications */
160#define KERBEROS_APPLICATIONS_TICKET 1
161#define KERBEROS_APPLICATIONS_AUTHENTICATOR 2
162#define KERBEROS_APPLICATIONS_ENCTICKETPART 3
163#define KERBEROS_APPLICATIONS_AS_REQ 10
164#define KERBEROS_APPLICATIONS_AS_REP 11
165#define KERBEROS_APPLICATIONS_TGS_REQ 12
166#define KERBEROS_APPLICATIONS_TGS_REP 13
167#define KERBEROS_APPLICATIONS_AP_REQ 14
168#define KERBEROS_APPLICATIONS_AP_REP 15
169#define KERBEROS_APPLICATIONS_KRB_SAFE 20
170#define KERBEROS_APPLICATIONS_KRB_PRIV 21
171#define KERBEROS_APPLICATIONS_KRB_CRED 22
172#define KERBEROS_APPLICATIONS_ENCASREPPART 25
173#define KERBEROS_APPLICATIONS_ENCTGSREPPART 26
174#define KERBEROS_APPLICATIONS_ENCAPREPPART 27
175#define KERBEROS_APPLICATIONS_ENCKRBPRIVPART 28
176#define KERBEROS_APPLICATIONS_ENCKRBCREDPART 29
177#define KERBEROS_APPLICATIONS_KRB_ERROR 30
178int dissect_kerberos_TGT_REQ(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
179int dissect_kerberos_TGT_REP(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
180int dissect_kerberos_ChangePasswdData(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
181
182#endif /* __PACKET_KERBEROS_H */
Definition asn1.h:65
Definition packet-kerberos.h:49
Definition packet_info.h:43
Definition proto.h:907
Definition wmem_map.c:59
Definition tvbuff-int.h:35