summaryrefslogtreecommitdiff
path: root/ssh-gss.h
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-gss.h')
-rw-r--r--ssh-gss.h39
1 files changed, 35 insertions, 4 deletions
diff --git a/ssh-gss.h b/ssh-gss.h
index c29a1b7e7..31d5a0835 100644
--- a/ssh-gss.h
+++ b/ssh-gss.h
@@ -1,6 +1,6 @@
1/* $OpenBSD: ssh-gss.h,v 1.10 2007/06/12 08:20:00 djm Exp $ */ 1/* $OpenBSD: ssh-gss.h,v 1.10 2007/06/12 08:20:00 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. 3 * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
@@ -60,10 +60,22 @@
60 60
61#define SSH_GSS_OIDTYPE 0x06 61#define SSH_GSS_OIDTYPE 0x06
62 62
63#define SSH2_MSG_KEXGSS_INIT 30
64#define SSH2_MSG_KEXGSS_CONTINUE 31
65#define SSH2_MSG_KEXGSS_COMPLETE 32
66#define SSH2_MSG_KEXGSS_HOSTKEY 33
67#define SSH2_MSG_KEXGSS_ERROR 34
68#define SSH2_MSG_KEXGSS_GROUPREQ 40
69#define SSH2_MSG_KEXGSS_GROUP 41
70#define KEX_GSS_GRP1_SHA1_ID "gss-group1-sha1-"
71#define KEX_GSS_GRP14_SHA1_ID "gss-group14-sha1-"
72#define KEX_GSS_GEX_SHA1_ID "gss-gex-sha1-"
73
63typedef struct { 74typedef struct {
64 char *filename; 75 char *filename;
65 char *envvar; 76 char *envvar;
66 char *envval; 77 char *envval;
78 struct passwd *owner;
67 void *data; 79 void *data;
68} ssh_gssapi_ccache; 80} ssh_gssapi_ccache;
69 81
@@ -71,8 +83,11 @@ typedef struct {
71 gss_buffer_desc displayname; 83 gss_buffer_desc displayname;
72 gss_buffer_desc exportedname; 84 gss_buffer_desc exportedname;
73 gss_cred_id_t creds; 85 gss_cred_id_t creds;
86 gss_name_t name;
74 struct ssh_gssapi_mech_struct *mech; 87 struct ssh_gssapi_mech_struct *mech;
75 ssh_gssapi_ccache store; 88 ssh_gssapi_ccache store;
89 int used;
90 int updated;
76} ssh_gssapi_client; 91} ssh_gssapi_client;
77 92
78typedef struct ssh_gssapi_mech_struct { 93typedef struct ssh_gssapi_mech_struct {
@@ -83,6 +98,7 @@ typedef struct ssh_gssapi_mech_struct {
83 int (*userok) (ssh_gssapi_client *, char *); 98 int (*userok) (ssh_gssapi_client *, char *);
84 int (*localname) (ssh_gssapi_client *, char **); 99 int (*localname) (ssh_gssapi_client *, char **);
85 void (*storecreds) (ssh_gssapi_client *); 100 void (*storecreds) (ssh_gssapi_client *);
101 int (*updatecreds) (ssh_gssapi_ccache *, ssh_gssapi_client *);
86} ssh_gssapi_mech; 102} ssh_gssapi_mech;
87 103
88typedef struct { 104typedef struct {
@@ -93,10 +109,11 @@ typedef struct {
93 gss_OID oid; /* client */ 109 gss_OID oid; /* client */
94 gss_cred_id_t creds; /* server */ 110 gss_cred_id_t creds; /* server */
95 gss_name_t client; /* server */ 111 gss_name_t client; /* server */
96 gss_cred_id_t client_creds; /* server */ 112 gss_cred_id_t client_creds; /* both */
97} Gssctxt; 113} Gssctxt;
98 114
99extern ssh_gssapi_mech *supported_mechs[]; 115extern ssh_gssapi_mech *supported_mechs[];
116extern Gssctxt *gss_kex_context;
100 117
101int ssh_gssapi_check_oid(Gssctxt *, void *, size_t); 118int ssh_gssapi_check_oid(Gssctxt *, void *, size_t);
102void ssh_gssapi_set_oid_data(Gssctxt *, void *, size_t); 119void ssh_gssapi_set_oid_data(Gssctxt *, void *, size_t);
@@ -116,16 +133,30 @@ void ssh_gssapi_build_ctx(Gssctxt **);
116void ssh_gssapi_delete_ctx(Gssctxt **); 133void ssh_gssapi_delete_ctx(Gssctxt **);
117OM_uint32 ssh_gssapi_sign(Gssctxt *, gss_buffer_t, gss_buffer_t); 134OM_uint32 ssh_gssapi_sign(Gssctxt *, gss_buffer_t, gss_buffer_t);
118void ssh_gssapi_buildmic(Buffer *, const char *, const char *, const char *); 135void ssh_gssapi_buildmic(Buffer *, const char *, const char *, const char *);
119int ssh_gssapi_check_mechanism(Gssctxt **, gss_OID, const char *); 136int ssh_gssapi_check_mechanism(Gssctxt **, gss_OID, const char *, const char *);
137OM_uint32 ssh_gssapi_client_identity(Gssctxt *, const char *);
138int ssh_gssapi_credentials_updated(Gssctxt *);
120 139
121/* In the server */ 140/* In the server */
141typedef int ssh_gssapi_check_fn(Gssctxt **, gss_OID, const char *,
142 const char *);
143char *ssh_gssapi_client_mechanisms(const char *, const char *);
144char *ssh_gssapi_kex_mechs(gss_OID_set, ssh_gssapi_check_fn *, const char *,
145 const char *);
146gss_OID ssh_gssapi_id_kex(Gssctxt *, char *, int);
147int ssh_gssapi_server_check_mech(Gssctxt **,gss_OID, const char *,
148 const char *);
122OM_uint32 ssh_gssapi_server_ctx(Gssctxt **, gss_OID); 149OM_uint32 ssh_gssapi_server_ctx(Gssctxt **, gss_OID);
123int ssh_gssapi_userok(char *name); 150int ssh_gssapi_userok(char *name, struct passwd *);
124OM_uint32 ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t); 151OM_uint32 ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t);
125void ssh_gssapi_do_child(char ***, u_int *); 152void ssh_gssapi_do_child(char ***, u_int *);
126void ssh_gssapi_cleanup_creds(void); 153void ssh_gssapi_cleanup_creds(void);
127void ssh_gssapi_storecreds(void); 154void ssh_gssapi_storecreds(void);
128 155
156char *ssh_gssapi_server_mechanisms(void);
157int ssh_gssapi_oid_table_ok();
158
159int ssh_gssapi_update_creds(ssh_gssapi_ccache *store);
129#endif /* GSSAPI */ 160#endif /* GSSAPI */
130 161
131#endif /* _SSH_GSS_H */ 162#endif /* _SSH_GSS_H */