summaryrefslogtreecommitdiff
path: root/gss-serv.c
diff options
context:
space:
mode:
Diffstat (limited to 'gss-serv.c')
-rw-r--r--gss-serv.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/gss-serv.c b/gss-serv.c
index bc498fd47..e157ec515 100644
--- a/gss-serv.c
+++ b/gss-serv.c
@@ -1,7 +1,7 @@
1/* $OpenBSD: gss-serv.c,v 1.21 2007/06/12 08:20:00 djm Exp $ */ 1/* $OpenBSD: gss-serv.c,v 1.21 2007/06/12 08:20:00 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. 4 * Copyright (c) 2001-2006 Simon Wilkinson. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
@@ -44,8 +44,12 @@
44#include "channels.h" 44#include "channels.h"
45#include "session.h" 45#include "session.h"
46#include "misc.h" 46#include "misc.h"
47#include "servconf.h"
47 48
48#include "ssh-gss.h" 49#include "ssh-gss.h"
50#include "monitor_wrap.h"
51
52extern ServerOptions options;
49 53
50static ssh_gssapi_client gssapi_client = 54static ssh_gssapi_client gssapi_client =
51 { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER, 55 { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER,
@@ -113,6 +117,28 @@ ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID oid)
113} 117}
114 118
115/* Unprivileged */ 119/* Unprivileged */
120char *
121ssh_gssapi_server_mechanisms() {
122 gss_OID_set supported;
123
124 ssh_gssapi_supported_oids(&supported);
125 return (ssh_gssapi_kex_mechs(supported, &ssh_gssapi_server_check_mech,
126 NULL));
127}
128
129/* Unprivileged */
130int
131ssh_gssapi_server_check_mech(Gssctxt **dum, gss_OID oid, const char *data) {
132 Gssctxt *ctx = NULL;
133 int res;
134
135 res = !GSS_ERROR(PRIVSEP(ssh_gssapi_server_ctx(&ctx, oid)));
136 ssh_gssapi_delete_ctx(&ctx);
137
138 return (res);
139}
140
141/* Unprivileged */
116void 142void
117ssh_gssapi_supported_oids(gss_OID_set *oidset) 143ssh_gssapi_supported_oids(gss_OID_set *oidset)
118{ 144{
@@ -351,14 +377,4 @@ ssh_gssapi_userok(char *user)
351 return (0); 377 return (0);
352} 378}
353 379
354/* Privileged */
355OM_uint32
356ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic)
357{
358 ctx->major = gss_verify_mic(&ctx->minor, ctx->context,
359 gssbuf, gssmic, NULL);
360
361 return (ctx->major);
362}
363
364#endif 380#endif