summaryrefslogtreecommitdiffstats
path: root/src/lib/ccapi/include/datastore.h
diff options
context:
space:
mode:
authorSam Hartman <hartmans@mit.edu>2006-06-22 18:43:20 +0000
committerSam Hartman <hartmans@mit.edu>2006-06-22 18:43:20 +0000
commite1c6f641ea03e411ddfa6af9a66e5e3801554a33 (patch)
tree1dce165b527fbe4cb89dd551ce2d740f0d7b3ffa /src/lib/ccapi/include/datastore.h
parentc09f8fec46803bc14c6c3b3560459891ff993bb9 (diff)
parent90c9fe974de343ffec87efbed89ddcfefd431d9e (diff)
downloadkrb5-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/datastore.h')
-rw-r--r--src/lib/ccapi/include/datastore.h182
1 files changed, 182 insertions, 0 deletions
diff --git a/src/lib/ccapi/include/datastore.h b/src/lib/ccapi/include/datastore.h
new file mode 100644
index 000000000..7bb8b093d
--- /dev/null
+++ b/src/lib/ccapi/include/datastore.h
@@ -0,0 +1,182 @@
+/* $Copyright:
+ *
+ * Copyright 2004-2006 by the 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 MIT 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 SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Individual source code files are copyright MIT, Cygnus Support,
+ * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
+ *
+ * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
+ * and Zephyr are trademarks of the Massachusetts Institute of Technology
+ * (MIT). No commercial use of these trademarks may be made without prior
+ * written permission of MIT.
+ *
+ * "Commercial use" means use of a name in a product or other for-profit
+ * manner. It does NOT prevent a commercial firm from referring to the MIT
+ * trademarks in order to convey information (although in doing so,
+ * recognition of their trademark status should be given).
+ * $
+ */
+/*
+ * Prototypes and data structures for datastore.
+ *
+ */
+
+
+#ifndef __CCDATASTOREH__
+#define __CCDATASTOREH__
+
+#include "CredentialsCache.h"
+#include "rpc_auth.h"
+#include "generic_lists.h"
+
+struct cc_context_iterate_t {
+ cc_context_list_node_t* next;
+};
+typedef struct cc_context_iterate_t cc_context_iterate_t;
+
+struct cc_ccache_iterate_t {
+ cc_ccache_list_node_t* next;
+};
+typedef struct cc_ccache_iterate_t cc_ccache_iterate_t;
+
+struct cc_credentials_iterate_t {
+ cc_credentials_list_node_t* next;
+};
+typedef struct cc_credentials_iterate_t cc_credentials_iterate_t;
+
+struct cc_lock {
+ cc_uint32 read_locks; /* count of read locks (>= 0) */
+ cc_uint32 write_locks; /* count of write locks (0 or 1) */
+ void * platform_data; /* platform specific implementation data */
+};
+typedef struct cc_lock cc_lock_t;
+
+
+struct cc_server_context_t {
+ cc_ccache_list_head_t* ccaches; /*our ccaches*/
+ cc_generic_list_head_t* active_iterators; /*active ccache iterators*/
+ cc_int32 api_version; /*Version our client passed in on init (ccapi_version_X) */
+ cc_auth_info_t* auth_info; /*auth info passed in from RPC*/
+ cc_session_info_t* session_info; /*session info passed in from RPC*/
+ cc_time64 changed; /*date of last change to this context*/
+ cc_int32 error; /*last error code*/
+ cc_lock_t locks; /*are we locked?*/
+};
+typedef struct cc_server_context_t cc_server_context_t;
+
+struct cc_server_ccache_t {
+ char* name; /*name of this ccache*/
+ char* principal_v4; /*v4 principal associated with this cache*/
+ char* principal_v5; /*v5 principal associated with this cache*/
+ cc_uint32 versions; /*versions of creds supported (from cc_credentials enum in CredentialsCache.h)*/
+ cc_time64 changed; /*date of last change to ccache*/
+ cc_int32 kdc_set; /*is the KDC time offset initialized?*/
+ cc_time64 kdc_offset; /*offset of our clock relative kdc*/
+ cc_time64 last_default; /*the last date when we were default*/
+ cc_int32 is_default; /*is this the default cred on this ccache?*/
+ cc_generic_list_head_t* active_iterators; /*iterators which clients have opened on this cache*/
+ cc_credentials_list_head_t* creds; /*list of creds stored in this ccache*/
+ cc_server_context_t* mycontext; /*context to which I belong*/
+ cc_lock_t locks; /*are we locked?*/
+};
+typedef struct cc_server_ccache_t cc_server_ccache_t;
+
+struct cc_server_credentials_t {
+ cc_int32 is_default; /*Are we the default cred? (first in list)*/
+ cc_credentials_union creds;
+};
+typedef struct cc_server_credentials_t cc_server_credentials_t;
+
+
+/*Note: cci means Credential Cache Internal, to differentiate from exported API macros*/
+
+cc_int32 ccs_context_iterate_has_next(struct cc_context_iterate_t *iterate);
+cc_int32 ccs_context_iterate_next(struct cc_context_iterate_t *iterate, cc_context_list_node_t**);
+
+cc_int32 ccs_ccache_iterate_has_next(struct cc_ccache_iterate_t *iterate);
+cc_int32 ccs_ccache_iterate_next(struct cc_ccache_iterate_t *iterate, cc_ccache_list_node_t**);
+
+cc_int32 ccs_credentials_iterate_has_next(cc_credentials_iterate_t *iterate);
+cc_int32 ccs_credentials_iterate_next(cc_credentials_iterate_t *iterate, cc_credentials_list_node_t **);
+
+cc_int32 ccs_context_list_new(cc_context_list_head_t**);
+cc_int32 ccs_context_list_append(cc_context_list_head_t *head, cc_server_context_t *data, cc_context_list_node_t**);
+cc_int32 ccs_context_list_prepend(cc_context_list_head_t *head, cc_server_context_t *data, cc_context_list_node_t**);
+cc_int32 ccs_context_list_remove_element(cc_context_list_head_t* head, cc_context_list_node_t* rem);
+cc_int32 ccs_context_list_iterator(cc_context_list_head_t *head, struct cc_context_iterate_t**);
+cc_int32 ccs_context_free_iterator(struct cc_context_iterate_t *iterator);
+cc_int32 ccs_context_list_destroy(cc_context_list_head_t* head) ;
+cc_int32 ccs_context_list_copy(cc_context_list_head_t* head, cc_context_list_head_t**);
+
+cc_int32 ccs_ccache_list_new(cc_ccache_list_head_t**);
+cc_int32 ccs_ccache_list_append(cc_ccache_list_head_t *head, cc_server_ccache_t *data, cc_ccache_list_node_t**);
+cc_int32 ccs_ccache_list_prepend(cc_ccache_list_head_t *head, cc_server_ccache_t *data, cc_ccache_list_node_t**);
+cc_int32 ccs_ccache_list_remove_element(cc_ccache_list_head_t* head, cc_ccache_list_node_t* rem);
+cc_int32 ccs_ccache_list_iterator(cc_ccache_list_head_t *head, struct cc_ccache_iterate_t**);
+cc_int32 ccs_ccache_free_iterator(struct cc_ccache_iterate_t *iterator);
+cc_int32 ccs_ccache_list_destroy(cc_ccache_list_head_t* head) ;
+cc_int32 ccs_ccache_list_copy(cc_ccache_list_head_t* head, cc_ccache_list_head_t**);
+
+
+cc_int32 ccs_credentials_list_new(cc_credentials_list_head_t**);
+cc_int32 ccs_credentials_list_append(cc_credentials_list_head_t *head, cc_server_credentials_t *data, cc_credentials_list_node_t**);
+cc_int32 ccs_credentials_list_prepend(cc_credentials_list_head_t *head, cc_server_credentials_t *data, cc_credentials_list_node_t**);
+cc_int32 ccs_credentials_list_remove_element(cc_credentials_list_head_t* head, cc_credentials_list_node_t* rem);
+cc_int32 ccs_credentials_list_iterator(cc_credentials_list_head_t *head, cc_credentials_iterate_t**);
+cc_int32 ccs_credentials_free_iterator(cc_credentials_iterate_t* iterator);
+cc_int32 ccs_credentials_list_destroy(cc_credentials_list_head_t* head) ;
+cc_int32 ccs_credentials_list_copy(cc_credentials_list_head_t* head, cc_credentials_list_head_t**) ;
+
+
+cc_int32 ccs_context_new(int api_version, cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_server_context_t** ) ;
+cc_int32 ccs_context_get_default_ccache_name(cc_server_context_t* ctx, char **);
+cc_int32 ccs_context_find_ccache(cc_server_context_t* ctx, char *name, cc_server_ccache_t**);
+cc_int32 ccs_context_open_ccache(cc_server_context_t* ctx, char *name, cc_server_ccache_t** );
+cc_int32 ccs_context_create_ccache(cc_server_context_t* ctx, char *name, int creds_version, char *principal, cc_server_ccache_t**);
+cc_int32 ccs_context_create_default_ccache(cc_server_context_t* ctx, int creds_version, char *principal, cc_server_ccache_t**);
+cc_int32 ccs_context_ccache_iterator(cc_server_context_t* ctx, cc_ccache_iterate_t**);
+cc_int32 ccs_context_compare(cc_server_context_t* a, cc_server_context_t* b);
+cc_int32 ccs_context_destroy(cc_server_context_t* ctx);
+cc_int32 ccs_context_rem_ccache(cc_server_context_t* ctx, cc_server_ccache_t* ccache);
+
+cc_int32 ccs_ccache_new(char *name, char *principal, int cred_vers, cc_server_ccache_t**);
+cc_int32 ccs_ccache_check_version(const cc_server_ccache_t *ccache, const cc_credentials_union* creds, cc_uint32* compat);
+cc_int32 ccs_ccache_check_principal(const cc_server_ccache_t *ccache, const cc_credentials_union* creds, cc_uint32* compat);
+cc_int32 ccs_ccache_store_creds(cc_server_ccache_t *ccache, const cc_credentials_union* credentials);
+cc_int32 ccs_ccache_rem_creds(cc_server_ccache_t *ccache, const cc_credentials_union* credentials);
+cc_int32 ccs_ccache_move(cc_server_ccache_t *source, cc_server_ccache_t* destination);
+cc_int32 ccs_ccache_get_kdc_time_offset(cc_server_ccache_t* ccache, cc_time64* offset);
+cc_int32 ccs_ccache_set_kdc_time_offset(cc_server_ccache_t* ccache, cc_time64 offset);
+cc_int32 ccs_ccache_clear_kdc_time_offset(cc_server_ccache_t* ccache);
+cc_int32 ccs_ccache_new_iterator(cc_server_ccache_t* ccache, cc_credentials_iterate_t** iterator);
+cc_int32 ccs_ccache_get_principal(cc_server_ccache_t* ccache, cc_int32 version, char ** principal);
+cc_int32 ccs_ccache_set_principal(cc_server_ccache_t* ccache, cc_int32 version, char * principal);
+cc_int32 ccs_ccache_free_principal(char * principal);
+cc_int32 ccs_ccache_destroy(cc_server_ccache_t* ccache);
+void ccs_ccache_changed(cc_server_ccache_t* ccache);
+cc_int32 ccs_ccache_compare(cc_server_ccache_t* ccache1, cc_server_ccache_t* ccache2, cc_uint32 *result);
+#endif /*__CCDATASTOREH__*/