summaryrefslogtreecommitdiffstats
path: root/src/lib/ccapi/unit-test
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/unit-test
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/unit-test')
-rw-r--r--src/lib/ccapi/unit-test/NTMakefile53
-rw-r--r--src/lib/ccapi/unit-test/t_ccache.c24
-rw-r--r--src/lib/ccapi/unit-test/t_context.c34
-rw-r--r--src/lib/ccapi/unit-test/t_server.c4
4 files changed, 84 insertions, 31 deletions
diff --git a/src/lib/ccapi/unit-test/NTMakefile b/src/lib/ccapi/unit-test/NTMakefile
new file mode 100644
index 000000000..73f53f2e4
--- /dev/null
+++ b/src/lib/ccapi/unit-test/NTMakefile
@@ -0,0 +1,53 @@
+!include <win32.mak>
+
+CFLAGS = -I../include $(cdebug) $(cflags) $(cvarsmt)
+
+WINLIBS = ws2_32.lib rpcrt4.lib $(guilibsdll)
+
+T_CCACHE = t_ccache.exe
+
+T_CONTEXT = t_context.exe
+
+T_LISTS = t_lists.exe
+
+T_MSG = t_msg.exe
+
+T_SERVER = t_server.exe
+
+T_CCAPI = t_ccapi.exe
+
+all: $(T_CCAPI) $(T_CCACHE) $(T_CONTEXT) $(T_LISTS) $(T_MSG) $(T_SERVER)
+
+ntccrpc_c.c ntccrpc_s.c ntccrpc.h: ntccrpc.idl ntccrpc.acf
+ midl ntccrpc.idl /acf ntccrpc.acf
+
+CC_CLIENT_LIB = ..\client\cc_client.lib
+
+CC_COMMON_LIB = ..\common\cc_common.lib
+
+CC_SERVER_LIB = ..\server\cc_server.lib
+
+CC_API_LIB = ..\windows\krbcc32.lib
+
+$(T_CCACHE): t_ccache.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)
+
+$(T_CONTEXT): t_context.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)
+
+$(T_LISTS): t_lists.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)
+
+$(T_MSG): t_msg.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)
+
+$(T_SERVER): t_server.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)
+
+$(T_CCAPI): t_ccapi.obj $(CC_API_LIB)
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)
+
+clean:
+ del *.exe *.dll *.lib *.exp *.obj ntccrpc_c.c ntccrpc_s.c ntccrpc.h
+
+
diff --git a/src/lib/ccapi/unit-test/t_ccache.c b/src/lib/ccapi/unit-test/t_ccache.c
index 6ef33ea23..175764e79 100644
--- a/src/lib/ccapi/unit-test/t_ccache.c
+++ b/src/lib/ccapi/unit-test/t_ccache.c
@@ -59,8 +59,8 @@ int main() {
int i;
cc_int32 code;
- code = cci_ccache_new("The first", p1, cc_credentials_v4_v5, &c1);
- code = cci_ccache_new("The 2nd", p2, cc_credentials_v4_v5, &c2);
+ code = ccs_ccache_new("The first", p1, cc_credentials_v4_v5, &c1);
+ code = ccs_ccache_new("The 2nd", p2, cc_credentials_v4_v5, &c2);
cred1 = (cc_server_credentials_t*)malloc(sizeof(cc_server_credentials_t));
memset(cred1,0,sizeof(cc_server_credentials_t));
@@ -83,30 +83,30 @@ int main() {
strncpy(cred2->creds.credentials.credentials_v4->principal, p1, strlen(p1));
cred3->creds.credentials.credentials_v5->client = p1;
- code = cci_ccache_store_creds(c1, &cred1->creds);
+ code = ccs_ccache_store_creds(c1, &cred1->creds);
printf("(c1, cred1) -> %d\n",code);
- code = cci_ccache_store_creds(c1, &cred2->creds);
+ code = ccs_ccache_store_creds(c1, &cred2->creds);
printf("(c1, cred2) -> %d\n",code);
- code = cci_ccache_store_creds(c2, &cred3->creds);
+ code = ccs_ccache_store_creds(c2, &cred3->creds);
printf("(c2, cred3) -> %d\n",code);
- code = cci_ccache_store_creds(c1, &cred3->creds);
+ code = ccs_ccache_store_creds(c1, &cred3->creds);
printf("(c1, cred3) -> %d\n",code);
i = 0;
- code = cci_ccache_move(c1, c2);
- code = cci_ccache_destroy(c1);
- code = cci_ccache_new_iterator(c2, &iterator);
- while (cci_credentials_iterate_has_next(iterator)) {
+ code = ccs_ccache_move(c1, c2);
+ code = ccs_ccache_destroy(c1);
+ code = ccs_ccache_new_iterator(c2, &iterator);
+ while (ccs_credentials_iterate_has_next(iterator)) {
i++;
- code = cci_credentials_iterate_next(iterator, &node);
+ code = ccs_credentials_iterate_next(iterator, &node);
stored_cred = (cc_server_credentials_t *)node->data;
printf("%d %d %s\n", stored_cred->is_default, stored_cred->creds.version, stored_cred->creds.credentials.credentials_v4->principal);
if (i == 1) {
- code = cci_ccache_rem_creds(c2,&cred2->creds);
+ code = ccs_ccache_rem_creds(c2,&cred2->creds);
printf("(c2 rem cred2) -> %d\n",code);
}
}
diff --git a/src/lib/ccapi/unit-test/t_context.c b/src/lib/ccapi/unit-test/t_context.c
index 9e35d9abf..d76ff78d9 100644
--- a/src/lib/ccapi/unit-test/t_context.c
+++ b/src/lib/ccapi/unit-test/t_context.c
@@ -68,10 +68,10 @@ int main() {
int i;
cc_int32 code;
- code = cci_context_new(5, auth_info, session_info, &ctx);
- code = cci_context_create_default_ccache(ctx, cc_credentials_v4, "Spike", &ccache);
- code = cci_context_get_default_ccache_name(ctx, &name);
- code = cci_context_open_ccache(ctx, name, &ccache);
+ code = ccs_context_new(5, auth_info, session_info, &ctx);
+ code = ccs_context_create_default_ccache(ctx, cc_credentials_v4, "Spike", &ccache);
+ code = ccs_context_get_default_ccache_name(ctx, &name);
+ code = ccs_context_open_ccache(ctx, name, &ccache);
for (i = 0; i < 5; i++) {
creds = (cc_credentials_union*)malloc(sizeof(cc_credentials_union));
@@ -79,32 +79,32 @@ int main() {
creds->credentials.credentials_v4 = (cc_credentials_v4_t*)malloc(sizeof(cc_credentials_v4_t));
strcpy(creds->credentials.credentials_v4->principal, "Spike");
- code = cci_ccache_store_creds(ccache, creds);
+ code = ccs_ccache_store_creds(ccache, creds);
}
- code = cci_context_create_ccache(ctx, "ccache 2", cc_credentials_v4, "Jeff", &ccache);
- code = cci_context_open_ccache(ctx, "ccache 2", &ccache);
+ code = ccs_context_create_ccache(ctx, "ccache 2", cc_credentials_v4_v5, "Jeff", &ccache);
+ code = ccs_context_open_ccache(ctx, "ccache 2", &ccache);
for (i = 0; i < 5; i++) {
creds = (cc_credentials_union*)malloc(sizeof(cc_credentials_union));
- creds->version = cc_credentials_v4;
- creds->credentials.credentials_v4 = (cc_credentials_v4_t*)malloc(sizeof(cc_credentials_v4_t));
- strcpy(creds->credentials.credentials_v4->principal, "Jeff");
+ creds->version = cc_credentials_v5;
+ creds->credentials.credentials_v5 = (cc_credentials_v5_t*)malloc(sizeof(cc_credentials_v5_t));
+ strcpy(creds->credentials.credentials_v5->principal, "Jeff");
- cci_ccache_store_creds(ccache, creds);
+ ccs_ccache_store_creds(ccache, creds);
}
- code = cci_context_ccache_iterator(ctx, &ccache_iterator);
- while (cci_ccache_iterate_has_next(ccache_iterator)) {
- code = cci_ccache_iterate_next(ccache_iterator, &ccache_node);
+ code = ccs_context_ccache_iterator(ctx, &ccache_iterator);
+ while (ccs_ccache_iterate_has_next(ccache_iterator)) {
+ code = ccs_ccache_iterate_next(ccache_iterator, &ccache_node);
ccache = (cc_server_ccache_t *)ccache_node->data;
printf("%x for %s %s default = %d v %d\n",
ccache, ccache->principal_v4, ccache->principal_v5,
ccache->is_default, ccache->versions);
- code = cci_ccache_new_iterator(ccache, &creds_iterator);
- while (cci_credentials_iterate_has_next(creds_iterator)) {
- code = cci_credentials_iterate_next(creds_iterator, &creds_node);
+ code = ccs_ccache_new_iterator(ccache, &creds_iterator);
+ while (ccs_credentials_iterate_has_next(creds_iterator)) {
+ code = ccs_credentials_iterate_next(creds_iterator, &creds_node);
server_creds = (cc_server_credentials_t *)creds_node->data;
printf("\t%s %d\n",
server_creds->creds.credentials.credentials_v4->principal,
diff --git a/src/lib/ccapi/unit-test/t_server.c b/src/lib/ccapi/unit-test/t_server.c
index d4d998466..d6093941e 100644
--- a/src/lib/ccapi/unit-test/t_server.c
+++ b/src/lib/ccapi/unit-test/t_server.c
@@ -143,7 +143,7 @@ main(void)
cc_session_info_t * session_info;
cc_int32 code;
- if ( cci_serv_initialize() != ccNoError )
+ if ( ccs_serv_initialize() != ccNoError )
return 1;
while ( 1 ) {
@@ -163,7 +163,7 @@ main(void)
code = obtain_session_info(&session_info);
/* process message */
- code = cci_serv_process_msg(msg, auth_info, session_info, &resp);
+ code = ccs_serv_process_msg(msg, auth_info, session_info, &resp);
/* flatten response */
code = cci_msg_flatten(resp, NULL);