ssh-gss.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SSH_GSS_H
#define _SSH_GSS_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef GSSAPI
#include "kex.h"
#include "buffer.h"
#ifdef SUNW_GSSAPI
#include <gssapi/gssapi_ext.h>
#else
#ifdef GSS_KRB5
#ifndef HEIMDAL
#include <gssapi_generic.h>
/* MIT Kerberos doesn't seem to define GSS_NT_HOSTBASED_SERVICE */
#ifndef GSS_C_NT_HOSTBASED_SERVICE
#endif /* GSS_C_NT_... */
#endif /* !HEIMDAL */
#endif /* GSS_KRB5 */
#endif /* SUNW_GSSAPI */
/* draft-ietf-secsh-gsskeyex-03 */
#define SSH2_MSG_KEXGSS_INIT 30
#define SSH2_MSG_KEXGSS_CONTINUE 31
#define SSH2_MSG_KEXGSS_COMPLETE 32
#define SSH2_MSG_KEXGSS_HOSTKEY 33
#define SSH2_MSG_KEXGSS_ERROR 34
#define SSH2_MSG_USERAUTH_GSSAPI_RESPONSE 60
#define SSH2_MSG_USERAUTH_GSSAPI_TOKEN 61
#define SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE 63
#define SSH2_MSG_USERAUTH_GSSAPI_ERROR 64
#define SSH2_MSG_USERAUTH_GSSAPI_ERRTOK 65
#define SSH2_MSG_USERAUTH_GSSAPI_MIC 66
#define KEX_GSS_SHA1 "gss-group1-sha1-"
#define SSH_GSS_HOSTBASED_SERVICE "host"
#ifndef HAVE_GSS_STORE_CRED
#endif /* !HAVE_GSS_STORE_CRED */
typedef struct {
int local; /* true on client, false on server */
int established;
int default_creds; /* server-side only */
#ifndef HAVE_GSS_STORE_CRED
#endif /* !HAVE_GSS_STORE_CRED */
} Gssctxt;
/* Functions to get supported mech lists */
/* Functions to get fix KEX proposals (needed for rekey cases) */
/* Map an encoded mechanism keyex name to a mechanism OID */
char **kexname_list);
/*
* Unfortunately, the GSS-API is not generic enough for some things --
* see gss-serv.c and ssh-gss.c
*/
/* GSS_Init/Accept_sec_context() and GSS_Acquire_cred() wrappers */
const char *server_host,
int deleg_creds,
/* MIC wrappers */
/* Gssctxt functions */
/* Server-side */
/* Server-side, if PAM and gss_store_cred() are available, ... */
struct Authctxt; /* needed to avoid conflicts between auth.h, sshconnect2.c */
/* ... else, if other interfaces are available for GSS-API cred storing */
/* Misc */
void *elements,
int der_wrapped);
#endif /* GSSAPI */
#endif /* _SSH_GSS_H */