Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
packet-kerberos-template.h
1 /* packet-kerberos.h
2  * Routines for kerberos packet dissection
3  * Copyright 2007, Anders Broman <anders.broman@ericsson.com>
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * SPDX-License-Identifier: GPL-2.0-or-later
10  */
11 
12 #ifndef __PACKET_KERBEROS_H
13 #define __PACKET_KERBEROS_H
14 
15 #include "ws_symbol_export.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
20 
21 /* This is a list of callback functions a caller can use to specify that
22  octet strings in kerberos to be passed back to application specific
23  dissectors, outside of kerberos.
24  This is used for dissection of application specific data for PacketCable
25  KRB_SAFE user data and eventually to pass kerberos session keys
26  to future DCERPC decryption and other uses.
27  The list is terminated by {0, NULL }
28 */
29 #define KRB_CBTAG_SAFE_USER_DATA 1
30 #define KRB_CBTAG_PRIV_USER_DATA 2
31 typedef struct _kerberos_callbacks {
32  int tag;
33  int (*callback)(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree);
35 
36 /* Function prototypes */
37 
38 gint
39 dissect_kerberos_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean do_col_info, kerberos_callbacks *cb);
40 
41 int
42 dissect_krb5_Checksum(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
43 
44 int
45 dissect_krb5_ctime(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
46 
47 int dissect_krb5_cname(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
48 int dissect_krb5_realm(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
49 guint32 kerberos_output_keytype(void);
50 
51 guint get_krb_pdu_len(packet_info *, tvbuff_t *tvb, int offset, void *data _U_);
52 
53 gint kerberos_rm_to_reclen(guint krb_rm);
54 
55 void
56 show_krb_recordmark(proto_tree *tree, tvbuff_t *tvb, gint start, guint32 krb_rm);
57 
58 #ifdef HAVE_KERBEROS
59 #define KRB_MAX_ORIG_LEN 256
60 
61 #if defined(HAVE_HEIMDAL_KERBEROS) || defined(HAVE_MIT_KERBEROS)
62 typedef struct _enc_key_t {
63  struct _enc_key_t *next;
64  int keytype;
65  int keylength;
66  char *keyvalue;
67  char key_origin[KRB_MAX_ORIG_LEN+1];
68  int fd_num; /* remember where we learned a key */
69 } enc_key_t;
70 extern enc_key_t *enc_key_list;
71 
72 guint8 *
73 decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
74  int usage,
75  tvbuff_t *crypototvb,
76  int keytype,
77  int *datalen);
78 
79 #endif /* HAVE_HEIMDAL_KERBEROS || HAVE_MIT_KERBEROS */
80 
81 extern gboolean krb_decrypt;
82 
83 #endif /* HAVE_KERBEROS */
84 
85 #include "packet-kerberos-exp.h"
86 
87 #ifdef __cplusplus
88 }
89 #endif /* __cplusplus */
90 
91 #endif /* __PACKET_KERBEROS_H */
Definition: packet_info.h:44
Definition: tvbuff-int.h:35
Definition: asn1.h:63
Definition: packet-kerberos-template.h:31
Definition: proto.h:759