summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorAlexandra Ellwood <lxs@mit.edu>2007-05-31 21:06:54 +0000
committerAlexandra Ellwood <lxs@mit.edu>2007-05-31 21:06:54 +0000
commitd45eeb7f708d5be2e9fbdbc54a04655776074f6c (patch)
tree5ab3d7e31f285ac4d6900d3abc647cbb53a05f8d /src/include
parent66bd29f512b9bdd5e808d645118862112973d2d6 (diff)
downloadkrb5-d45eeb7f708d5be2e9fbdbc54a04655776074f6c.tar.gz
krb5-d45eeb7f708d5be2e9fbdbc54a04655776074f6c.tar.xz
krb5-d45eeb7f708d5be2e9fbdbc54a04655776074f6c.zip
Move CCAPI sources to krb5 repository
ticket: new status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19564 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
-rw-r--r--src/include/CredentialsCache.h552
-rw-r--r--src/include/CredentialsCache2.h326
2 files changed, 878 insertions, 0 deletions
diff --git a/src/include/CredentialsCache.h b/src/include/CredentialsCache.h
new file mode 100644
index 0000000000..51242bbefa
--- /dev/null
+++ b/src/include/CredentialsCache.h
@@ -0,0 +1,552 @@
+/*
+ * $Header$
+ *
+ * Copyright 1998-2006 Massachusetts Institute of Technology.
+ * All Rights Reserved.
+ *
+ * Export of this software from the United States of America may
+ * require a specific license from the United States Government.
+ * It is the responsibility of any person or organization contemplating
+ * export to obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of M.I.T. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. Furthermore if you modify this software you must label
+ * your software as modified software and not distribute it in such a
+ * fashion that it might be confused with the original M.I.T. software.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ */
+
+#ifndef __CREDENTIALSCACHE__
+#define __CREDENTIALSCACHE__
+
+#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
+#include <TargetConditionals.h>
+#endif
+
+#if defined(_WIN32)
+#include <winsock.h>
+#else
+#include <sys/types.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#if TARGET_OS_MAC
+#pragma pack(push,2)
+#endif
+
+#if defined(_WIN32)
+#define CCACHE_API __declspec(dllexport)
+
+#if _INTEGRAL_MAX_BITS >= 64 && _MSC_VER >= 1400 && !defined(_WIN64) && !defined(_USE_32BIT_TIME_T)
+#if defined(_TIME_T_DEFINED) || defined(_INC_IO) || defined(_INC_TIME) || defined(_INC_WCHAR)
+#error time_t has been defined as a 64-bit integer which is incompatible with Kerberos on this platform.
+#endif /* _TIME_T_DEFINED */
+#define _USE_32BIT_TIME_T
+#endif
+#else
+#define CCACHE_API
+#endif
+
+#include <time.h>
+
+/*
+ * Constants
+ */
+
+/* API versions */
+enum {
+ ccapi_version_2 = 2,
+ ccapi_version_3 = 3,
+ ccapi_version_4 = 4,
+ ccapi_version_5 = 5,
+ ccapi_version_6 = 6,
+ ccapi_version_max = ccapi_version_6
+};
+
+/* Errors */
+enum {
+ ccNoError = 0,
+
+ ccIteratorEnd = 201,
+ ccErrBadParam,
+ ccErrNoMem,
+ ccErrInvalidContext,
+ ccErrInvalidCCache,
+
+ ccErrInvalidString, /* 206 */
+ ccErrInvalidCredentials,
+ ccErrInvalidCCacheIterator,
+ ccErrInvalidCredentialsIterator,
+ ccErrInvalidLock,
+
+ ccErrBadName, /* 211 */
+ ccErrBadCredentialsVersion,
+ ccErrBadAPIVersion,
+ ccErrContextLocked,
+ ccErrContextUnlocked,
+
+ ccErrCCacheLocked, /* 216 */
+ ccErrCCacheUnlocked,
+ ccErrBadLockType,
+ ccErrNeverDefault,
+ ccErrCredentialsNotFound,
+
+ ccErrCCacheNotFound, /* 221 */
+ ccErrContextNotFound,
+ ccErrServerUnavailable,
+ ccErrServerInsecure,
+ ccErrServerCantBecomeUID,
+
+ ccErrTimeOffsetNotSet, /* 226 */
+ ccErrBadInternalMessage,
+ ccErrNotImplemented,
+ ccErrClientNotFound
+};
+
+/* Credentials versions */
+enum cc_credential_versions {
+ cc_credentials_v4 = 1,
+ cc_credentials_v5 = 2,
+ cc_credentials_v4_v5 = 3
+};
+
+/* Lock types */
+enum cc_lock_types {
+ cc_lock_read = 0,
+ cc_lock_write = 1,
+ cc_lock_upgrade = 2,
+ cc_lock_downgrade = 3
+};
+
+/* Locking Modes */
+enum cc_lock_modes {
+ cc_lock_noblock = 0,
+ cc_lock_block = 1
+};
+
+/* Basic types */
+
+typedef uint32_t cc_uint32;
+typedef int32_t cc_int32;
+#if defined (WIN32)
+typedef __int64 cc_int64;
+typedef unsigned __int64 cc_uint64;
+#else
+typedef int64_t cc_int64;
+typedef uint64_t cc_uint64;
+#endif
+typedef cc_uint32 cc_time_t;
+
+/* API types */
+
+/* Forward declarations */
+struct cc_context_f;
+typedef struct cc_context_f cc_context_f;
+
+struct cc_ccache_f;
+typedef struct cc_ccache_f cc_ccache_f;
+
+struct cc_ccache_iterator_f;
+typedef struct cc_ccache_iterator_f cc_ccache_iterator_f;
+
+struct cc_ccache_iterator_f;
+typedef struct cc_credentials_iterator_f cc_credentials_iterator_f;
+
+struct cc_string_f;
+typedef struct cc_string_f cc_string_f;
+
+struct cc_credentials_f;
+typedef struct cc_credentials_f cc_credentials_f;
+
+/* Credentials types */
+
+enum { /* Make sure all of these are multiples of four (for alignment sanity) */
+ cc_v4_name_size = 40,
+ cc_v4_instance_size = 40,
+ cc_v4_realm_size = 40,
+ cc_v4_ticket_size = 1254,
+ cc_v4_key_size = 8
+};
+
+enum cc_string_to_key_type {
+ cc_v4_stk_afs = 0,
+ cc_v4_stk_des = 1,
+ cc_v4_stk_columbia_special = 2,
+ cc_v4_stk_krb5 = 3,
+ cc_v4_stk_unknown = 4
+};
+
+struct cc_credentials_v4_t {
+ cc_uint32 version;
+ char principal [cc_v4_name_size];
+ char principal_instance [cc_v4_instance_size];
+ char service [cc_v4_name_size];
+ char service_instance [cc_v4_instance_size];
+ char realm [cc_v4_realm_size];
+ unsigned char session_key [cc_v4_key_size];
+ cc_int32 kvno;
+ cc_int32 string_to_key_type;
+ cc_time_t issue_date;
+ cc_int32 lifetime;
+ cc_uint32 address;
+ cc_int32 ticket_size;
+ unsigned char ticket [cc_v4_ticket_size];
+};
+typedef struct cc_credentials_v4_t cc_credentials_v4_t;
+
+struct cc_data {
+ cc_uint32 type;
+ cc_uint32 length;
+ void* data;
+};
+typedef struct cc_data cc_data;
+
+struct cc_credentials_v5_t {
+ char* client;
+ char* server;
+ cc_data keyblock;
+ cc_time_t authtime;
+ cc_time_t starttime;
+ cc_time_t endtime;
+ cc_time_t renew_till;
+ cc_uint32 is_skey;
+ cc_uint32 ticket_flags;
+ cc_data** addresses;
+ cc_data ticket;
+ cc_data second_ticket;
+ cc_data** authdata;
+};
+typedef struct cc_credentials_v5_t cc_credentials_v5_t;
+
+struct cc_credentials_union {
+ cc_uint32 version;
+ union {
+ cc_credentials_v4_t* credentials_v4;
+ cc_credentials_v5_t* credentials_v5;
+ } credentials;
+};
+typedef struct cc_credentials_union cc_credentials_union;
+
+/* Exposed parts */
+
+struct cc_context_d {
+ const cc_context_f *functions;
+#if TARGET_OS_MAC
+ const cc_context_f *vector_functions;
+#endif
+};
+typedef struct cc_context_d cc_context_d;
+typedef cc_context_d *cc_context_t;
+
+struct cc_ccache_d {
+ const cc_ccache_f *functions;
+#if TARGET_OS_MAC
+ const cc_ccache_f *vector_functions;
+#endif
+};
+typedef struct cc_ccache_d cc_ccache_d;
+typedef cc_ccache_d *cc_ccache_t;
+
+struct cc_ccache_iterator_d {
+ const cc_ccache_iterator_f *functions;
+#if TARGET_OS_MAC
+ const cc_ccache_iterator_f *vector_functions;
+#endif
+};
+typedef struct cc_ccache_iterator_d cc_ccache_iterator_d;
+typedef cc_ccache_iterator_d *cc_ccache_iterator_t;
+
+struct cc_credentials_iterator_d {
+ const cc_credentials_iterator_f *functions;
+#if TARGET_OS_MAC
+ const cc_credentials_iterator_f *vector_functions;
+#endif
+};
+typedef struct cc_credentials_iterator_d cc_credentials_iterator_d;
+typedef cc_credentials_iterator_d *cc_credentials_iterator_t;
+
+struct cc_string_d {
+ const char *data;
+ const cc_string_f *functions;
+#if TARGET_OS_MAC
+ const cc_string_f *vector_functions;
+#endif
+};
+typedef struct cc_string_d cc_string_d;
+typedef cc_string_d *cc_string_t;
+
+struct cc_credentials_d {
+ const cc_credentials_union *data;
+ const cc_credentials_f *functions;
+#if TARGET_OS_MAC
+ const cc_credentials_f *otherFunctions;
+#endif
+};
+typedef struct cc_credentials_d cc_credentials_d;
+typedef cc_credentials_d *cc_credentials_t;
+
+/* Function pointer structs */
+
+struct cc_context_f {
+ cc_int32 (*release) (cc_context_t in_context);
+
+ cc_int32 (*get_change_time) (cc_context_t in_context,
+ cc_time_t *out_time);
+
+ cc_int32 (*get_default_ccache_name) (cc_context_t in_context,
+ cc_string_t *out_name);
+
+ cc_int32 (*open_ccache) (cc_context_t in_context,
+ const char *in_name,
+ cc_ccache_t *out_ccache);
+
+ cc_int32 (*open_default_ccache) (cc_context_t in_context,
+ cc_ccache_t *out_ccache);
+
+ cc_int32 (*create_ccache) (cc_context_t in_context,
+ const char *in_name,
+ cc_uint32 in_cred_vers,
+ const char *in_principal,
+ cc_ccache_t *out_ccache);
+
+ cc_int32 (*create_default_ccache) (cc_context_t in_context,
+ cc_uint32 in_cred_vers,
+ const char *in_principal,
+ cc_ccache_t *out_ccache);
+
+ cc_int32 (*create_new_ccache) (cc_context_t in_context,
+ cc_uint32 in_cred_vers,
+ const char *in_principal,
+ cc_ccache_t *out_ccache);
+
+ cc_int32 (*new_ccache_iterator) (cc_context_t in_context,
+ cc_ccache_iterator_t *out_iterator);
+
+ cc_int32 (*lock) (cc_context_t in_context,
+ cc_uint32 in_lock_type,
+ cc_uint32 in_block);
+
+ cc_int32 (*unlock) (cc_context_t in_cc_context);
+
+ cc_int32 (*compare) (cc_context_t in_cc_context,
+ cc_context_t in_compare_to_context,
+ cc_uint32 *out_equal);
+
+ cc_int32 (*wait_for_change) (cc_context_t in_cc_context);
+};
+
+struct cc_ccache_f {
+ cc_int32 (*release) (cc_ccache_t io_ccache);
+
+ cc_int32 (*destroy) (cc_ccache_t io_ccache);
+
+ cc_int32 (*set_default) (cc_ccache_t io_ccache);
+
+ cc_int32 (*get_credentials_version) (cc_ccache_t in_ccache,
+ cc_uint32 *out_credentials_version);
+
+ cc_int32 (*get_name) (cc_ccache_t in_ccache,
+ cc_string_t *out_name);
+
+ cc_int32 (*get_principal) (cc_ccache_t in_ccache,
+ cc_uint32 in_credentials_version,
+ cc_string_t *out_principal);
+
+ cc_int32 (*set_principal) (cc_ccache_t io_ccache,
+ cc_uint32 in_credentials_version,
+ const char *in_principal);
+
+ cc_int32 (*store_credentials) (cc_ccache_t io_ccache,
+ const cc_credentials_union *in_credentials_union);
+
+ cc_int32 (*remove_credentials) (cc_ccache_t io_ccache,
+ cc_credentials_t in_credentials);
+
+ cc_int32 (*new_credentials_iterator) (cc_ccache_t in_ccache,
+ cc_credentials_iterator_t *out_credentials_iterator);
+
+ cc_int32 (*move) (cc_ccache_t io_source_ccache,
+ cc_ccache_t io_destination_ccache);
+
+ cc_int32 (*lock) (cc_ccache_t io_ccache,
+ cc_uint32 in_lock_type,
+ cc_uint32 in_block);
+
+ cc_int32 (*unlock) (cc_ccache_t io_ccache);
+
+ cc_int32 (*get_last_default_time) (cc_ccache_t in_ccache,
+ cc_time_t *out_last_default_time);
+
+ cc_int32 (*get_change_time) (cc_ccache_t in_ccache,
+ cc_time_t *out_change_time);
+
+ cc_int32 (*compare) (cc_ccache_t in_ccache,
+ cc_ccache_t in_compare_to_ccache,
+ cc_uint32 *out_equal);
+
+ cc_int32 (*get_kdc_time_offset) (cc_ccache_t in_ccache,
+ cc_uint32 in_credentials_version,
+ cc_time_t *out_time_offset);
+
+ cc_int32 (*set_kdc_time_offset) (cc_ccache_t io_ccache,
+ cc_uint32 in_credentials_version,
+ cc_time_t in_time_offset);
+
+ cc_int32 (*clear_kdc_time_offset) (cc_ccache_t io_ccache,
+ cc_uint32 in_credentials_version);
+
+ cc_int32 (*wait_for_change) (cc_ccache_t in_ccache);
+};
+
+struct cc_string_f {
+ cc_int32 (*release) (cc_string_t in_string);
+};
+
+struct cc_credentials_f {
+ cc_int32 (*release) (cc_credentials_t io_credentials);
+
+ cc_int32 (*compare) (cc_credentials_t in_credentials,
+ cc_credentials_t in_compare_to_credentials,
+ cc_uint32 *out_equal);
+};
+
+
+struct cc_ccache_iterator_f {
+ cc_int32 (*release) (cc_ccache_iterator_t io_ccache_iterator);
+
+ cc_int32 (*next) (cc_ccache_iterator_t in_ccache_iterator,
+ cc_ccache_t *out_ccache);
+
+ cc_int32 (*clone) (cc_ccache_iterator_t in_ccache_iterator,
+ cc_ccache_iterator_t *out_ccache_iterator);
+};
+
+struct cc_credentials_iterator_f {
+ cc_int32 (*release) (cc_credentials_iterator_t io_credentials_iterator);
+
+ cc_int32 (*next) (cc_credentials_iterator_t in_credentials_iterator,
+ cc_credentials_t *out_credentials);
+
+ cc_int32 (*clone) (cc_credentials_iterator_t in_credentials_iterator,
+ cc_credentials_iterator_t *out_credentials_iterator);
+};
+
+/* API functions */
+
+CCACHE_API cc_int32 cc_initialize (cc_context_t *out_context,
+ cc_int32 in_version,
+ cc_int32 *out_supported_version,
+ char const **out_vendor);
+
+/* Convenience macros */
+
+#define cc_context_release(context) \
+ ((context) -> functions -> release (context))
+#define cc_context_get_change_time(context, change_time) \
+ ((context) -> functions -> get_change_time (context, change_time))
+#define cc_context_get_default_ccache_name(context, name) \
+ ((context) -> functions -> get_default_ccache_name (context, name))
+#define cc_context_open_ccache(context, name, ccache) \
+ ((context) -> functions -> open_ccache (context, name, ccache))
+#define cc_context_open_default_ccache(context, ccache) \
+ ((context) -> functions -> open_default_ccache (context, ccache))
+#define cc_context_create_ccache(context, name, version, principal, ccache) \
+ ((context) -> functions -> create_ccache (context, name, version, principal, ccache))
+#define cc_context_create_default_ccache(context, version, principal, ccache) \
+ ((context) -> functions -> create_default_ccache (context, version, principal, ccache))
+#define cc_context_create_new_ccache(context, version, principal, ccache) \
+ ((context) -> functions -> create_new_ccache (context, version, principal, ccache))
+#define cc_context_new_ccache_iterator(context, iterator) \
+ ((context) -> functions -> new_ccache_iterator (context, iterator))
+#define cc_context_lock(context, type, block) \
+ ((context) -> functions -> lock (context, type, block))
+#define cc_context_unlock(context) \
+ ((context) -> functions -> unlock (context))
+#define cc_context_compare(context, compare_to, equal) \
+ ((context) -> functions -> compare (context, compare_to, equal))
+#define cc_context_wait_for_change(context) \
+ ((context) -> functions -> wait_for_change (context))
+
+#define cc_ccache_release(ccache) \
+ ((ccache) -> functions -> release (ccache))
+#define cc_ccache_destroy(ccache) \
+ ((ccache) -> functions -> destroy (ccache))
+#define cc_ccache_set_default(ccache) \
+ ((ccache) -> functions -> set_default (ccache))
+#define cc_ccache_get_credentials_version(ccache, version) \
+ ((ccache) -> functions -> get_credentials_version (ccache, version))
+#define cc_ccache_get_name(ccache, name) \
+ ((ccache) -> functions -> get_name (ccache, name))
+#define cc_ccache_get_principal(ccache, version, principal) \
+ ((ccache) -> functions -> get_principal (ccache, version, principal))
+#define cc_ccache_set_principal(ccache, version, principal) \
+ ((ccache) -> functions -> set_principal (ccache, version, principal))
+#define cc_ccache_store_credentials(ccache, credentials) \
+ ((ccache) -> functions -> store_credentials (ccache, credentials))
+#define cc_ccache_remove_credentials(ccache, credentials) \
+ ((ccache) -> functions -> remove_credentials (ccache, credentials))
+#define cc_ccache_new_credentials_iterator(ccache, iterator) \
+ ((ccache) -> functions -> new_credentials_iterator (ccache, iterator))
+#define cc_ccache_lock(ccache, type, block) \
+ ((ccache) -> functions -> lock (ccache, type, block))
+#define cc_ccache_unlock(ccache, unlock) \
+ ((ccache) -> functions -> unlock (ccache, unlock))
+#define cc_ccache_get_last_default_time(ccache, last_default_time) \
+ ((ccache) -> functions -> get_last_default_time (ccache, last_default_time))
+#define cc_ccache_get_change_time(ccache, change_time) \
+ ((ccache) -> functions -> get_change_time (ccache, change_time))
+#define cc_ccache_move(source, destination) \
+ ((source) -> functions -> move (source, destination))
+#define cc_ccache_compare(ccache, compare_to, equal) \
+ ((ccache) -> functions -> compare (ccache, compare_to, equal))
+#define cc_ccache_get_kdc_time_offset(ccache, version, time_offset) \
+ ((ccache) -> functions -> get_kdc_time_offset (ccache, version, time_offset))
+#define cc_ccache_set_kdc_time_offset(ccache, version, time_offset) \
+ ((ccache) -> functions -> set_kdc_time_offset (ccache, version, time_offset))
+#define cc_ccache_clear_kdc_time_offset(ccache, version) \
+ ((ccache) -> functions -> clear_kdc_time_offset (ccache, version))
+#define cc_ccache_wait_for_change(ccache) \
+ ((ccache) -> functions -> wait_for_change (ccache))
+
+#define cc_string_release(string) \
+ ((string) -> functions -> release (string))
+
+#define cc_credentials_release(credentials) \
+ ((credentials) -> functions -> release (credentials))
+#define cc_credentials_compare(credentials, compare_to, equal) \
+ ((credentials) -> functions -> compare (credentials, compare_to, equal))
+
+#define cc_ccache_iterator_release(iterator) \
+ ((iterator) -> functions -> release (iterator))
+#define cc_ccache_iterator_next(iterator, ccache) \
+ ((iterator) -> functions -> next (iterator, ccache))
+#define cc_ccache_iterator_clone(iterator, new_iterator) \
+ ((iterator) -> functions -> clone (iterator, new_iterator))
+
+#define cc_credentials_iterator_release(iterator) \
+ ((iterator) -> functions -> release (iterator))
+#define cc_credentials_iterator_next(iterator, credentials) \
+ ((iterator) -> functions -> next (iterator, credentials))
+#define cc_credentials_iterator_clone(iterator, new_iterator) \
+ ((iterator) -> functions -> clone (iterator, new_iterator))
+
+#if TARGET_OS_MAC
+#pragma pack(pop)
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __CREDENTIALSCACHE__ */
diff --git a/src/include/CredentialsCache2.h b/src/include/CredentialsCache2.h
new file mode 100644
index 0000000000..b0c45d59e8
--- /dev/null
+++ b/src/include/CredentialsCache2.h
@@ -0,0 +1,326 @@
+/*
+ * $Header$
+ *
+ * Copyright 2006 Massachusetts Institute of Technology.
+ * All Rights Reserved.
+ *
+ * Export of this software from the United States of America may
+ * require a specific license from the United States Government.
+ * It is the responsibility of any person or organization contemplating
+ * export to obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of M.I.T. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. Furthermore if you modify this software you must label
+ * your software as modified software and not distribute it in such a
+ * fashion that it might be confused with the original M.I.T. software.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ */
+
+/*
+ * This is backwards compatibility for CCache API v2 clients to be able to run
+ * against the CCache API v3 library
+ */
+
+#ifndef CCAPI_V2_H
+#define CCAPI_V2_H
+
+#include <CredentialsCache.h>
+
+#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
+#include <TargetConditionals.h>
+#include <AvailabilityMacros.h>
+#ifdef DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
+#define CCAPI_DEPRECATED DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
+#endif
+#endif
+
+#ifndef CCAPI_DEPRECATED
+#define CCAPI_DEPRECATED
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#if TARGET_OS_MAC
+#pragma pack(push,2)
+#endif
+
+/* Some old types get directly mapped to new types */
+
+typedef cc_context_d apiCB;
+typedef cc_ccache_d ccache_p;
+typedef cc_credentials_iterator_d ccache_cit_creds;
+typedef cc_ccache_iterator_d ccache_cit_ccache;
+typedef cc_data cc_data_compat;
+typedef cc_int32 cc_cred_vers;
+typedef cc_int32 cc_result;
+
+/* This doesn't exist in API v3 */
+typedef cc_uint32 cc_flags;
+
+/* Credentials types are visible to the caller so we have to keep binary compatibility */
+
+typedef struct cc_credentials_v5_compat {
+ char* client;
+ char* server;
+ cc_data_compat keyblock;
+ cc_time_t authtime;
+ cc_time_t starttime;
+ cc_time_t endtime;
+ cc_time_t renew_till;
+ cc_uint32 is_skey;
+ cc_uint32 ticket_flags;
+ cc_data_compat** addresses;
+ cc_data_compat ticket;
+ cc_data_compat second_ticket;
+ cc_data_compat** authdata;
+} cc_credentials_v5_compat;
+
+enum {
+ MAX_V4_CRED_LEN = 1250
+};
+
+enum {
+ KRB_NAME_SZ = 40,
+ KRB_INSTANCE_SZ = 40,
+ KRB_REALM_SZ = 40
+};
+
+typedef struct cc_credentials_v4_compat {
+ unsigned char kversion;
+ char principal[KRB_NAME_SZ+1];
+ char principal_instance[KRB_INSTANCE_SZ+1];
+ char service[KRB_NAME_SZ+1];
+ char service_instance[KRB_INSTANCE_SZ+1];
+ char realm[KRB_REALM_SZ+1];
+ unsigned char session_key[8];
+ cc_int32 kvno;
+ cc_int32 str_to_key;
+ long issue_date;
+ cc_int32 lifetime;
+ cc_uint32 address;
+ cc_int32 ticket_sz;
+ unsigned char ticket[MAX_V4_CRED_LEN];
+ unsigned long oops;
+} cc_credentials_v4_compat;
+
+typedef union cred_ptr_union_compat {
+ cc_credentials_v4_compat* pV4Cred;
+ cc_credentials_v5_compat* pV5Cred;
+} cred_ptr_union_compat;
+
+typedef struct cred_union {
+ cc_int32 cred_type; /* cc_cred_vers */
+ cred_ptr_union_compat cred;
+} cred_union;
+
+/* NC info structure is gone in v3 */
+
+struct infoNC {
+ char* name;
+ char* principal;
+ cc_int32 vers;
+};
+
+typedef struct infoNC infoNC;
+
+/* Some old type names */
+
+typedef cc_credentials_v4_compat V4Cred_type;
+typedef cc_credentials_v5_compat cc_creds;
+struct ccache_cit;
+typedef struct ccache_cit ccache_cit;
+
+enum {
+ CC_API_VER_2 = ccapi_version_2
+};
+
+enum {
+ CC_NOERROR,
+ CC_BADNAME,
+ CC_NOTFOUND,
+ CC_END,
+ CC_IO,
+ CC_WRITE,
+ CC_NOMEM,
+ CC_FORMAT,
+ CC_LOCKED,
+ CC_BAD_API_VERSION,
+ CC_NO_EXIST,
+ CC_NOT_SUPP,
+ CC_BAD_PARM,
+ CC_ERR_CACHE_ATTACH,
+ CC_ERR_CACHE_RELEASE,
+ CC_ERR_CACHE_FULL,
+ CC_ERR_CRED_VERSION
+};
+
+enum {
+ CC_CRED_UNKNOWN,
+ CC_CRED_V4,
+ CC_CRED_V5,
+ CC_CRED_MAX
+};
+
+enum {
+ CC_LOCK_UNLOCK = 1,
+ CC_LOCK_READER = 2,
+ CC_LOCK_WRITER = 3,
+ CC_LOCK_NOBLOCK = 16
+};
+
+CCACHE_API cc_int32
+cc_shutdown (apiCB **io_context)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_get_NC_info (apiCB *in_context,
+ infoNC ***out_info)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_get_change_time (apiCB *in_context,
+ cc_time_t *out_change_time)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_open (apiCB *in_context,
+ const char *in_name,
+ cc_int32 in_version,
+ cc_uint32 in_flags,
+ ccache_p **out_ccache)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_create (apiCB *in_context,
+ const char *in_name,
+ const char *in_principal,
+ cc_int32 in_version,
+ cc_uint32 in_flags,
+ ccache_p **out_ccache)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_close (apiCB *in_context,
+ ccache_p **ioCCache)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_destroy (apiCB *in_context,
+ ccache_p **io_ccache)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_seq_fetch_NCs_begin (apiCB *in_context,
+ ccache_cit **out_nc_iterator)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_seq_fetch_NCs_next (apiCB *in_context,
+ ccache_p **out_ccache,
+ ccache_cit *in_nc_iterator)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_seq_fetch_NCs_end (apiCB *in_context,
+ ccache_cit **io_nc_iterator)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_get_name (apiCB *in_context,
+ ccache_p *in_ccache,
+ char **out_name)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_get_cred_version (apiCB *in_context,
+ ccache_p *in_ccache,
+ cc_int32 *out_version)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_set_principal (apiCB *in_context,
+ ccache_p *in_ccache,
+ cc_int32 in_version,
+ char *in_principal)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_get_principal (apiCB *in_context,
+ ccache_p *in_ccache,
+ char **out_principal)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_store (apiCB *in_context,
+ ccache_p *in_ccache,
+ cred_union in_credentials)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_remove_cred (apiCB *in_context,
+ ccache_p *in_ccache,
+ cred_union in_credentials)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_seq_fetch_creds_begin (apiCB *in_context,
+ const ccache_p *in_ccache,
+ ccache_cit **out_ccache_iterator)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_seq_fetch_creds_next (apiCB *in_context,
+ cred_union **out_cred_union,
+ ccache_cit *in_ccache_iterator)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_seq_fetch_creds_end (apiCB *in_context,
+ ccache_cit **io_ccache_iterator)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_free_principal (apiCB *in_context,
+ char **io_principal)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_free_name (apiCB *in_context,
+ char **io_name)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_free_creds (apiCB *in_context,
+ cred_union **io_cred_union)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_free_NC_info (apiCB *in_context,
+ infoNC ***io_info)
+CCAPI_DEPRECATED;
+
+CCACHE_API cc_int32
+cc_lock_request (apiCB *in_context,
+ const ccache_p *in_ccache,
+ const cc_int32 in_lock_type)
+CCAPI_DEPRECATED;
+
+#if TARGET_OS_MAC
+#pragma pack(pop)
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* CCAPI_V2_H */