diff options
Diffstat (limited to 'ssh-gss.h')
-rw-r--r-- | ssh-gss.h | 39 |
1 files changed, 35 insertions, 4 deletions
@@ -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 | |||
63 | typedef struct { | 74 | typedef 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 | ||
78 | typedef struct ssh_gssapi_mech_struct { | 93 | typedef 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 | ||
88 | typedef struct { | 104 | typedef 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 | ||
99 | extern ssh_gssapi_mech *supported_mechs[]; | 115 | extern ssh_gssapi_mech *supported_mechs[]; |
116 | extern Gssctxt *gss_kex_context; | ||
100 | 117 | ||
101 | int ssh_gssapi_check_oid(Gssctxt *, void *, size_t); | 118 | int ssh_gssapi_check_oid(Gssctxt *, void *, size_t); |
102 | void ssh_gssapi_set_oid_data(Gssctxt *, void *, size_t); | 119 | void ssh_gssapi_set_oid_data(Gssctxt *, void *, size_t); |
@@ -116,16 +133,30 @@ void ssh_gssapi_build_ctx(Gssctxt **); | |||
116 | void ssh_gssapi_delete_ctx(Gssctxt **); | 133 | void ssh_gssapi_delete_ctx(Gssctxt **); |
117 | OM_uint32 ssh_gssapi_sign(Gssctxt *, gss_buffer_t, gss_buffer_t); | 134 | OM_uint32 ssh_gssapi_sign(Gssctxt *, gss_buffer_t, gss_buffer_t); |
118 | void ssh_gssapi_buildmic(Buffer *, const char *, const char *, const char *); | 135 | void ssh_gssapi_buildmic(Buffer *, const char *, const char *, const char *); |
119 | int ssh_gssapi_check_mechanism(Gssctxt **, gss_OID, const char *); | 136 | int ssh_gssapi_check_mechanism(Gssctxt **, gss_OID, const char *, const char *); |
137 | OM_uint32 ssh_gssapi_client_identity(Gssctxt *, const char *); | ||
138 | int ssh_gssapi_credentials_updated(Gssctxt *); | ||
120 | 139 | ||
121 | /* In the server */ | 140 | /* In the server */ |
141 | typedef int ssh_gssapi_check_fn(Gssctxt **, gss_OID, const char *, | ||
142 | const char *); | ||
143 | char *ssh_gssapi_client_mechanisms(const char *, const char *); | ||
144 | char *ssh_gssapi_kex_mechs(gss_OID_set, ssh_gssapi_check_fn *, const char *, | ||
145 | const char *); | ||
146 | gss_OID ssh_gssapi_id_kex(Gssctxt *, char *, int); | ||
147 | int ssh_gssapi_server_check_mech(Gssctxt **,gss_OID, const char *, | ||
148 | const char *); | ||
122 | OM_uint32 ssh_gssapi_server_ctx(Gssctxt **, gss_OID); | 149 | OM_uint32 ssh_gssapi_server_ctx(Gssctxt **, gss_OID); |
123 | int ssh_gssapi_userok(char *name); | 150 | int ssh_gssapi_userok(char *name, struct passwd *); |
124 | OM_uint32 ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t); | 151 | OM_uint32 ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t); |
125 | void ssh_gssapi_do_child(char ***, u_int *); | 152 | void ssh_gssapi_do_child(char ***, u_int *); |
126 | void ssh_gssapi_cleanup_creds(void); | 153 | void ssh_gssapi_cleanup_creds(void); |
127 | void ssh_gssapi_storecreds(void); | 154 | void ssh_gssapi_storecreds(void); |
128 | 155 | ||
156 | char *ssh_gssapi_server_mechanisms(void); | ||
157 | int ssh_gssapi_oid_table_ok(); | ||
158 | |||
159 | int 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 */ |