From ed0ac77dc4652c17d0a49903db5a5fe2e152e249 Mon Sep 17 00:00:00 2001 From: Miro Jurisic Date: Tue, 4 Aug 1998 01:23:55 +0000 Subject: [PATCH] Added import list and rearranged some code git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10773 dc483132-0cff-0310-8789-dd5450dbe970 --- src/mac/K5.CFMglue.c | 206 ++++++++++++++++++++++++++----------------- 1 file changed, 124 insertions(+), 82 deletions(-) diff --git a/src/mac/K5.CFMglue.c b/src/mac/K5.CFMglue.c index b65c8c8a3..f23b229ce 100644 --- a/src/mac/K5.CFMglue.c +++ b/src/mac/K5.CFMglue.c @@ -1,12 +1,8 @@ +/* Include prototypes for glue functions */ #include +/* Hardcode library fragment name here */ #define kLibraryName "\pK5Library" - -/* This code is directly from Technote 1077 */ - -/* changed Library name to be hardcoded at the top of the file - instead in the middle of the code */ - #include // Private function prototypes @@ -18,6 +14,128 @@ static OSErr Find_Symbol( static pascal OSErr GetSystemArchitecture(OSType *archType); +/* Public functions & globals */ + +/* We are providing glue for the following functions, for the benefit of the + Kerberos v5 telnet plugin: + krb5_auth_con_free + krb5_auth_con_genaddrs + krb5_auth_con_getlocalsubkey + krb5_auth_con_init + + krb5_auth_con_setaddrs + krb5_auth_con_setports + krb5_init_ets + + com_err + + mit_des_ecb_encrypt + mit_des_init_random_key + mit_des_key_sched + mit_des_random_key + + krb5_auth_con_setflags + + krb5_cc_default + krb5_copy_keyblock + krb5_free_ap_rep_enc_part + krb5_free_context + krb5_free_cred_contents + krb5_free_creds + krb5_free_keyblock + krb5_free_principal + krb5_fwd_tgt_creds + krb5_get_credentials + krb5_init_context + + krb5_mk_req_extended + krb5_rd_rep + krb5_sname_to_principal +*/ + +/* Glue for every function consists of the ProcInfo enum (built from the prototype) + and a glue function */ + +/* These functions fail silently, anyone have any better ideas? */ + + +/* krb5_auth_con_free */ + +enum { + krb5_auth_con_free_ProcInfo = kThinkCStackBased | + RESULT_SIZE(SIZE_CODE(sizeof(krb5_error_code))) | + STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(krb5_context))) | + STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(krb5_auth_context))) +}; + +krb5_error_code krb5_auth_con_free ( + krb5_context param1, + krb5_auth_context param2)) +{ + static krb5_auth_con_free_ProcPtr = kUnresolvedSymbolAddress; + + // if this symbol has not been setup yet... + if ((Ptr) krb5_auth_con_free_ProcPtr == (Ptr) kUnresolvedSymbolAddress) + Find_Symbol((Ptr*) &krb5_auth_con_free_ProcPtr,"\pkrb5_auth_con_free",krb5_auth_con_free_ProcInfo); + if ((Ptr) krb5_auth_con_free_ProcPtr != (Ptr) kUnresolvedSymbolAddress) + return krb5_auth_con_free_ProcPtr(param1, param2); +} + +/* krb5_auth_con_genaddrs */ + +enum { + krb5_auth_con_genaddrs_ProcInfo = kThinkCStackBased | + RESULT_SIZE(SIZE_CODE(sizeof(krb5_error_code))) | + STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(krb5_context))) | + STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(krb5_auth_context))) | + STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int))) | + STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int))) +}; + +krb5_error_code krb5_auth_con_genaddrs ( + krb5_context param1, + krb5_auth_context param2, + int param3, + int param4)) +{ + static krb5_auth_con_genaddrs_ProcPtr = kUnresolvedSymbolAddress; + + // if this symbol has not been setup yet... + if ((Ptr) krb5_auth_con_genaddrs_ProcPtr == (Ptr) kUnresolvedSymbolAddress) + Find_Symbol((Ptr*) &krb5_auth_con_genaddrs_ProcPtr,"\pkrb5_auth_con_genaddrs",krb5_auth_con_genaddrs_ProcInfo); + if ((Ptr) krb5_auth_con_genaddrs_ProcPtr != (Ptr) kUnresolvedSymbolAddress) + return krb5_auth_con_genaddrs_ProcPtr(param1, param2, param3, param4); +} + +/* krb5_auth_con_getlocalsubkey */ + +enum { + krb5_auth_con_getlocalsubkey_ProcInfo = kThinkCStackBased | + RESULT_SIZE(SIZE_CODE(sizeof(krb5_error_code))) | + STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(krb5_context))) | + STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(krb5_auth_context))) | + STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(krb5_keyblock**))) +}; + +krb5_error_code krb5_auth_con_getlocalsubkey ( + krb5_context param1, + krb5_auth_context param2, + krb5_keyblock** param3) +{ + static krb5_auth_con_getlocalsubkey_ProcPtr = kUnresolvedSymbolAddress; + + // if this symbol has not been setup yet... + if ((Ptr) krb5_auth_con_getlocalsubkey_ProcPtr == (Ptr) kUnresolvedSymbolAddress) + Find_Symbol((Ptr*) &krb5_auth_con_getlocalsubkey_ProcPtr,"\pkrb5_auth_con_getlocalsubkey",krb5_auth_con_getlocalsubkey_ProcInfo); + if ((Ptr) krb5_auth_con_getlocalsubkey_ProcPtr != (Ptr) kUnresolvedSymbolAddress) + return krb5_auth_con_getlocalsubkey_ProcPtr(param1, param2, param3); +} + +/* This code is directly from Technote 1077 */ + +/* changed Library name to be hardcoded at the top of the file + instead in the middle of the code */ + // Private functions static pascal OSErr GetSystemArchitecture(OSType *archType) @@ -102,79 +220,3 @@ static OSErr Find_Symbol( } return sOSErr; } - -/* Public functions & globals */ - -/* These functions fail silently, anyone have any better ideas? */ - -/* krb5_auth_con_free */ - -enum { - krb5_auth_con_free_ProcInfo = kThinkCStackBased | - RESULT_SIZE(SIZE_CODE(sizeof(krb5_error_code))) | - STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(krb5_context))) | - STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(krb5_auth_context))) -}; - -krb5_error_code krb5_auth_con_free ( - krb5_context param1, - krb5_auth_context param2)) -{ - static krb5_auth_con_free_ProcPtr = kUnresolvedSymbolAddress; - - // if this symbol has not been setup yet... - if ((Ptr) krb5_auth_con_free_ProcPtr == (Ptr) kUnresolvedSymbolAddress) - Find_Symbol((Ptr*) &krb5_auth_con_free_ProcPtr,"\pkrb5_auth_con_free",krb5_auth_con_free_ProcInfo); - if ((Ptr) krb5_auth_con_free_ProcPtr != (Ptr) kUnresolvedSymbolAddress) - return krb5_auth_con_free_ProcPtr(param1, param2); -} - -/* krb5_auth_con_genaddrs */ - -enum { - krb5_auth_con_genaddrs_ProcInfo = kThinkCStackBased | - RESULT_SIZE(SIZE_CODE(sizeof(krb5_error_code))) | - STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(krb5_context))) | - STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(krb5_auth_context))) | - STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int))) | - STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int))) -}; - -krb5_error_code krb5_auth_con_genaddrs ( - krb5_context param1, - krb5_auth_context param2, - int param3, - int param4)) -{ - static krb5_auth_con_genaddrs_ProcPtr = kUnresolvedSymbolAddress; - - // if this symbol has not been setup yet... - if ((Ptr) krb5_auth_con_genaddrs_ProcPtr == (Ptr) kUnresolvedSymbolAddress) - Find_Symbol((Ptr*) &krb5_auth_con_genaddrs_ProcPtr,"\pkrb5_auth_con_genaddrs",krb5_auth_con_genaddrs_ProcInfo); - if ((Ptr) krb5_auth_con_genaddrs_ProcPtr != (Ptr) kUnresolvedSymbolAddress) - return krb5_auth_con_genaddrs_ProcPtr(param1, param2, param3, param4); -} - -/* krb5_auth_con_getlocalsubkey */ - -enum { - krb5_auth_con_getlocalsubkey_ProcInfo = kThinkCStackBased | - RESULT_SIZE(SIZE_CODE(sizeof(krb5_error_code))) | - STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(krb5_context))) | - STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(krb5_auth_context))) | - STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(krb5_keyblock**))) -}; - -krb5_error_code krb5_auth_con_getlocalsubkey ( - krb5_context param1, - krb5_auth_context param2, - krb5_keyblock** param3) -{ - static krb5_auth_con_getlocalsubkey_ProcPtr = kUnresolvedSymbolAddress; - - // if this symbol has not been setup yet... - if ((Ptr) krb5_auth_con_getlocalsubkey_ProcPtr == (Ptr) kUnresolvedSymbolAddress) - Find_Symbol((Ptr*) &krb5_auth_con_getlocalsubkey_ProcPtr,"\pkrb5_auth_con_getlocalsubkey",krb5_auth_con_getlocalsubkey_ProcInfo); - if ((Ptr) krb5_auth_con_getlocalsubkey_ProcPtr != (Ptr) kUnresolvedSymbolAddress) - return krb5_auth_con_getlocalsubkey_ProcPtr(param1, param2, param3); -} -- 2.26.2