]> git.saurik.com Git - apple/network_cmds.git/blame - racoon.tproj/gssapi.h
network_cmds-245.19.tar.gz
[apple/network_cmds.git] / racoon.tproj / gssapi.h
CommitLineData
ac2f15b3 1/* $KAME: gssapi.h,v 1.5 2002/05/07 18:13:25 sakane Exp $ */
7ba0088d
A
2
3/*
4 * Copyright 2000 Wasabi Systems, Inc.
5 * All rights reserved.
6 *
7 * This software was written by Frank van der Linden of Wasabi Systems
8 * for Zembu Labs, Inc. http://www.zembu.com/
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by Wasabi Systems for
21 * Zembu Labs, Inc. http://www.zembu.com/
22 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
23 * or promote products derived from this software without specific prior
24 * written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
2b484d24
A
39#ifndef __GSSAPI_H__
40#define __GSSAPI_H__
41
42
7ba0088d
A
43#include <gssapi/gssapi.h>
44
45#define GSSAPI_DEF_NAME "ike"
46
47struct ph1handle;
48struct isakmpsa;
49
50struct gssapi_ph1_state {
51 int gsscnt; /* # of token we're working on */
52 int gsscnt_p; /* # of token we're working on */
53
54 gss_buffer_desc gss[3]; /* gss-api tokens. */
55 /* NOTE: XXX this restricts the max # */
56 /* to 3. More should never happen */
57
58 gss_buffer_desc gss_p[3];
59
60 gss_ctx_id_t gss_context; /* context for gss_init_sec_context */
61
62 OM_uint32 gss_status; /* retval from gss_init_sec_context */
63 gss_cred_id_t gss_cred; /* acquired credentials */
64
65 int gss_flags;
66#define GSSFLAG_ID_SENT 0x0001
67#define GSSFLAG_ID_RCVD 0x0001
68};
69
70#define gssapi_get_state(ph) \
71 ((struct gssapi_ph1_state *)((ph)->gssapi_state))
72
73#define gssapi_set_state(ph, st) \
74 (ph)->gssapi_state = (st)
75
76#define gssapi_more_tokens(ph) \
77 ((gssapi_get_state(ph)->gss_status & GSS_S_CONTINUE_NEEDED) != 0)
78
79int gssapi_get_itoken __P((struct ph1handle *, int *));
80int gssapi_get_rtoken __P((struct ph1handle *, int *));
81int gssapi_save_received_token __P((struct ph1handle *, vchar_t *));
82int gssapi_get_token_to_send __P((struct ph1handle *, vchar_t **));
83int gssapi_get_itokens __P((struct ph1handle *, vchar_t **));
84int gssapi_get_rtokens __P((struct ph1handle *, vchar_t **));
85vchar_t *gssapi_wraphash __P((struct ph1handle *));
86vchar_t *gssapi_unwraphash __P((struct ph1handle *));
87void gssapi_set_id_sent __P((struct ph1handle *));
88int gssapi_id_sent __P((struct ph1handle *));
89void gssapi_set_id_rcvd __P((struct ph1handle *));
90int gssapi_id_rcvd __P((struct ph1handle *));
91void gssapi_free_state __P((struct ph1handle *));
92vchar_t *gssapi_get_default_id __P((struct ph1handle *));
2b484d24
A
93
94
95#endif /* __GSSAPI_H__ */
96