diff options
Diffstat (limited to 'gss-genr.c')
-rw-r--r-- | gss-genr.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/gss-genr.c b/gss-genr.c index bda12d6f1..6b7caad0e 100644 --- a/gss-genr.c +++ b/gss-genr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: gss-genr.c,v 1.1 2003/08/22 10:56:09 markus Exp $ */ | 1 | /* $OpenBSD: gss-genr.c,v 1.2 2003/11/17 11:06:07 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. | 4 | * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. |
@@ -33,9 +33,12 @@ | |||
33 | #include "compat.h" | 33 | #include "compat.h" |
34 | #include "log.h" | 34 | #include "log.h" |
35 | #include "monitor_wrap.h" | 35 | #include "monitor_wrap.h" |
36 | #include "ssh2.h" | ||
36 | 37 | ||
37 | #include "ssh-gss.h" | 38 | #include "ssh-gss.h" |
38 | 39 | ||
40 | extern u_char *session_id2; | ||
41 | extern u_int session_id2_len; | ||
39 | 42 | ||
40 | /* Check that the OID in a data stream matches that in the context */ | 43 | /* Check that the OID in a data stream matches that in the context */ |
41 | int | 44 | int |
@@ -245,6 +248,28 @@ ssh_gssapi_acquire_cred(Gssctxt *ctx) | |||
245 | } | 248 | } |
246 | 249 | ||
247 | OM_uint32 | 250 | OM_uint32 |
251 | ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_t buffer, gss_buffer_t hash) | ||
252 | { | ||
253 | if ((ctx->major = gss_get_mic(&ctx->minor, ctx->context, | ||
254 | GSS_C_QOP_DEFAULT, buffer, hash))) | ||
255 | ssh_gssapi_error(ctx); | ||
256 | |||
257 | return (ctx->major); | ||
258 | } | ||
259 | |||
260 | void | ||
261 | ssh_gssapi_buildmic(Buffer *b, const char *user, const char *service, | ||
262 | const char *context) | ||
263 | { | ||
264 | buffer_init(b); | ||
265 | buffer_put_string(b, session_id2, session_id2_len); | ||
266 | buffer_put_char(b, SSH2_MSG_USERAUTH_REQUEST); | ||
267 | buffer_put_cstring(b, user); | ||
268 | buffer_put_cstring(b, service); | ||
269 | buffer_put_cstring(b, context); | ||
270 | } | ||
271 | |||
272 | OM_uint32 | ||
248 | ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID oid) { | 273 | ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID oid) { |
249 | if (*ctx) | 274 | if (*ctx) |
250 | ssh_gssapi_delete_ctx(ctx); | 275 | ssh_gssapi_delete_ctx(ctx); |