1 /* packet-gssapi.h
2  * Dissector for GSS-API tokens as described in rfc2078, section 3.1
3  * Copyright 2002, Tim Potter <tpot@samba.org>
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_GSSAPI_H
13 #define __PACKET_GSSAPI_H
14 
15 /* Structures needed outside */
16 
17 typedef struct _gssapi_oid_value {
18 	protocol_t *proto;
19 	int ett;
20 	dissector_handle_t handle;
21 	dissector_handle_t wrap_handle;
22 	const gchar *comment;  /* For the comment */
23 } gssapi_oid_value;
24 
25 #define DECRYPT_GSSAPI_NORMAL   1
26 #define DECRYPT_GSSAPI_DCE  2
27 
28 /**< Extra data for handling of decryption of GSSAPI wrapped tvbuffs.
29 	Caller sets decrypt_gssapi_tvb if this service is requested.
30 	If gssapi_encrypted_tvb is NULL, then the rest of the tvb data following
31 	the gssapi blob itself is decrypted othervise the gssapi_encrypted_tvb
32 	tvb will be decrypted (DCERPC has the data before the gssapi blob)
33 	If, on return, gssapi_data_encrypted is FALSE, the wrapped tvbuff
34 	was signed (i.e., an encrypted signature was present, to check
35 	whether the data was modified by a man in the middle) but not sealed
36 	(i.e., the data itself wasn't encrypted).
37 */
38 typedef struct _gssapi_encrypt_info
39 {
40 	guint16 decrypt_gssapi_tvb;
41 	tvbuff_t *gssapi_wrap_tvb;
42 	tvbuff_t *gssapi_header_tvb;
43 	tvbuff_t *gssapi_encrypted_tvb;
44 	tvbuff_t *gssapi_trailer_tvb;
45 	tvbuff_t *gssapi_decrypted_tvb;
46 	gboolean gssapi_data_encrypted;
47 } gssapi_encrypt_info_t;
48 
49 /* Function prototypes */
50 
51 void
52 gssapi_init_oid(const char *oid, int proto, int ett, dissector_handle_t handle,
53 		dissector_handle_t wrap_handle, const gchar *comment);
54 
55 gssapi_oid_value *
56 gssapi_lookup_oid_str(const gchar *oid_key);
57 
58 int wrap_dissect_gssapi_verf(tvbuff_t *tvb, int offset,
59 			     packet_info *pinfo,
60 			     proto_tree *tree, dcerpc_info *di, guint8 *drep);
61 
62 tvbuff_t *
63 wrap_dissect_gssapi_payload(tvbuff_t *header_tvb _U_,
64 			    tvbuff_t *payload_tvb,
65 			    tvbuff_t *trailer_tvb _U_,
66 			    tvbuff_t *auth_tvb,
67 			    packet_info *pinfo,
68 			    dcerpc_auth_info *auth_info _U_);
69 
70 #endif /* __PACKET_GSSAPI_H */
71