Annotation of src/usr.bin/ssh/ssh-gss.h, Revision 1.3
1.3 ! markus 1: /* $OpenBSD: authfd.h,v 1.33 2003/06/11 11:18:38 djm Exp $ */
1.1 markus 2: /*
3: * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
4: *
5: * Redistribution and use in source and binary forms, with or without
6: * modification, are permitted provided that the following conditions
7: * are met:
8: * 1. Redistributions of source code must retain the above copyright
9: * notice, this list of conditions and the following disclaimer.
10: * 2. Redistributions in binary form must reproduce the above copyright
11: * notice, this list of conditions and the following disclaimer in the
12: * documentation and/or other materials provided with the distribution.
13: *
14: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
15: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24: */
25:
26: #ifndef _SSH_GSS_H
27: #define _SSH_GSS_H
28:
29: #ifdef GSSAPI
30:
31: #include "buffer.h"
32:
33: #include <gssapi.h>
34:
35: /* draft-ietf-secsh-gsskeyex-06 */
36: #define SSH2_MSG_USERAUTH_GSSAPI_RESPONSE 60
37: #define SSH2_MSG_USERAUTH_GSSAPI_TOKEN 61
38: #define SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE 63
39: #define SSH2_MSG_USERAUTH_GSSAPI_ERROR 64
40: #define SSH2_MSG_USERAUTH_GSSAPI_ERRTOK 65
41:
42: #define SSH_GSS_OIDTYPE 0x06
43:
44: typedef struct {
45: char *filename;
46: char *envvar;
47: char *envval;
48: void *data;
49: } ssh_gssapi_ccache;
50:
51: typedef struct {
52: gss_buffer_desc displayname;
53: gss_buffer_desc exportedname;
54: gss_cred_id_t creds;
55: struct ssh_gssapi_mech_struct *mech;
56: ssh_gssapi_ccache store;
57: } ssh_gssapi_client;
58:
59: typedef struct ssh_gssapi_mech_struct {
60: char *enc_name;
61: char *name;
62: gss_OID_desc oid;
63: int (*dochild) (ssh_gssapi_client *);
64: int (*userok) (ssh_gssapi_client *, char *);
65: int (*localname) (ssh_gssapi_client *, char **);
66: void (*storecreds) (ssh_gssapi_client *);
67: } ssh_gssapi_mech;
68:
69: typedef struct {
70: OM_uint32 major; /* both */
71: OM_uint32 minor; /* both */
72: gss_ctx_id_t context; /* both */
73: gss_name_t name; /* both */
74: gss_OID oid; /* client */
75: gss_cred_id_t creds; /* server */
76: gss_name_t client; /* server */
77: gss_cred_id_t client_creds; /* server */
78: } Gssctxt;
79:
80: extern ssh_gssapi_mech *supported_mechs[];
81:
82: int ssh_gssapi_check_oid(Gssctxt *ctx, void *data, size_t len);
83: void ssh_gssapi_set_oid_data(Gssctxt *ctx, void *data, size_t len);
84: void ssh_gssapi_set_oid(Gssctxt *ctx, gss_OID oid);
85: void ssh_gssapi_supported_oids(gss_OID_set *oidset);
86: ssh_gssapi_mech *ssh_gssapi_get_ctype(Gssctxt *ctxt);
87:
88: OM_uint32 ssh_gssapi_import_name(Gssctxt *ctx, const char *host);
89: OM_uint32 ssh_gssapi_acquire_cred(Gssctxt *ctx);
90: OM_uint32 ssh_gssapi_init_ctx(Gssctxt *ctx, int deleg_creds,
91: gss_buffer_desc *recv_tok, gss_buffer_desc *send_tok, OM_uint32 *flags);
92: OM_uint32 ssh_gssapi_accept_ctx(Gssctxt *ctx,
93: gss_buffer_desc *recv_tok, gss_buffer_desc *send_tok, OM_uint32 *flags);
94: OM_uint32 ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *);
95: void ssh_gssapi_error(Gssctxt *ctx);
96: char *ssh_gssapi_last_error(Gssctxt *ctxt, OM_uint32 *maj, OM_uint32 *min);
97: void ssh_gssapi_build_ctx(Gssctxt **ctx);
98: void ssh_gssapi_delete_ctx(Gssctxt **ctx);
99: OM_uint32 ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID oid);
100:
101: /* In the server */
102: int ssh_gssapi_userok(char *name);
103:
104: void ssh_gssapi_do_child(char ***envp, u_int *envsizep);
1.2 markus 105: void ssh_gssapi_cleanup_creds(void);
1.1 markus 106: void ssh_gssapi_storecreds(void);
107:
108: #endif /* GSSAPI */
109:
110: #endif /* _SSH_GSS_H */