Path: blob/main/crypto/krb5/src/include/CredentialsCache2.h
34907 views
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/* include/CredentialsCache2.h */2/*3* Copyright 2006 Massachusetts Institute of Technology.4* All Rights Reserved.5*6* Export of this software from the United States of America may7* require a specific license from the United States Government.8* It is the responsibility of any person or organization contemplating9* export to obtain such a license before exporting.10*11* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and12* distribute this software and its documentation for any purpose and13* without fee is hereby granted, provided that the above copyright14* notice appear in all copies and that both that copyright notice and15* this permission notice appear in supporting documentation, and that16* the name of M.I.T. not be used in advertising or publicity pertaining17* to distribution of the software without specific, written prior18* permission. Furthermore if you modify this software you must label19* your software as modified software and not distribute it in such a20* fashion that it might be confused with the original M.I.T. software.21* M.I.T. makes no representations about the suitability of22* this software for any purpose. It is provided "as is" without express23* or implied warranty.24*/2526/*27* This is backwards compatibility for CCache API v2 clients to be able to run28* against the CCache API v3 library29*/3031#ifndef CCAPI_V2_H32#define CCAPI_V2_H3334#include <CredentialsCache.h>3536#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))37#include <TargetConditionals.h>38#include <AvailabilityMacros.h>39#ifdef DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER40#define CCAPI_DEPRECATED DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER41#endif42#endif4344#ifndef CCAPI_DEPRECATED45#define CCAPI_DEPRECATED46#endif4748#ifdef __cplusplus49extern "C" {50#endif /* __cplusplus */5152#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))53#pragma pack(push,2)54#endif5556/* Some old types get directly mapped to new types */5758typedef cc_context_d apiCB;59typedef cc_ccache_d ccache_p;60typedef cc_credentials_iterator_d ccache_cit_creds;61typedef cc_ccache_iterator_d ccache_cit_ccache;62typedef cc_data cc_data_compat;63typedef cc_int32 cc_cred_vers;64typedef cc_int32 cc_result;6566/* This doesn't exist in API v3 */67typedef cc_uint32 cc_flags;6869/* Credentials types are visible to the caller so we have to keep binary compatibility */7071typedef struct cc_credentials_v5_compat {72char* client;73char* server;74cc_data_compat keyblock;75cc_time_t authtime;76cc_time_t starttime;77cc_time_t endtime;78cc_time_t renew_till;79cc_uint32 is_skey;80cc_uint32 ticket_flags;81cc_data_compat** addresses;82cc_data_compat ticket;83cc_data_compat second_ticket;84cc_data_compat** authdata;85} cc_credentials_v5_compat;8687enum {88KRB_NAME_SZ = 40,89KRB_INSTANCE_SZ = 40,90KRB_REALM_SZ = 4091};9293typedef union cred_ptr_union_compat {94cc_credentials_v5_compat* pV5Cred;95} cred_ptr_union_compat;9697typedef struct cred_union {98cc_int32 cred_type; /* cc_cred_vers */99cred_ptr_union_compat cred;100} cred_union;101102/* NC info structure is gone in v3 */103104struct infoNC {105char* name;106char* principal;107cc_int32 vers;108};109110typedef struct infoNC infoNC;111112/* Some old type names */113114typedef cc_credentials_v5_compat cc_creds;115struct ccache_cit;116typedef struct ccache_cit ccache_cit;117118enum {119CC_API_VER_2 = ccapi_version_2120};121122enum {123CC_NOERROR,124CC_BADNAME,125CC_NOTFOUND,126CC_END,127CC_IO,128CC_WRITE,129CC_NOMEM,130CC_FORMAT,131CC_LOCKED,132CC_BAD_API_VERSION,133CC_NO_EXIST,134CC_NOT_SUPP,135CC_BAD_PARM,136CC_ERR_CACHE_ATTACH,137CC_ERR_CACHE_RELEASE,138CC_ERR_CACHE_FULL,139CC_ERR_CRED_VERSION140};141142enum {143CC_CRED_UNKNOWN,144/* CC_CRED_V4, */145CC_CRED_V5,146CC_CRED_MAX147};148149enum {150CC_LOCK_UNLOCK = 1,151CC_LOCK_READER = 2,152CC_LOCK_WRITER = 3,153CC_LOCK_NOBLOCK = 16154};155156CCACHE_API cc_int32157cc_shutdown (apiCB **io_context)158CCAPI_DEPRECATED;159160CCACHE_API cc_int32161cc_get_NC_info (apiCB *in_context,162infoNC ***out_info)163CCAPI_DEPRECATED;164165CCACHE_API cc_int32166cc_get_change_time (apiCB *in_context,167cc_time_t *out_change_time)168CCAPI_DEPRECATED;169170CCACHE_API cc_int32171cc_open (apiCB *in_context,172const char *in_name,173cc_int32 in_version,174cc_uint32 in_flags,175ccache_p **out_ccache)176CCAPI_DEPRECATED;177178CCACHE_API cc_int32179cc_create (apiCB *in_context,180const char *in_name,181const char *in_principal,182cc_int32 in_version,183cc_uint32 in_flags,184ccache_p **out_ccache)185CCAPI_DEPRECATED;186187CCACHE_API cc_int32188cc_close (apiCB *in_context,189ccache_p **ioCCache)190CCAPI_DEPRECATED;191192CCACHE_API cc_int32193cc_destroy (apiCB *in_context,194ccache_p **io_ccache)195CCAPI_DEPRECATED;196197CCACHE_API cc_int32198cc_seq_fetch_NCs_begin (apiCB *in_context,199ccache_cit **out_nc_iterator)200CCAPI_DEPRECATED;201202CCACHE_API cc_int32203cc_seq_fetch_NCs_next (apiCB *in_context,204ccache_p **out_ccache,205ccache_cit *in_nc_iterator)206CCAPI_DEPRECATED;207208CCACHE_API cc_int32209cc_seq_fetch_NCs_end (apiCB *in_context,210ccache_cit **io_nc_iterator)211CCAPI_DEPRECATED;212213CCACHE_API cc_int32214cc_get_name (apiCB *in_context,215ccache_p *in_ccache,216char **out_name)217CCAPI_DEPRECATED;218219CCACHE_API cc_int32220cc_get_cred_version (apiCB *in_context,221ccache_p *in_ccache,222cc_int32 *out_version)223CCAPI_DEPRECATED;224225CCACHE_API cc_int32226cc_set_principal (apiCB *in_context,227ccache_p *in_ccache,228cc_int32 in_version,229char *in_principal)230CCAPI_DEPRECATED;231232CCACHE_API cc_int32233cc_get_principal (apiCB *in_context,234ccache_p *in_ccache,235char **out_principal)236CCAPI_DEPRECATED;237238CCACHE_API cc_int32239cc_store (apiCB *in_context,240ccache_p *in_ccache,241cred_union in_credentials)242CCAPI_DEPRECATED;243244CCACHE_API cc_int32245cc_remove_cred (apiCB *in_context,246ccache_p *in_ccache,247cred_union in_credentials)248CCAPI_DEPRECATED;249250CCACHE_API cc_int32251cc_seq_fetch_creds_begin (apiCB *in_context,252const ccache_p *in_ccache,253ccache_cit **out_ccache_iterator)254CCAPI_DEPRECATED;255256CCACHE_API cc_int32257cc_seq_fetch_creds_next (apiCB *in_context,258cred_union **out_cred_union,259ccache_cit *in_ccache_iterator)260CCAPI_DEPRECATED;261262CCACHE_API cc_int32263cc_seq_fetch_creds_end (apiCB *in_context,264ccache_cit **io_ccache_iterator)265CCAPI_DEPRECATED;266267CCACHE_API cc_int32268cc_free_principal (apiCB *in_context,269char **io_principal)270CCAPI_DEPRECATED;271272CCACHE_API cc_int32273cc_free_name (apiCB *in_context,274char **io_name)275CCAPI_DEPRECATED;276277CCACHE_API cc_int32278cc_free_creds (apiCB *in_context,279cred_union **io_cred_union)280CCAPI_DEPRECATED;281282CCACHE_API cc_int32283cc_free_NC_info (apiCB *in_context,284infoNC ***io_info)285CCAPI_DEPRECATED;286287CCACHE_API cc_int32288cc_lock_request (apiCB *in_context,289const ccache_p *in_ccache,290const cc_int32 in_lock_type)291CCAPI_DEPRECATED;292293#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))294#pragma pack(pop)295#endif296297#ifdef __cplusplus298}299#endif /* __cplusplus */300301#endif /* CCAPI_V2_H */302303304