Path: blob/main/crypto/heimdal/lib/gssapi/spnego/spnego_locl.h
34907 views
/*1* Copyright (c) 2004, PADL Software Pty Ltd.2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7*8* 1. Redistributions of source code must retain the above copyright9* notice, this list of conditions and the following disclaimer.10*11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* 3. Neither the name of PADL Software nor the names of its contributors16* may be used to endorse or promote products derived from this software17* without specific prior written permission.18*19* THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND20* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE21* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE22* ARE DISCLAIMED. IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE23* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL24* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS25* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)26* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT27* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY28* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF29* SUCH DAMAGE.30*/3132/* $Id$ */3334#ifndef SPNEGO_LOCL_H35#define SPNEGO_LOCL_H3637#include <config.h>3839#ifdef HAVE_SYS_TYPES_H40#include <sys/types.h>41#endif42#ifdef HAVE_SYS_PARAM_H43#include <sys/param.h>44#endif4546#include <roken.h>4748#ifdef HAVE_PTHREAD_H49#include <pthread.h>50#endif5152#include <gssapi.h>53#include <gssapi_krb5.h>54#include <gssapi_spnego.h>55#include <assert.h>56#include <stdlib.h>57#include <string.h>58#include <errno.h>59#include <ctype.h>60#ifdef HAVE_NETDB_H61#include <netdb.h>62#endif6364#include <heim_threads.h>65#include <asn1_err.h>6667#include <gssapi_mech.h>6869#include "spnego_asn1.h"70#include "utils.h"71#include <der.h>7273#include <heimbase.h>7475#define ALLOC(X, N) (X) = calloc((N), sizeof(*(X)))7677typedef struct {78MechTypeList initiator_mech_types;79gss_OID preferred_mech_type;80gss_OID negotiated_mech_type;81gss_ctx_id_t negotiated_ctx_id;82OM_uint32 mech_flags;83OM_uint32 mech_time_rec;84gss_name_t mech_src_name;85unsigned int open : 1;86unsigned int local : 1;87unsigned int require_mic : 1;88unsigned int verified_mic : 1;89unsigned int maybe_open : 1;90HEIMDAL_MUTEX ctx_id_mutex;9192gss_name_t target_name;9394u_char oidbuf[17];95size_t oidlen;9697} *gssspnego_ctx;9899typedef struct {100gss_OID_desc type;101gss_buffer_desc value;102gss_name_t mech;103} *spnego_name;104105extern gss_OID_desc _gss_spnego_mskrb_mechanism_oid_desc;106extern gss_OID_desc _gss_spnego_krb5_mechanism_oid_desc;107108#include <spnego-private.h>109110#endif /* SPNEGO_LOCL_H */111112113