Initial import
[samba] / source / include / spnego.h
1 /* 
2    Unix SMB/CIFS implementation.
3
4    RFC2478 Compliant SPNEGO implementation
5
6    Copyright (C) Jim McDonough <jmcd@us.ibm.com>   2003
7
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12    
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 #ifndef SAMBA_SPNEGO_H
25 #define SAMBA_SPNEGO_H
26
27 #define SPNEGO_DELEG_FLAG    0x01
28 #define SPNEGO_MUTUAL_FLAG   0x02
29 #define SPNEGO_REPLAY_FLAG   0x04
30 #define SPNEGO_SEQUENCE_FLAG 0x08
31 #define SPNEGO_ANON_FLAG     0x10
32 #define SPNEGO_CONF_FLAG     0x20
33 #define SPNEGO_INTEG_FLAG    0x40
34 #define SPNEGO_REQ_FLAG      0x80
35
36 #define SPNEGO_NEG_TOKEN_INIT 0
37 #define SPNEGO_NEG_TOKEN_TARG 1
38
39 typedef enum _spnego_negResult {
40         SPNEGO_ACCEPT_COMPLETED = 0,
41         SPNEGO_ACCEPT_INCOMPLETE = 1,
42         SPNEGO_REJECT = 2
43 } negResult_t;
44
45 typedef struct spnego_negTokenInit {
46         const char **mechTypes;
47         int reqFlags;
48         DATA_BLOB mechToken;
49         DATA_BLOB mechListMIC;
50 } negTokenInit_t;
51
52 typedef struct spnego_negTokenTarg {
53         uint8 negResult;
54         char *supportedMech;
55         DATA_BLOB responseToken;
56         DATA_BLOB mechListMIC;
57 } negTokenTarg_t;
58
59 typedef struct spnego_spnego {
60         int type;
61         negTokenInit_t negTokenInit;
62         negTokenTarg_t negTokenTarg;
63 } SPNEGO_DATA;
64
65 #endif