Path: blob/main/crypto/heimdal/lib/gssapi/krb5/gsskrb5_locl.h
34923 views
/*1* Copyright (c) 1997 - 2008 Kungliga Tekniska Högskolan2* (Royal Institute of Technology, Stockholm, Sweden).3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8*9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11*12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* 3. Neither the name of the Institute nor the names of its contributors17* may be used to endorse or promote products derived from this software18* without specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND21* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE22* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE23* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE24* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL25* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS26* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)27* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT28* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY29* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF30* SUCH DAMAGE.31*/3233/* $Id$ */3435#ifndef GSSKRB5_LOCL_H36#define GSSKRB5_LOCL_H3738#include <config.h>3940#include <krb5_locl.h>41#include <gkrb5_err.h>42#include <gssapi.h>43#include <gssapi_mech.h>44#include <gssapi_krb5.h>45#include <assert.h>4647#include "cfx.h"4849/*50*51*/5253struct gss_msg_order;5455typedef struct gsskrb5_ctx {56struct krb5_auth_context_data *auth_context;57struct krb5_auth_context_data *deleg_auth_context;58krb5_principal source, target;59#define IS_DCE_STYLE(ctx) (((ctx)->flags & GSS_C_DCE_STYLE) != 0)60OM_uint32 flags;61enum { LOCAL = 1, OPEN = 2,62COMPAT_OLD_DES3 = 4,63COMPAT_OLD_DES3_SELECTED = 8,64ACCEPTOR_SUBKEY = 16,65RETRIED = 32,66CLOSE_CCACHE = 64,67IS_CFX = 12868} more_flags;69enum gss_ctx_id_t_state {70/* initiator states */71INITIATOR_START,72INITIATOR_RESTART,73INITIATOR_WAIT_FOR_MUTAL,74INITIATOR_READY,75/* acceptor states */76ACCEPTOR_START,77ACCEPTOR_WAIT_FOR_DCESTYLE,78ACCEPTOR_READY79} state;80krb5_creds *kcred;81krb5_ccache ccache;82struct krb5_ticket *ticket;83OM_uint32 lifetime;84HEIMDAL_MUTEX ctx_id_mutex;85struct gss_msg_order *order;86krb5_keyblock *service_keyblock;87krb5_data fwd_data;88krb5_crypto crypto;89} *gsskrb5_ctx;9091typedef struct {92krb5_principal principal;93int cred_flags;94#define GSS_CF_DESTROY_CRED_ON_RELEASE 195#define GSS_CF_NO_CI_FLAGS 296struct krb5_keytab_data *keytab;97OM_uint32 lifetime;98gss_cred_usage_t usage;99gss_OID_set mechanisms;100struct krb5_ccache_data *ccache;101HEIMDAL_MUTEX cred_id_mutex;102krb5_enctype *enctypes;103} *gsskrb5_cred;104105typedef struct Principal *gsskrb5_name;106107/*108*109*/110111extern krb5_keytab _gsskrb5_keytab;112extern HEIMDAL_MUTEX gssapi_keytab_mutex;113114/*115* Prototypes116*/117118#include <gsskrb5-private.h>119120#define GSSAPI_KRB5_INIT(ctx) do { \121krb5_error_code kret_gss_init; \122if((kret_gss_init = _gsskrb5_init (ctx)) != 0) { \123*minor_status = kret_gss_init; \124return GSS_S_FAILURE; \125} \126} while (0)127128/* sec_context flags */129130#define SC_LOCAL_ADDRESS 0x01131#define SC_REMOTE_ADDRESS 0x02132#define SC_KEYBLOCK 0x04133#define SC_LOCAL_SUBKEY 0x08134#define SC_REMOTE_SUBKEY 0x10135136/* type to signal that that dns canon maybe should be done */137#define MAGIC_HOSTBASED_NAME_TYPE 4711138139#endif140141142