2 * Copyright (c) 2006 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of KTH nor the names of its contributors may be
18 * used to endorse or promote products derived from this software without
19 * specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY KTH AND ITS CONTRIBUTORS ``AS IS'' AND ANY
22 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KTH OR ITS CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
28 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 /* missing from tests:
45 * int16: number, 2 bytes, in network order
46 * int32: number, 4 bytes, in network order
47 * length-encoded: [int32 length, data of length bytes]
48 * string: [int32 length, string of length + 1 bytes, includes trailing '\0' ]
51 enum gssMaggotErrorCodes
{
54 GSMERR_CONTINUE_NEEDED
,
63 * int32: message OP (enum gssMaggotProtocol)
67 * int32: not support (GSMERR_NOT_SUPPORTED)
69 * return: -- on existing message OP
70 * int32: support (GSMERR_OK) -- only sent for extensions
74 #define GSSMAGGOTPROTOCOL 14
82 * int32: last version handled
97 * the lowest 0x7f flags maps directly to GSS-API flags
100 * REPLAY_DETECT 0x004
101 * SEQUENCE_DETECT 0x008
102 * CONFIDENTIALITY 0x010
110 * length-encoded: targetname
111 * length-encoded: token
113 * int32: hNewContextId
114 * int32: gssapi status val
115 * length-encoded: output token
121 * int32: Flags -- unused ?
122 * flags are same as flags for eInitContext
123 * length-encoded: token
125 * int32: hNewContextId
126 * int32: gssapi status val
127 * length-encoded: output token
128 * int32: delegation cred id
135 * int32: gsm status val
140 * string: principal name
144 * DEFAULT_CREDS 0x002
149 * int32: gsm status val
157 * int32: seqno -- unused
158 * length-encode: plaintext
160 * int32: gsm status val
161 * length-encode: ciphertext
168 * int32: seqno -- unused
169 * length-encode: ciphertext
171 * int32: gsm status val
172 * length-encode: plaintext
175 /* message same as eEncrypt */
181 * int32: seqno -- unused
182 * length-encode: message
183 * length-encode: signature
185 * int32: gsm status val
187 eGetVersionAndCapabilities
,
190 * int32: protocol version
191 * int32: capability flags */
192 #define ISSERVER 0x01
194 #define MS_KERBEROS 0x04
195 #define LOGSERVER 0x08
196 #define HAS_MONIKER 0x10
197 /* string: version string
202 * string: target principal name
208 * return to the port on the host:
209 * int32: opcode - for example eLogSetMoniker
212 /* here ended version 7 of the protocol */
215 * string: principal name
216 * string: old password
217 * string: new password
219 * int32: gsm status val
222 /* same as eChangePassword */
224 /* message same as eEncrypt */
226 /* message same as eDecrypt */
227 eConnectLoggingService2
,
230 * int16: log port number
231 * int32: master log prototocol version (0)
233 * wait for master to connect on the master log socket
236 * int32: gsm connection status
237 * int32: maggot log prototocol version (2)
242 * string: moniker (Nickname the master can refer to maggot)
247 * string: extension name
250 * int32: gsm status val
256 * length-encode: certificate (pkcs12 data)
259 * int32: gsm status val (GSMERR_NOT_SUPPORTED)
261 /* here ended version 7 of the protocol */
268 * length-encode: protocol header
269 * length-encode: plaintext
270 * length-encode: protocol trailer
272 * int32: gsm status val
273 * length-encode: ciphertext
281 * length-encode: protocol header
282 * length-encode: ciphertext
283 * length-encode: protocol trailer
285 * int32: gsm status val
286 * length-encode: plaintext
288 /* here ended version 8 of the protocol */
294 #define WRAP_EXP_ONLY_HEADER 1