From: Richard Basch Date: Tue, 18 Feb 1997 05:44:18 +0000 (+0000) Subject: krb4_16.def krb4_32.def: Export definitions for krb4 library (win16/win32) X-Git-Tag: krb5-1.1-beta1~1306 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=06f4aec4a82608f3a8d8114aabb7962c0f81c7b8;p=krb5.git krb4_16.def krb4_32.def: Export definitions for krb4 library (win16/win32) krb5_16.def krb5_32.def: Additional exports needed by krb4 library. win_glue.c: support krb4 library Makefile.in: Build krb4 library (win16/win32) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9885 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/ChangeLog b/src/lib/ChangeLog index fa2a3c54d..63ee8948e 100644 --- a/src/lib/ChangeLog +++ b/src/lib/ChangeLog @@ -1,3 +1,10 @@ +Mon Feb 17 19:40:55 1997 Richard Basch + + * Makefile.in: Build krb4 library under Win16/Win32 + * krb4_16.def krb4_32.def: DLL definition files for krb4 library + * krb5_16.def krb5_32.def: Export various des routines (krb4 dll) + * win_glue.c: krb4 library support added + Fri Feb 14 16:40:03 1997 Richard Basch * Makefile.in: Build separate ComErr DLL diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in index 201a9942c..3b82920da 100644 --- a/src/lib/Makefile.in +++ b/src/lib/Makefile.in @@ -29,6 +29,7 @@ KLIBS = krb5\krb5.lib crypto\crypto.lib \ $(BUILDTOP)\util\profile\profile.lib \ kadm\kadm.lib des425\des425.lib GLIBS = gssapi\gssapi.lib +K4LIBS = krb4\krb4.lib ##WIN16##CDEF = comerr16.def ##WIN32##CDEF = comerr32.def @@ -36,6 +37,8 @@ GLIBS = gssapi\gssapi.lib ##WIN32##KDEF = krb5_32.def ##WIN16##GDEF = gssapi16.def ##WIN32##GDEF = gssapi32.def +##WIN16##K4DEF = krb4_16.def +##WIN32##K4DEF = krb4_32.def ##WIN16##WINLIBS = $(WLIB) ldllcew libw oldnames ##WIN32##WINLIBS = msvcrt.lib kernel32.lib wsock32.lib \ @@ -54,14 +57,14 @@ $(CLIB): $(CLIBS) $(WLIB) $(CDEF) no_glue.obj ##WIN32## link $(WINDLLFLAGS) /def:$(CDEF) /out:$*.dll \ ##WIN32## no_glue.obj $(CLIBS) $(WINLIBS) -$(KLIB): $(KLIBS) $(CLIB) $(WLIB) $(KDEF) krb_glue.obj +$(KLIB): $(KLIBS) $(CLIB) $(WLIB) $(KDEF) k5_glue.obj ##WIN16## link /co /seg:400 /noe /nod /nol \ -##WIN16## krb_glue, $*.dll, $*.map, \ +##WIN16## k5_glue, $*.dll, $*.map, \ ##WIN16## $(KLIBS) $(CLIB) $(WINLIBS), $(KDEF) ##WIN16## rc /nologo /p /k $*.dll ##WIN16## implib /nologo $@ $*.dll ##WIN32## link $(WINDLLFLAGS) /def:$(KDEF) /out:$*.dll \ -##WIN32## krb_glue.obj $(KLIBS) $(CLIB) $(WINLIBS) +##WIN32## k5_glue.obj $(KLIBS) $(CLIB) $(WINLIBS) $(GLIB): $(GLIBS) $(KLIB) $(CLIB) $(GDEF) gss_glue.obj ##WIN16## link /co /seg:400 /noe /nod /nol \ @@ -72,8 +75,19 @@ $(GLIB): $(GLIBS) $(KLIB) $(CLIB) $(GDEF) gss_glue.obj ##WIN32## link $(WINDLLFLAGS) /def:$(GDEF) /out:$*.dll \ ##WIN32## gss_glue.obj $(GLIBS) $(KLIB) $(CLIB) $(WINLIBS) -krb_glue.obj: win_glue.c +$(K4LIB): $(K4LIBS) $(KLIB) $(CLIB) $(K4DEF) k4_glue.obj +##WIN16## link /co /seg:400 /noe /nod /nol \ +##WIN16## k4_glue, $*.dll, $*.map, \ +##WIN16## $(K4LIBS) $(KLIB) $(CLIB) $(WINLIBS), $(K4DEF) +##WIN16## rc /nologo /p /k $*.dll +##WIN16## implib /nologo $@ $*.dll +##WIN32## link $(WINDLLFLAGS) /def:$(K4DEF) /out:$*.dll \ +##WIN32## k4_glue.obj $(K4LIBS) $(KLIB) $(CLIB) $(WINLIBS) + +k5_glue.obj: win_glue.c $(CC) $(CFLAGS) /c /DKRB5=1 /Fo$@ $** +k4_glue.obj: win_glue.c + $(CC) $(CFLAGS) /c /DKRB4=1 /Fo$@ $** gss_glue.obj: win_glue.c $(CC) $(CFLAGS) /c /DGSSAPI=1 /Fo$@ $** no_glue.obj: win_glue.c @@ -85,10 +99,10 @@ no_glue.obj: win_glue.c # Build Convenience comerr.lib: $(CLIB) +krb4.lib: $(K4LIB) krb5.lib: $(KLIB) gssapi.lib: $(GLIB) - sap_glue.obj: win_glue.c $(CC) $(CFLAGS) -DSAP_TIMEBOMB -I$(VERS_DIR) /c /Fo$@ win_glue.c @@ -112,9 +126,9 @@ all-windows:: @echo Making in lib\des425 cd ..\des425 -$(MAKE) -$(MFLAGS) -# @echo Making in lib\krb4 -# cd ..\krb4 -# -$(MAKE) -$(MFLAGS) + @echo Making in lib\krb4 + cd ..\krb4 + -$(MAKE) -$(MFLAGS) @echo Making in lib\gssapi cd ..\gssapi -$(MAKE) -$(MFLAGS) @@ -137,9 +151,9 @@ clean-windows:: @echo Making clean in lib\des425 cd ..\des425 -$(MAKE) -$(MFLAGS) clean -# @echo Making clean in lib\krb4 -# cd ..\krb4 -# -$(MAKE) -$(MFLAGS) clean + @echo Making clean in lib\krb4 + cd ..\krb4 + -$(MAKE) -$(MFLAGS) clean @echo Making clean in lib\gssapi cd ..\gssapi -$(MAKE) -$(MFLAGS) clean diff --git a/src/lib/krb4_16.def b/src/lib/krb4_16.def new file mode 100644 index 000000000..c09930d0f --- /dev/null +++ b/src/lib/krb4_16.def @@ -0,0 +1,61 @@ +;----------------------------- +; KERBEROS.DEF - module definition file +;----------------------------- + +LIBRARY KRB4_16 +DESCRIPTION 'DLL for Kerberos support' +EXETYPE WINDOWS +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE SINGLE +HEAPSIZE 8192 + +EXPORTS + LibMain @1001 RESIDENTNAME + WEP @1002 +; + dest_tkt + get_service_key + in_tkt + kname_parse + krb_check_auth + krb_get_admhst + krb_get_cred + krb_get_default_user + krb_get_err_text + krb_get_krbhst + krb_get_lrealm + krb_get_phost + krb_get_pw_in_tkt + krb_get_pw_in_tkt_preauth + krb_get_svc_in_tkt + krb_get_tf_fullname + krb_get_tf_realm + krb_get_ticket_for_service + krb_mk_auth + krb_mk_err + krb_mk_priv + krb_mk_req + krb_mk_safe + krb_rd_err + krb_rd_priv + krb_rd_req + krb_rd_safe + krb_realmofhost + krb_recvauth + krb_save_credentials + krb_set_default_user +; kuserok + put_svc_key + read_service_key +; kadm_change_pw2 +; kadm_init_link +; kadm_get_err_text +; kadm_change_pw +; kstream_create_from_fd +; kstream_create_rlogin_from_fd +; kstream_create_rcp_from_fd +; kstream_write +; kstream_read +; kstream_flush +; kstream_destroy +; kstream_set_buffer_mode diff --git a/src/lib/krb4_32.def b/src/lib/krb4_32.def new file mode 100644 index 000000000..a0ea6852d --- /dev/null +++ b/src/lib/krb4_32.def @@ -0,0 +1,58 @@ +;----------------------------- +; KERBEROS.DEF - module definition file +;----------------------------- + +;LIBRARY KRB4_16 +DESCRIPTION 'DLL for Kerberos support' +;EXETYPE WINDOWS +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE SINGLE +HEAPSIZE 8192 + +EXPORTS + dest_tkt + get_service_key + in_tkt + kname_parse + krb_check_auth + krb_get_admhst + krb_get_cred + krb_get_default_user + krb_get_err_text + krb_get_krbhst + krb_get_lrealm + krb_get_phost + krb_get_pw_in_tkt + krb_get_pw_in_tkt_preauth + krb_get_svc_in_tkt + krb_get_tf_fullname + krb_get_tf_realm + krb_get_ticket_for_service + krb_mk_auth + krb_mk_err + krb_mk_priv + krb_mk_req + krb_mk_safe + krb_rd_err + krb_rd_priv + krb_rd_req + krb_rd_safe + krb_realmofhost + krb_recvauth + krb_save_credentials + krb_set_default_user +; kuserok + put_svc_key + read_service_key +; kadm_change_pw2 +; kadm_init_link +; kadm_get_err_text +; kadm_change_pw +; kstream_create_from_fd +; kstream_create_rlogin_from_fd +; kstream_create_rcp_from_fd +; kstream_write +; kstream_read +; kstream_flush +; kstream_destroy +; kstream_set_buffer_mode diff --git a/src/lib/krb5_16.def b/src/lib/krb5_16.def index db9b26f9d..315fb4d3a 100644 --- a/src/lib/krb5_16.def +++ b/src/lib/krb5_16.def @@ -166,7 +166,11 @@ EXPORTS des_ecb_encrypt des_new_random_key des_key_sched + des_pcbc_encrypt + des_quad_cksum + des_string_to_key des_set_random_generator_seed + profile_get_values krb5_random_confounder krb5_size_opaque krb5_internalize_opaque diff --git a/src/lib/krb5_32.def b/src/lib/krb5_32.def index c8f43ac63..4e18457a7 100644 --- a/src/lib/krb5_32.def +++ b/src/lib/krb5_32.def @@ -162,7 +162,11 @@ EXPORTS des_ecb_encrypt des_new_random_key des_key_sched + des_pcbc_encrypt + des_quad_cksum + des_string_to_key des_set_random_generator_seed + profile_get_values krb5_random_confounder krb5_size_opaque krb5_internalize_opaque diff --git a/src/lib/win_glue.c b/src/lib/win_glue.c index b05024a65..aab6509c1 100644 --- a/src/lib/win_glue.c +++ b/src/lib/win_glue.c @@ -17,9 +17,29 @@ */ /* We can't include winsock.h directly because of /Za (stdc) options */ +#ifdef KRB4 +#include +#endif + #define NEED_SOCKETS #include "k5-int.h" +#if defined(GSSAPI) && !defined(KRB5) +#define KRB5 1 +#endif +#if (defined(KRB4) || defined(KRB5)) && !defined(NEED_WINSOCK) +#define NEED_WINSOCK 1 +#endif + +#ifdef KRB4 +#include +#endif +#ifdef GSSAPI +#include "gssapi/generic/gssapi_err_generic.h" +#include "gssapi/krb5/gssapi_err_krb5.h" +#endif + + /* * #defines for MIT-specific time-based timebombs and/or version * server for the Kerberos DLL. @@ -58,14 +78,6 @@ #include -#if defined(GSSAPI) && !defined(KRB5) -#define KRB5 1 -#endif -#if defined(KRB5) && !defined(NEED_WINSOCK) -#define NEED_WINSOCK 1 -#endif - - /* * Use the version server to give us some control on distribution and usage * We're going to test track as well @@ -110,7 +122,6 @@ static int CallVersionServer(app_title, app_version, app_ini, code_cover) VSDestroyRequest(vrequest); return (0); } - #endif #ifdef TIMEBOMB @@ -194,49 +205,64 @@ win_socket_initialize() } #endif +static HINSTANCE hlibinstance; + +HINSTANCE get_lib_instance() +{ + return hlibinstance; +} + + #ifdef _WIN32 BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved) { - switch (fdwReason) - { - case DLL_PROCESS_ATTACH: + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + hlibinstance = (HINSTANCE) hModule; #ifdef NEED_WINSOCK - win_socket_initialize (); + win_socket_initialize (); +#endif +#ifdef KRB4 + initialize_krb_error_table(); #endif #ifdef KRB5 - krb5_init_ets((krb5_context)0); + krb5_init_ets((krb5_context)0); #endif #ifdef GSSAPI - initialize_k5g_error_table(); - initialize_ggss_error_table(); + initialize_k5g_error_table(); + initialize_ggss_error_table(); #endif - break; + break; - case DLL_THREAD_ATTACH: - break; + case DLL_THREAD_ATTACH: + break; - case DLL_THREAD_DETACH: - break; + case DLL_THREAD_DETACH: + break; - case DLL_PROCESS_DETACH: + case DLL_PROCESS_DETACH: #ifdef GSSAPI - cleanup_k5g_error_table(); - cleanup_ggss_error_table(); + cleanup_k5g_error_table(); + cleanup_ggss_error_table(); #endif #ifdef KRB5 - krb5_finish_ets((krb5_context)0); + krb5_finish_ets((krb5_context)0); +#endif +#ifdef KRB4 + cleanup_krb_error_table(); #endif #ifdef NEED_WINSOCK - WSACleanup (); + WSACleanup (); #endif - break; + break; - default: - return FALSE; - } + default: + return FALSE; + } - return TRUE; // successful DLL_PROCESS_ATTACH + return TRUE; // successful DLL_PROCESS_ATTACH } #else @@ -248,9 +274,13 @@ WORD wDataSeg; WORD cbHeap; LPSTR CmdLine; { + hlibinstance = hInst; #ifdef NEED_WINSOCK win_socket_initialize (); #endif +#ifdef KRB4 + initialize_krb_error_table(); +#endif #ifdef KRB5 krb5_init_ets((krb5_context)0); #endif @@ -272,6 +302,9 @@ WEP(nParam) #ifdef KRB5 krb5_finish_ets((krb5_context)0); #endif +#ifdef KRB4 + cleanup_krb_error_table(); +#endif #ifdef NEED_WINSOCK WSACleanup(); #endif