78afbe01071f33188071aeb4e716edee4b1d80b9
[sfrench/samba-autobuild/.git] / source4 / auth / gensec / 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 #define SPNEGO_DELEG_FLAG    0x01
25 #define SPNEGO_MUTUAL_FLAG   0x02
26 #define SPNEGO_REPLAY_FLAG   0x04
27 #define SPNEGO_SEQUENCE_FLAG 0x08
28 #define SPNEGO_ANON_FLAG     0x10
29 #define SPNEGO_CONF_FLAG     0x20
30 #define SPNEGO_INTEG_FLAG    0x40
31 #define SPNEGO_REQ_FLAG      0x80
32
33 enum spnego_negResult {
34         SPNEGO_ACCEPT_COMPLETED = 0,
35         SPNEGO_ACCEPT_INCOMPLETE = 1,
36         SPNEGO_REJECT = 2,
37         SPNEGO_NONE_RESULT = 3
38 };
39
40 struct spnego_negTokenInit {
41         const char **mechTypes;
42         int reqFlags;
43         DATA_BLOB mechToken;
44         DATA_BLOB mechListMIC;
45         char *targetPrincipal;
46 };
47
48 struct spnego_negTokenTarg {
49         uint8_t negResult;
50         const char *supportedMech;
51         DATA_BLOB responseToken;
52         DATA_BLOB mechListMIC;
53 };
54
55 struct spnego_data {
56         int type;
57         struct spnego_negTokenInit negTokenInit;
58         struct spnego_negTokenTarg negTokenTarg;
59 };
60
61 enum spnego_message_type {
62         SPNEGO_NEG_TOKEN_INIT = 0, 
63         SPNEGO_NEG_TOKEN_TARG = 1,
64 };
65
66 #include "auth/gensec/spnego_proto.h"