Kerberos - Add support for RFC 6113
[metze/wireshark/wip.git] / epan / dissectors / 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 -p kerberos -c ./kerberos.cnf -s ./packet-kerberos-template -D . -O ../.. KerberosV5Spec2.asn k5.asn RFC3244.asn RFC6113.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  * This program is free software; you can redistribute it and/or
18  * modify it under the terms of the GNU General Public License
19  * as published by the Free Software Foundation; either version 2
20  * of the License, or (at your option) any later version.
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30  */
31
32 #ifndef __PACKET_KERBEROS_H
33 #define __PACKET_KERBEROS_H
34
35 #include "ws_symbol_export.h"
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40
41 /* This is a list of callback functions a caller can use to specify that
42    octet strings in kerberos to be passed back to application specific
43    dissectors, outside of kerberos.
44    This is used for dissection of application specific data for PacketCable
45    KRB_SAFE user data and eventually to pass kerberos session keys
46    to future DCERPC decryption and other uses.
47    The list is terminated by {0, NULL }
48 */
49 #define KRB_CBTAG_SAFE_USER_DATA                1
50 #define KRB_CBTAG_PRIV_USER_DATA                2
51 typedef struct _kerberos_callbacks {
52         int tag;
53         int (*callback)(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree);
54 } kerberos_callbacks;
55
56 /* Function prototypes */
57
58 gint
59 dissect_kerberos_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean do_col_info, kerberos_callbacks *cb);
60
61 int
62 dissect_krb5_Checksum(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
63
64 int
65 dissect_krb5_ctime(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
66
67 int dissect_krb5_cname(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
68 int dissect_krb5_realm(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
69 guint32 kerberos_output_keytype(void);
70
71 guint get_krb_pdu_len(packet_info *, tvbuff_t *tvb, int offset, void *data _U_);
72
73 gint kerberos_rm_to_reclen(guint krb_rm);
74
75 void
76 show_krb_recordmark(proto_tree *tree, tvbuff_t *tvb, gint start, guint32 krb_rm);
77
78 #ifdef HAVE_KERBEROS
79 #define KRB_MAX_ORIG_LEN        256
80
81 #if defined(HAVE_HEIMDAL_KERBEROS) || defined(HAVE_MIT_KERBEROS)
82 typedef struct _enc_key_t {
83         struct _enc_key_t       *next;
84         int keytype;
85         int keylength;
86         char *keyvalue;
87         char                    key_origin[KRB_MAX_ORIG_LEN+1];
88         int fd_num; /* remember where we learned a key */
89 } enc_key_t;
90 extern enc_key_t *enc_key_list;
91
92 guint8 *
93 decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
94                         int usage,
95                         tvbuff_t *crypototvb,
96                         int keytype,
97                         int *datalen);
98
99 #endif /* HAVE_HEIMDAL_KERBEROS || HAVE_MIT_KERBEROS */
100
101 extern gboolean krb_decrypt;
102
103 #endif /* HAVE_KERBEROS */
104
105
106 /*--- Included file: packet-kerberos-exp.h ---*/
107 #line 1 "./asn1/kerberos/packet-kerberos-exp.h"
108
109 /* enumerated values for Applications */
110 #define KERBEROS_APPLICATIONS_TICKET   1
111 #define KERBEROS_APPLICATIONS_AUTHENTICATOR   2
112 #define KERBEROS_APPLICATIONS_ENCTICKETPART   3
113 #define KERBEROS_APPLICATIONS_AS_REQ  10
114 #define KERBEROS_APPLICATIONS_AS_REP  11
115 #define KERBEROS_APPLICATIONS_TGS_REQ  12
116 #define KERBEROS_APPLICATIONS_TGS_REP  13
117 #define KERBEROS_APPLICATIONS_AP_REQ  14
118 #define KERBEROS_APPLICATIONS_AP_REP  15
119 #define KERBEROS_APPLICATIONS_KRB_SAFE  20
120 #define KERBEROS_APPLICATIONS_KRB_PRIV  21
121 #define KERBEROS_APPLICATIONS_KRB_CRED  22
122 #define KERBEROS_APPLICATIONS_ENCASREPPART  25
123 #define KERBEROS_APPLICATIONS_ENCTGSREPPART  26
124 #define KERBEROS_APPLICATIONS_ENCAPREPPART  27
125 #define KERBEROS_APPLICATIONS_ENCKRBPRIVPART  28
126 #define KERBEROS_APPLICATIONS_ENCKRBCREDPART  29
127 #define KERBEROS_APPLICATIONS_KRB_ERROR  30
128 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_);
129
130 /*--- End of included file: packet-kerberos-exp.h ---*/
131 #line 98 "./asn1/kerberos/packet-kerberos-template.h"
132
133 #ifdef __cplusplus
134 }
135 #endif /* __cplusplus */
136
137 #endif  /* __PACKET_KERBEROS_H */