diff options
| author | Sam Hartman <hartmans@mit.edu> | 2006-06-22 18:43:20 +0000 |
|---|---|---|
| committer | Sam Hartman <hartmans@mit.edu> | 2006-06-22 18:43:20 +0000 |
| commit | e1c6f641ea03e411ddfa6af9a66e5e3801554a33 (patch) | |
| tree | 1dce165b527fbe4cb89dd551ce2d740f0d7b3ffa /src/lib/ccapi/include/CredentialsCache.h | |
| parent | c09f8fec46803bc14c6c3b3560459891ff993bb9 (diff) | |
| parent | 90c9fe974de343ffec87efbed89ddcfefd431d9e (diff) | |
| download | krb5-e1c6f641ea03e411ddfa6af9a66e5e3801554a33.tar.gz krb5-e1c6f641ea03e411ddfa6af9a66e5e3801554a33.tar.xz krb5-e1c6f641ea03e411ddfa6af9a66e5e3801554a33.zip | |
r18022@luminous: jaltman | 2006-05-19 05:18:37 -0400
Updates of portable CCAPI sources. All code compiles.
r18025@luminous: jaltman | 2006-05-20 23:48:39 -0400
Construct an outline of a sample platform specific main.c
Add ccs_serv_cleanup() routine. Currently does nothing.
Correct field names used within the authorization check.
r18026@luminous: jaltman | 2006-05-22 02:25:43 -0400
More byte order conversions in the server operations code.
r18027@luminous: jaltman | 2006-05-22 13:12:49 -0400
Source files containing common routines used by both
the client and the server.
r18028@luminous: jaltman | 2006-05-22 13:17:07 -0400
Move msg.c and marshall.c to common library.
Add dllmain.c which contains the Windows DllMain() entry
point. This must be moved later to a Windows specific
directory.
Cleanup type usage and function name references.
All that is missing now from the client DLL is a definition
of cci_perform_rpc() which is the entry point to the IPC
routine.
r18029@luminous: jaltman | 2006-05-22 13:18:27 -0400
Move generic list functions to common/generic_lists.c
so they can be used by both the client dll and the server.
Fix type utilization in serv_ops.c
r18083@luminous: jaltman | 2006-06-05 13:49:34 -0400
improved error handling
r18094@luminous: jaltman | 2006-06-09 10:42:04 -0400
* corrections to windows rpc layer
* corrections to network byte order conversions
r18095@luminous: lxs | 2006-06-09 17:46:24 -0400
cci_msg_retrieve_blob(): changed argument 4 from void** to char**
to suppress the warnings from gcc.
r18096@luminous: lxs | 2006-06-09 17:55:32 -0400
moved enum cc_list_type to generic_lists.h to avoid "incomplete enum"
warnings when compiling generic_lists.c
r18097@luminous: lxs | 2006-06-09 17:56:15 -0400
Removed ancient Metrowerks tests from public headers.
r18098@luminous: lxs | 2006-06-09 17:57:20 -0400
Include string.h to get memcpy, strlen, etc on BSD OSes.
r18099@luminous: lxs | 2006-06-09 17:59:36 -0400
Added Mac OS X project file and Mach-IPC support code
r18106@luminous: jaltman | 2006-06-12 09:56:31 -0400
remove duplicate header file and obsolete source file
r18193@luminous: jaltman | 2006-06-22 12:57:14 -0400
This commit updates lib/krb5/ccache/ccapi to support CCAPI Version 3
and above. Specify -DUSE_CCAPI_V3=1 when compiling to use CCAPI Version 3
r18194@luminous: jaltman | 2006-06-22 12:58:37 -0400
Fix parameter name in cc_credentials_iterator_t next()
r18195@luminous: jaltman | 2006-06-22 12:59:08 -0400
Add missing header
r18196@luminous: jaltman | 2006-06-22 13:11:37 -0400
Use the old exported names for setup and shutdown
r18197@luminous: jaltman | 2006-06-22 13:18:14 -0400
krb5_stdccv3_setup is ok
=== Please enter your commit message above this line ===
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18200 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/ccapi/include/CredentialsCache.h')
| -rw-r--r-- | src/lib/ccapi/include/CredentialsCache.h | 147 |
1 files changed, 86 insertions, 61 deletions
diff --git a/src/lib/ccapi/include/CredentialsCache.h b/src/lib/ccapi/include/CredentialsCache.h index dd60fa46d6..95c4fe79ba 100644 --- a/src/lib/ccapi/include/CredentialsCache.h +++ b/src/lib/ccapi/include/CredentialsCache.h @@ -1,6 +1,6 @@ /* $Copyright: * - * Copyright 1998-2004 by the Massachusetts Institute of Technology. + * Copyright 1998-2006 by the Massachusetts Institute of Technology. * * All rights reserved. * @@ -46,12 +46,12 @@ /* * Declarations for Credentials Cache API Library * - * API specification: <http://web.mit.edu/pismere/kerberos/ccache-api-v2.html> + * API specification: <http://web.mit.edu/pismere/kerberos/ccache-api-v3.html> * * Revision 1: Frank Dabek, 6/4/1998 * Revision 2: meeroh, 2/24/1999 * Revision 3: meeroh, 11/12/1999 - * Revision 4: jaltman, 10/27/2004 + * Revision 6: jaltman, 10/27/2004 * */ @@ -59,14 +59,11 @@ #define __CREDENTIALSCACHE__ #if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) - #include <TargetConditionals.h> - #if TARGET_RT_MAC_CFM - #error "Use KfM 4.0 SDK headers for CFM compilation." - #endif +#include <TargetConditionals.h> #endif -#if TARGET_OS_MAC - #include <sys/types.h> +#if defined(_WIN32) +#include <winsock.h> #endif #ifdef __cplusplus @@ -74,11 +71,20 @@ extern "C" { #endif /* __cplusplus */ #if TARGET_OS_MAC - #if defined(__MWERKS__) - #pragma import on - #pragma enumsalwaysint on - #endif - #pragma options align=mac68k +#pragma options align=mac68k +#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> @@ -92,14 +98,16 @@ enum { ccapi_version_2 = 2, ccapi_version_3 = 3, ccapi_version_4 = 4, - ccapi_version_5 = 5 + ccapi_version_5 = 5, + ccapi_version_6 = 6, + ccapi_version_max = ccapi_version_6 }; /* Errors */ enum { - ccNoError = 0, + ccNoError = 0, - ccIteratorEnd = 201, + ccIteratorEnd = 201, ccErrBadParam, ccErrNoMem, ccErrInvalidContext, @@ -111,7 +119,7 @@ enum { ccErrInvalidCredentialsIterator, ccErrInvalidLock, - ccErrBadName, /* 211 */ + ccErrBadName, /* 211 */ ccErrBadCredentialsVersion, ccErrBadAPIVersion, ccErrContextLocked, @@ -123,7 +131,7 @@ enum { ccErrNeverDefault, ccErrCredentialsNotFound, - ccErrCCacheNotFound, /* 221 */ + ccErrCCacheNotFound, /* 221 */ ccErrContextNotFound, ccErrServerUnavailable, ccErrServerInsecure, @@ -135,20 +143,22 @@ enum { }; /* Credentials versions */ -enum { +enum cc_credential_versions { cc_credentials_v4 = 1, cc_credentials_v5 = 2, cc_credentials_v4_v5 = 3 }; /* Lock types */ -enum { - cc_lock_read = 1, - cc_lock_write = 2 +enum cc_lock_types { + cc_lock_read = 0, + cc_lock_write = 1, + cc_lock_upgrade = 2, + cc_lock_downgrade = 3 }; /* Locking Modes */ -enum { +enum cc_lock_modes { cc_lock_noblock = 0, cc_lock_block = 1 }; @@ -157,12 +167,20 @@ enum { * Basic types */ -typedef char cc_int8; -typedef unsigned char cc_uint8; -typedef int cc_int32; -typedef unsigned int cc_uint32; -typedef time_t cc_time_t; -typedef void * cc_handle; +typedef char cc_int8; +typedef unsigned char cc_uint8; +typedef int cc_int32; +typedef unsigned int cc_uint32; +#if defined (WIN32) +typedef __int64 cc_int64; +typedef unsigned __int64 cc_uint64; +#else +typedef long long cc_int64; +typedef unsigned long long cc_uint64; +#endif +typedef time_t cc_time; +typedef cc_int64 cc_time64; +typedef cc_uint64 cc_handle; /* * API types @@ -190,10 +208,11 @@ 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_name_size = 40, cc_v4_instance_size = 40, cc_v4_realm_size = 40, - cc_v4_ticket_size = 1254 + cc_v4_ticket_size = 1254, + cc_v4_key_size = 8 }; enum cc_string_to_key_type { @@ -211,10 +230,10 @@ struct cc_credentials_v4_t { char service [cc_v4_name_size]; char service_instance [cc_v4_instance_size]; char realm [cc_v4_realm_size]; - unsigned char session_key [8]; + unsigned char session_key [cc_v4_key_size]; cc_int32 kvno; cc_int32 string_to_key_type; - cc_time_t issue_date; + cc_time issue_date; cc_int32 lifetime; cc_uint32 address; cc_int32 ticket_size; @@ -233,10 +252,10 @@ 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_time authtime; + cc_time starttime; + cc_time endtime; + cc_time renew_till; cc_uint32 is_skey; cc_uint32 ticket_flags; cc_data** addresses; @@ -320,7 +339,7 @@ struct cc_context_f { cc_context_t context); cc_int32 (*get_change_time) ( cc_context_t context, - cc_time_t* time); + cc_time* time); cc_int32 (*get_default_ccache_name) ( cc_context_t context, cc_string_t* name); @@ -397,16 +416,16 @@ struct cc_ccache_f { cc_ccache_t destination); cc_int32 (*lock) ( cc_ccache_t ccache, - cc_uint32 block, - cc_uint32 lock_type); + cc_uint32 lock_type, + cc_uint32 block); cc_int32 (*unlock) ( cc_ccache_t ccache); cc_int32 (*get_last_default_time) ( cc_ccache_t ccache, - cc_time_t* time); + cc_time* time); cc_int32 (*get_change_time) ( cc_ccache_t ccache, - cc_time_t* time); + cc_time* time); cc_int32 (*compare) ( cc_ccache_t ccache, cc_ccache_t compare_to, @@ -414,11 +433,11 @@ struct cc_ccache_f { cc_int32 (*get_kdc_time_offset) ( cc_ccache_t ccache, cc_int32 credentials_version, - cc_time_t* time_offset); + cc_time* time_offset); cc_int32 (*set_kdc_time_offset) ( cc_ccache_t ccache, cc_int32 credentials_version, - cc_time_t time_offset); + cc_time time_offset); cc_int32 (*clear_kdc_time_offset) ( cc_ccache_t ccache, @@ -446,6 +465,9 @@ struct cc_ccache_iterator_f { cc_int32 (*next) ( cc_ccache_iterator_t iter, cc_ccache_t* ccache); + + cc_int32 (*clone) ( cc_ccache_iterator_t iter, + cc_ccache_iterator_t* new_iter); }; struct cc_credentials_iterator_f { @@ -453,17 +475,20 @@ struct cc_credentials_iterator_f { cc_credentials_iterator_t iter); cc_int32 (*next) ( cc_credentials_iterator_t iter, - cc_credentials_t* ccache); + cc_credentials_t* cred); + + cc_int32 (*clone) ( cc_credentials_iterator_t iter, + cc_credentials_iterator_t* new_iter); }; /* * API functions */ -cc_int32 cc_initialize ( +CCACHE_API cc_int32 cc_initialize ( cc_context_t* outContext, - cc_int32 inVersion, - cc_int32* outSupportedVersion, + cc_int32 inVersion, + cc_int32* outSupportedVersion, char const** outVendor); /* @@ -488,8 +513,8 @@ cc_int32 cc_initialize ( ((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, lock) \ - ((context) -> functions -> lock (context, type, lock)) +#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) \ @@ -515,8 +540,8 @@ cc_int32 cc_initialize ( ((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, lock) \ - ((ccache) -> functions -> lock (ccache, lock)) +#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, time) \ @@ -528,11 +553,11 @@ cc_int32 cc_initialize ( #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) \ - ((ccache) -> functions -> get_kdc_time_offset (version, time)) + ((ccache) -> functions -> get_kdc_time_offset (version, time)) #define cc_ccache_set_kdc_time_offset(ccache, version, time) \ - ((ccache) -> functions -> set_kdc_time_offset (version, time)) + ((ccache) -> functions -> set_kdc_time_offset (version, time)) #define cc_ccache_clear_kdc_time_offset(ccache, version) \ - ((ccache) -> functions -> clear_kdc_time_offset (version)) + ((ccache) -> functions -> clear_kdc_time_offset (version)) #define cc_string_release(string) \ ((string) -> functions -> release (string)) @@ -546,18 +571,18 @@ cc_int32 cc_initialize ( ((iterator) -> functions -> release (iterator)) #define cc_ccache_iterator_next(iterator, ccache) \ ((iterator) -> functions -> next (iterator, ccache)) +#define cc_ccache_iterator_clone(iterator, new_iter) \ + ((iterator) -> functions -> clone (iterator, new_iter)) #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_iter) \ + ((iterator) -> functions -> clone (iterator, new_iter)) #if TARGET_OS_MAC - #if defined(__MWERKS__) - #pragma enumsalwaysint reset - #pragma import reset - #endif - #pragma options align=reset +#pragma options align=reset #endif #ifdef __cplusplus |
