Build krb4 compatibility library for win16/win32
authorRichard Basch <probe@mit.edu>
Tue, 18 Feb 1997 05:41:33 +0000 (05:41 +0000)
committerRichard Basch <probe@mit.edu>
Tue, 18 Feb 1997 05:41:33 +0000 (05:41 +0000)
(including application server routines, such as krb_rd_req)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9883 dc483132-0cff-0310-8789-dd5450dbe970

48 files changed:
src/lib/krb4/ChangeLog
src/lib/krb4/Makefile.in
src/lib/krb4/ad_print.c
src/lib/krb4/dest_tkt.c
src/lib/krb4/err_txt.c
src/lib/krb4/g_admhst.c
src/lib/krb4/g_cnffile.c
src/lib/krb4/g_cred.c
src/lib/krb4/g_krbhst.c
src/lib/krb4/g_krbrlm.c
src/lib/krb4/g_phost.c
src/lib/krb4/g_pw_in_tkt.c
src/lib/krb4/g_svc_in_tkt.c
src/lib/krb4/g_tf_fname.c
src/lib/krb4/g_tf_realm.c
src/lib/krb4/g_tkt_svc.c
src/lib/krb4/getst.c
src/lib/krb4/in_tkt.c
src/lib/krb4/kerberos.def [deleted file]
src/lib/krb4/klog.c
src/lib/krb4/kname_parse.c
src/lib/krb4/kparse.c
src/lib/krb4/kuserok.c
src/lib/krb4/log.c
src/lib/krb4/memcache.c
src/lib/krb4/mk_auth.c
src/lib/krb4/mk_err.c
src/lib/krb4/mk_preauth.c
src/lib/krb4/mk_priv.c
src/lib/krb4/mk_req.c
src/lib/krb4/mk_safe.c
src/lib/krb4/put_svc_key.c
src/lib/krb4/rd_err.c
src/lib/krb4/rd_priv.c
src/lib/krb4/rd_req.c
src/lib/krb4/rd_safe.c
src/lib/krb4/rd_svc_key.c
src/lib/krb4/realmofhost.c
src/lib/krb4/recvauth.c
src/lib/krb4/save_creds.c
src/lib/krb4/send_to_kdc.c
src/lib/krb4/tf_util.c
src/lib/krb4/tkt_string.c
src/lib/krb4/unix_glue.c
src/lib/krb4/win_glue.c
src/lib/krb4/win_store.c
src/lib/krb4/win_time.c
src/lib/krb4/winsock.def [deleted file]

index 3d6fc389fe22acb9bc9d67fa91e5d749c8bc2c11..97b7d21a3f8af229fe97ee784e36ca4eac4576bd 100644 (file)
@@ -1,3 +1,15 @@
+Sun Feb 16 21:11:51 1997  Richard Basch  <basch@lehman.com>
+
+       * Makefile.in: Win16/Win32 cleanup
+
+       * err_txt.c g_admhst.c g_cred.c g_krbhst.c g_krbrlm.c g_phost.c
+       g_pw_in_tkt.c g_svc_in_tkt.c g_tkt_svc.c kname_parse.c mk_auth.c
+       mk_err.c mk_preauth.c mk_priv.c mk_req.c mk_safe.c rd_err.c
+       rd_priv.c rd_req.c rd_safe.c rd_svc_key.c realmofhost.c
+       recvauth.c save_creds.c unix_glue.c
+               Changed declaration of functions to use
+               KRB5_DLLIMP/KRB5_CALLCONV instead of INTERFACE.
+
 Sat Feb  1 08:44:00 1997  Ezra Peisach  <epeisach@mit.edu>
 
        * Makefile.in (STOBJLISTS): Fix up des425 reference.
index e22da54ef361521e1c23eda2f5ec1c73a8acb254..1a369f73e4a6e67d888085f16c2b807fb651a4ca 100644 (file)
@@ -1,8 +1,9 @@
 CFLAGS = $(CCOPTS) $(DEFS) $(DEFINES)
 DEFINES=-I$(srcdir)/../../include/kerberosIV
 
-##DOSBUILDTOP = ..\..\..
-##DOSLIBNAME=..\krb5.lib
+##DOS##BUILDTOP = ..\..
+##DOS##LIBNAME=krb4.lib
+##DOS##OBJFILE=krb4.lst
 
 LIB=krb4
 LIBMAJOR=1
@@ -50,8 +51,7 @@ OBJS  = \
        stime.$(OBJEXT) \
        rd_preauth.$(OBJEXT) \
        mk_preauth.$(OBJEXT) \
-       unix_time.$(OBJEXT) \
-       $(CACHEOBJS) $(SETENVOBJS) $(STRCASEOBJS) $(SHMOBJS) \
+       $(OSOBJS) $(CACHEOBJS) $(SETENVOBJS) $(STRCASEOBJS) $(SHMOBJS) \
        $(LIB_KRB_HOSTOBJS) $(SERVER_KRB_OBJS) $(NETIO_OBJS) $(REALMDBOBJS)
 
 SRCS = \
@@ -87,7 +87,7 @@ SRCS = \
        $(srcdir)/rd_preauth.c \
        $(srcdir)/mk_preauth.c \
        $(srcdir)/unix_time.c \
-       $(CACHESRCS) $(SETENVSRCS) $(STRCASESRCS) $(SHMSRCS) \
+       $(OSSRCS) $(CACHESRCS) $(SETENVSRCS) $(STRCASESRCS) $(SHMSRCS) \
        $(LIB_KRB_HOSTSRCS) $(SERVER_KRB_SRCS) $(NETIO_SRCS) $(REALMDBSRCS)
 
 STLIBOBJS  = $(OBJS)
@@ -107,6 +107,13 @@ SHLIB_EXPLIBS=-lkrb5 $(KRB4_CRYPTO_LIBS) -lcrypto -lcom_err
 SHLIB_DIRS=-L$(TOPLIBD)
 SHLIB_RDIRS=$(KRB5_LIBDIR)
 
+#
+# These objects implement the time computation routines.
+#
+OSOBJS = unix_time.$(OBJEXT)
+OSSRCS = unix_time.c
+
+##DOS##OSOBJS = win_time.obj
 
 #
 # These objects implement ticket cacheing for Unix.  They are
@@ -119,14 +126,20 @@ CACHEOBJS=tf_util.$(OBJEXT) dest_tkt.$(OBJEXT) in_tkt.$(OBJEXT) \
        tkt_string.$(OBJEXT) g_tf_fname.$(OBJEXT) g_tf_realm.$(OBJEXT) \
        g_cred.$(OBJEXT) save_creds.$(OBJEXT)
 
+##DOS##CACHEOBJS = memcache.$(OBJEXT)
+
 #
 # These objects implement Kerberos realm<->host database lookup.
 # They read config files and/or network databases in various ways
 # on various platforms.
 #
-REALMDBSRCS= $(srcdir)/g_cnffile.c $(srcdir)/g_krbhst.c $(srcdir)/g_krbrlm.c \
+
+CNFFILE = g_cnffile
+##DOS##CNFFILE = win_store
+
+REALMDBSRCS= $(srcdir)/$(CNFFILE).c $(srcdir)/g_krbhst.c $(srcdir)/g_krbrlm.c \
        $(srcdir)/g_admhst.c $(srcdir)/realmofhost.c 
-REALMDBOBJS= g_cnffile.$(OBJEXT) g_krbhst.$(OBJEXT) g_krbrlm.$(OBJEXT) \
+REALMDBOBJS= $(CNFFILE).$(OBJEXT) g_krbhst.$(OBJEXT) g_krbrlm.$(OBJEXT) \
        g_admhst.$(OBJEXT) realmofhost.$(OBJEXT) 
 
 #
@@ -162,35 +175,30 @@ NETIO_OBJS=netread.$(OBJEXT) netwrite.$(OBJEXT)
 LIB_KRB_HOSTSRCS=$(srcdir)/unix_glue.c
 LIB_KRB_HOSTOBJS=unix_glue.$(OBJEXT)
 
-LIBNAME=libkrb4.$(STEXT)
+##DOS##LIB_KRB_HOSTOBJS=win_glue.obj
 
 ARCHIVEARGS= $@ $(OBJS)
 
 CODE=$(SRCS) Makefile.in krb_err.et
 
-all:: all-really
-
-#### include configury here
-##DOS!include ..\..\config\common
-##DOS!include ..\..\config\mt-win
-
-# We only have a final value of $(WHAT) at this point, and Microsoft
-# NMAKE expands the macros in dependency lines before it finishes reading
-# the whole file (sigh)...
-all-really:: all-$(WHAT)
-
 # We want *library* compiler options...
 DBG=$(DBG_LIB)
 
+
 all-unix:: krb_err.h includes all-liblinks
+all-windows:: $(OBJFILE)
+
+##DOS$(OBJFILE): $(OBJS)
+##DOS  $(RM) $(OBJFILE)
+##WIN16##      $(CP) nul: $(OBJFILE)
+##WIN32##      $(LIBECHO) *.obj > $(OBJFILE)
+
 
 # comp_et_depend(krb_err)
 krb_err.h:: krb_err.et
 krb_err.c: krb_err.et
 
 depend:: krb_err.h
-#
-
 depend:: $(CODE) 
 
 #install-unix::
@@ -199,50 +207,11 @@ depend:: $(CODE)
 
 DEFINES=$(FALLBACK) $(OLD_SRVTAB) $(OLD_KLOGIN) -I$(srcdir)/../../include/kerberosIV
 
-#
-# What we build for `all' and `install' targets on Windows
-#
-all-windows: winsock.lib kerberos.lib kerberos.dll
-
-install-windows:
-       copy winsock.lib  ..\..\floppy
-       copy kerberos.lib ..\..\floppy
-       copy kerberos.dll ..\..\floppy
-
-#
-# The "Import Library" definitions for MS-Windows
-#
-kerberos.lib: kerberos.dll
-       implib /nologo $@ $(@R).dll
-
-winsock.lib:  winsock.def
-       implib /nologo winsock.lib winsock.def
-
-#
-# The Kerberos "Dynamic Link Library" for MS-Windows
-#
-kerberos.dll: kerberos.def winsock.lib \
-       $(DES_LIB_FOR_DLL) $(KADM_LIB_FOR_DLL) $(KSTREAM_LIB_FOR_DLL) \
-       $(LIBNAME)
-       $(RM) $@
-# this a.def and a.dll stuff is for line-too-long crap
-       copy kerberos.def a.def
-       copy $(DES_LIB_FOR_DLL)     a.lib
-       copy $(KADM_LIB_FOR_DLL)    b.lib
-       copy $(KSTREAM_LIB_FOR_DLL) c.lib
-       link /nologo /noe debug, $@,,\
-               $(LIBNAME) a.lib b.lib c.lib\
-               winsock ldllcew libw, $(@R).def
-       del a.lib
-       del b.lib
-       del c.lib
-       rc /p /k $@
-
 clean:: 
-       -$(RM) $(LIBNAME)
-       -$(RM) *.$(OBJEXT)
+       -$(RM) $(OBJS)
 
 clean-:: clean-unix
+
 clean-unix::
        -$(RM) krb_err.c
        -$(RM) krb_err.h
@@ -250,26 +219,10 @@ clean-unix::
 
 clean-unix:: clean-liblinks clean-libs clean-libobjs
 
-clean-windows::
-       -$(RM) kerberos.lib
-       -$(RM) kerberos.bak
-       -$(RM) kerberos.dll
-       -$(RM) kerberos.lst
-       -$(RM) kerberos.map
-       -$(RM) libkrb.lst
-       -$(RM) libkrb.bak
-       -$(RM) winsock.lib
-       -$(RM) msvc.pdb
-       -$(RM) proj.err
-       -$(RM) ..\..\floppy\winsock.lib
-       -$(RM) ..\..\floppy\kerberos.lib
-       -$(RM) ..\..\floppy\kerberos.dll
-
-
 
 check-unix:: $(TEST_PROGS)
 check-mac:: $(TEST_PROGS)
-
 check-windows::
 
+
 install-unix:: install-libs
index 797293751cd10e36b00be214f7bc4cee737d1ac2..0d83fbe2a648c8739fc78fe918374f7f2d375ee3 100644 (file)
@@ -15,6 +15,8 @@
 #include "des.h"
 #include <stdio.h>
 
+#ifndef _WINDOWS
+
 /*
  * Print some of the contents of the given authenticator structure
  * (AUTH_DAT defined in "krb.h").  Fields printed are:
@@ -64,3 +66,5 @@ placebo_cblock_print(x)
     printf(" }");
 }
 #endif /* NOENCRYPTION */
+
+#endif
index 7830a859fa853f0a633b89d856883d035b86a3da..560c3e3683e968e5c666b70d65d42660f0a12f60 100644 (file)
 #include "mit-copyright.h"
 #include "krb.h"
 #include <stdio.h>
-#include <sys/file.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 #ifdef TKT_SHMEM
 #include <sys/param.h>
 #endif
 #include <errno.h>
-#include <fcntl.h>
 
 #ifndef O_SYNC
 #define O_SYNC 0
@@ -32,6 +31,7 @@
  * The ticket file (TKT_FILE) is defined in "krb.h".
  */
 
+KRB5_DLLIMP int KRB5_CALLCONV
 dest_tkt()
 {
     char *file = TKT_FILE;
index 0b7697ea8b6e1aab545ed5d152872aa4b43f7579..8cf00928738c34d6136442fb389e2770882a3c39 100644 (file)
@@ -22,7 +22,7 @@ const
 #ifdef MULTIDIMENSIONAL_ERR_TXT
  char krb_err_txt[256][60] = {  
 #else 
- char *const krb_err_txt [256] = { 
+ char FAR *const krb_err_txt [256] = { 
 #endif
   "OK",                                                        /* 000 */
   "Principal expired (kerberos)",                      /* 001 */
@@ -283,12 +283,12 @@ const
 };
 
 
-const char * INTERFACE
-krb_get_err_text (errno)
-       int errno;
+KRB5_DLLIMP const char FAR * KRB5_CALLCONV
+krb_get_err_text (code)
+    int code;
 {
-    if (errno >= 0 && errno < (sizeof (krb_err_txt))/(sizeof *krb_err_txt))
-       return krb_err_txt[errno];
+    if (code >= 0 && code < (sizeof (krb_err_txt))/(sizeof *krb_err_txt))
+       return krb_err_txt[code];
     else
        return "Invalid Kerberos error code";
 }
index 68ac1f0dac83e8c2b85c12a5d2b6d59f7cca1107..c5bed3f68b3855e06565b69cc3ea2cd8a9e250aa 100644 (file)
  * provided by a nameserver.
  */
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_admhst(h, r, n)
-    char *h;
-    char *r;
+    char FAR *h;
+    char FAR *r;
     int n;
 {
     FILE *cnffile, *krb__get_cnffile();
index a212beb12248a2b44e7ba5f58fab3cbc2f313f74..07175b14608c2e5c891f02e103f9c1726bbdb238 100644 (file)
@@ -16,7 +16,7 @@
    it solves a problem for now. */
 
 #include <stdio.h>
-#include <krb.h>
+#include "krb.h"
 #include "k5-int.h"
 
 static FILE*
index 491861be662c2c7e033a32f4b112e8fa0a184bb8..c05fb9ba5706d95b17012cbe5a6347e7feb870d6 100644 (file)
  * On failure it returns a Kerberos error code.
  */
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_cred(service,instance,realm,c)
-    char *service;              /* Service name */
-    char *instance;             /* Instance */
-    char *realm;                /* Auth domain */
-    CREDENTIALS *c;             /* Credentials struct */
+    char FAR *service;         /* Service name */
+    char FAR *instance;                /* Instance */
+    char FAR *realm;           /* Auth domain */
+    CREDENTIALS FAR *c;                /* Credentials struct */
 {
     int tf_status;              /* return value of tf function calls */
 
index eaab289281149516e09339c138e9f71020635704..c95abdb20771c5bd49d91d465be284d35bced00a 100644 (file)
@@ -61,10 +61,10 @@ get_krbhst_default(h, r, n)
         return(KFAILURE);
 }
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_krbhst(h,r,n)
-    char *h;
-    char *r;
+    char FAR *h;
+    char FAR *r;
     int n;
 {
     FILE *cnffile, *krb__get_cnffile();
index f83beba366e2837935cb9008f515bbb7448d6960..c6f9345856cd713d7b0cd9bf2f5cb047e414f710 100644 (file)
@@ -31,7 +31,7 @@
 static char *krb_conf = KRB_CONF;
 
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_lrealm(r,n)
     char *r;
     int n;
index c740a495339adf1c76a82991b9aabddb5d22c97c..8caece37295cf177310bbb94078dd652b01ecb29 100644 (file)
@@ -32,9 +32,9 @@
  * to the original "alias" argument is returned.
  */
 
-char * INTERFACE
+KRB5_DLLIMP char FAR * KRB5_CALLCONV
 krb_get_phost(alias)
-    char *alias;
+    char FAR *alias;
 {
     struct hostent FAR *h;
     char *p;
@@ -59,7 +59,7 @@ krb_get_phost(alias)
        }
 #endif
        /* We don't want to return a FAR *, so we copy to a safe location. */
-       _fstrncpy (hostname_mem, h->h_name, sizeof (hostname_mem));
+       strncpy (hostname_mem, h->h_name, sizeof (hostname_mem));
        hostname_mem[MAXHOSTNAMELEN-1]='\0';
        p = strchr( hostname_mem, '.' );
         if (p)
index b633d164884c020b1f17b7054ae3e29d3d07c320..6723df87e37f62a36f8990b32f67b2db137c7893 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "mit-copyright.h"
 #include "krb.h"
+#include "krb_err.h"
 #include "prot.h"
 #include <string.h>
 
 #define NULL 0
 #endif
 
+#ifndef INTK_PW_NULL
+#define INTK_PW_NULL KRBET_GT_PW_NULL
+#endif
+
 /*
  * This file contains two routines: passwd_to_key() converts
  * a password into a DES key (prompting for the password if
@@ -87,11 +92,11 @@ passwd_to_key(user,instance,realm,passwd,key)
  * The result of the call to krb_get_in_tkt() is returned.
  */
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_pw_in_tkt(user,instance,realm,service,sinstance,life,password)
-    char *user, *instance, *realm, *service, *sinstance;
+    char FAR *user, FAR *instance, FAR *realm, FAR *service, FAR *sinstance;
     int life;
-    char *password;
+    char FAR *password;
 {
 #if defined(_WINDOWS) || defined(macintosh)
     /* In spite of the comments above, we don't allow that path here,
@@ -105,7 +110,7 @@ krb_get_pw_in_tkt(user,instance,realm,service,sinstance,life,password)
 #endif
 
     return(krb_get_in_tkt(user,instance,realm,service,sinstance,life,
-                          passwd_to_key,
+                          (key_proc_type)passwd_to_key,
                          (decrypt_tkt_type)NULL, password));
 }
 
@@ -126,11 +131,11 @@ static int stub_key(user,instance,realm,passwd,key)
    return 0;
 }
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_pw_in_tkt_preauth(user,instance,realm,service,sinstance,life,password)
-    char *user, *instance, *realm, *service, *sinstance;
+    char FAR *user, FAR *instance, FAR *realm, FAR *service, FAR *sinstance;
     int life;
-    char *password;
+    char FAR *password;
 {
    char *preauth_p;
    int   preauth_len;
@@ -143,8 +148,8 @@ krb_get_pw_in_tkt_preauth(user,instance,realm,service,sinstance,life,password)
      return INTK_PW_NULL;
 #endif
 
-   krb_mk_preauth(&preauth_p,&preauth_len, passwd_to_key,
-                 user,instance,realm,password,old_key);
+   krb_mk_preauth(&preauth_p, &preauth_len, (key_proc_type)passwd_to_key,
+                 user, instance, realm, password, old_key);
    ret_st = krb_get_in_tkt_preauth(user,instance,realm,service,sinstance,life,
                                   (key_proc_type) stub_key,
                                   (decrypt_tkt_type) NULL, password,
index e34ba5bdff68522893dac704cd09db7d25f3b74b..0a8f499c93b006e3999b6c3f56c67766ab73a320 100644 (file)
@@ -62,14 +62,14 @@ static int srvtab_to_key(user, instance, realm, srvtab, key)
  * It returns the return value of the krb_get_in_tkt() call.
  */
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_svc_in_tkt(user, instance, realm, service, sinstance, life, srvtab)
-    char *user, *instance, *realm, *service, *sinstance;
+    char FAR *user, FAR *instance, FAR *realm, FAR *service, FAR *sinstance;
     int life;
-    char *srvtab;
+    char FAR *srvtab;
 {
-    return(krb_get_in_tkt(user, instance, realm, service, sinstance,
-                          life, srvtab_to_key, NULL, srvtab));
+    return(krb_get_in_tkt(user, instance, realm, service, sinstance, life,
+                          (key_proc_type) srvtab_to_key, NULL, srvtab));
 }
 
 /* and we need a preauth version as well. */
@@ -92,10 +92,11 @@ krb_get_svc_in_tkt_preauth(user, instance, realm, service, sinstance, life, srvt
    int   preauth_len;
    int   ret_st;
  
-   krb_mk_preauth(&preauth_p,&preauth_len,
-                  srvtab_to_key,user,instance,realm,srvtab,old_key);
+   krb_mk_preauth(&preauth_p, &preauth_len,
+                  (key_proc_type) srvtab_to_key, user, instance, realm,
+                 srvtab, old_key);
    ret_st = krb_get_in_tkt_preauth(user,instance,realm,service,sinstance,life,
-                                  stub_key, NULL, srvtab,
+                                  (key_proc_type) stub_key, NULL, srvtab,
                                   preauth_p, preauth_len);
  
    krb_free_preauth(preauth_p, preauth_len);
index 9aef3cfdf23eed355ae527a90039dae60ec9374f..5235ff3a2c5135b19a07d2b431d9331b171b3476 100644 (file)
@@ -26,7 +26,7 @@
  * krb_get_in_tkt().
  */
 
-int
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_tf_fullname(ticket_file, name, instance, realm)
   char *ticket_file;
   char *name;
index 5de15284945363ee1edd56ed782e7242cbe032c1..55fe79ef042cfac19cc69330eec778c2d1fb02ef 100644 (file)
@@ -21,6 +21,7 @@
  * 
  */
 
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_tf_realm(ticket_file, realm)
   char *ticket_file;
   char *realm;
index a4f5c183c3d7e8a1eddf41292012265094248f09..48b407e0241ee8cc0ea0748412a46c2116edc724 100644 (file)
@@ -102,16 +102,16 @@ CredIsExpired( cr )
  * to get a new TGT.
  */ 
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_ticket_for_service (serviceName, buf, buflen, checksum, sessionKey,
                schedule, version, includeVersion)
-       char *serviceName;
-       char *buf;
-       unsigned KRB4_32 *buflen;
+       char FAR *serviceName;
+       char FAR *buf;
+       unsigned KRB4_32 FAR *buflen;
        int checksum;
        des_cblock sessionKey;
        Key_schedule schedule;
-       char *version;
+       char FAR *version;
        int includeVersion;
 {
        char service[SNAME_SZ];
index 3ff05bd31f2377ab8b87b911c772eba3a7fd2a22..c2f15edc01a474219f3241590d947065a2bc42d2 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "mit-copyright.h"
+#include "krb.h"
 
 /*
  * getst() takes a file descriptor, a string and a count.  It reads
index 42cfed43d9a41ea19938147ccdd4effefc6d550f..bc5c2b31c73b7b4e5f3fc52afa23e0a984304542 100644 (file)
@@ -12,7 +12,6 @@
 #include <stdio.h>
 #include <string.h>
 #include "krb.h"
-#include <sys/file.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #ifdef TKT_SHMEM
@@ -42,6 +41,7 @@ extern int krb_debug;
 #define O_SYNC 0
 #endif
 
+KRB5_DLLIMP int KRB5_CALLCONV
 in_tkt(pname,pinst)
     char *pname;
     char *pinst;
diff --git a/src/lib/krb4/kerberos.def b/src/lib/krb4/kerberos.def
deleted file mode 100644 (file)
index f8124aa..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-;-----------------------------
-;   KERBEROS.DEF - module definition file
-;-----------------------------
-
-LIBRARY   KERBEROS
-DESCRIPTION 'DLL for Kerberos support'
-EXETYPE   WINDOWS
-CODE     PRELOAD MOVEABLE DISCARDABLE
-DATA     PRELOAD MOVEABLE SINGLE
-HEAPSIZE  8192
-
-EXPORTS
-       WEP @1 RESIDENTNAME
-       LIBMAIN                         @2
-
-       DES_CBC_ENCRYPT                 @3
-       DES_KEY_SCHED                   @4
-       DES_STRING_TO_KEY               @5
-       DEST_TKT                        @6
-       KNAME_PARSE                     @7
-       KRB_CHECK_AUTH                  @8
-       KRB_END_SESSION                 @9
-       KRB_GET_ADMHST                  @10
-       KRB_GET_CRED                    @11
-       KRB_GET_DEFAULT_USER            @12
-       KRB_GET_ERR_TEXT                @14
-       KRB_GET_LREALM                  @15
-       KRB_GET_PHOST                   @16
-       KRB_GET_PW_IN_TKT               @17
-       KRB_MK_AUTH                     @18
-       KRB_MK_PRIV                     @19
-       KRB_MK_REQ                      @20
-       KRB_RD_PRIV                     @21
-       KRB_REALMOFHOST                 @22
-       KRB_SAVE_CREDENTIALS            @23
-       KRB_START_SESSION               @24
-       KRB_GET_PW_IN_TKT_PREAUTH       @25
-       KRB_GET_NOTIFICATION_MESSAGE    @26
-       KADM_CHANGE_PW2                 @27
-       KADM_INIT_LINK                  @28
-       KADM_GET_ERR_TEXT               @29
-       KADM_CHANGE_PW                  @30
-       DES_ECB_ENCRYPT                 @31
-       DES_PCBC_ENCRYPT                @32
-       DES_IS_WEAK_KEY                 @33
-       DES_FIXUP_KEY_PARITY            @34
-       DES_CHECK_KEY_PARITY            @35
-       IN_TKT                          @36
-       KRB_DELETE_CRED                 @37
-       KRB_GET_KRBHST                  @38
-       KRB_GET_NTH_CRED                @39
-       KRB_GET_NUM_CRED                @40
-       KRB_GET_TF_FULLNAME             @41
-       KRB_GET_TICKET_FOR_SERVICE      @42
-       KRB_MK_ERR                      @43
-       KRB_MK_SAFE                     @44
-       KRB_RD_ERR                      @45
-       KRB_RD_SAFE                     @46
-       KRB_SET_DEFAULT_USER            @47
-       KSTREAM_CREATE_FROM_FD          @48
-       KSTREAM_CREATE_RLOGIN_FROM_FD   @49
-       KSTREAM_CREATE_RCP_FROM_FD      @50
-       KSTREAM_WRITE                   @51
-       KSTREAM_READ                    @52
-       KSTREAM_FLUSH                   @53
-       KSTREAM_DESTROY                 @54
-       KSTREAM_SET_BUFFER_MODE         @55
-
index f838fb7856c13757ec3ecd1c227a7a92d9f89210..e04e0200dd68234b40ea40070364a0e62c3e3c3e 100644 (file)
@@ -9,10 +9,11 @@
  */
 
 #include "mit-copyright.h"
+#include "krb.h"
 #ifdef HAVE_TIME_H
 #include <time.h>
 #endif
-#ifndef VMS
+#if !defined(VMS) && !defined(_WINDOWS)
 #include <sys/time.h>
 #endif
 #include <stdio.h>
index 059d0842839ab12a8b50c7c47b6ea1b5bef5db29..53d8fb77c60de7bf752f96325c430f69b1a430f7 100644 (file)
  * of name, instance, and realm.  FIXME-gnu:  Does anyone use it this way?
  */
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 kname_parse(np, ip, rp, fullname)
-    char *np, *ip, *rp, *fullname;
+    char FAR *np;
+    char FAR *ip;
+    char FAR *rp;
+    char FAR *fullname;
 {
     char buf[FULL_SZ];
     char *rnext, *wnext;       /* next char to read, write */
index e0fc20ceb5c7fb33aebd3e8ccc2016f94569534c..198ae1e8984ae0a2bfe0f8d96d11ac54526164e6 100644 (file)
@@ -33,6 +33,7 @@
  */
 
 #include "mit-copyright.h"
+#include "krb.h"
 #include <stdio.h>
 #include <ctype.h>
 #include <kparse.h>
 #define MAXKEY          80
 #define MAXVALUE        80
 
-extern char *malloc();
-
 static char *strutol();
+
 #ifndef HAVE_STRSAVE
 static char *strsave();
 #endif
+#ifndef HAS_STDLIB_H
+extern char *malloc();
+#endif
 
 static int sLineNbr=1;         /* current line nbr in parameter file */
 static char ErrorMsg[80];      /* meaningful only when KV_SYNTAX, PS_SYNTAX,
index 6f45afeb38d7bbc775abcd6c680bb7129dd22776..8f9a0b0503920a62ef1021fd6bcc6a3739c8bd09 100644 (file)
  */
 
 #include "mit-copyright.h"
-
 #include "krb.h"
+
+#if !defined(_WINDOWS)
+
 #include <stdio.h>
 #include <pwd.h>
 #include <sys/param.h>
@@ -93,9 +95,10 @@ parmtable kparm[] = {
 #define KPARMS kparm,PARMCOUNT(kparm)
 #endif
 
+KRB5_DLLIMP int KRB5_CALLCONV
 kuserok(kdata, luser)
-    AUTH_DAT *kdata;
-    char   *luser;
+    AUTH_DAT   FAR *kdata;
+    char       FAR *luser;
 {
     struct stat sbuf;
     struct passwd *pwd;
@@ -231,3 +234,5 @@ kuserok(kdata, luser)
     fclose(fp);
     return(isok);
 }
+
+#endif
index b41954491a4fff5335b62062cff378361d1f11ef..d317550556deee4ba995b8bd0c4dfc24e87f3599 100644 (file)
 #endif
 
 #include "mit-copyright.h"
+#include "krb.h"
 #ifdef HAVE_TIME_H
 #include <time.h>
 #endif
-#ifndef VMS
+#if !defined(VMS) && !defined(_WINDOWS)
 #include <sys/time.h>
 #endif
 #include <stdio.h>
index 46376885c8d9b7f6a5523f0b3c42d2aa201ab842..52d3601f9c7d0190906c32ebd8779de0751139a6 100644 (file)
  * in_tkt.c, dest_tkt.c, tf_util.c, and tkt_string.c.
  */
 
+#include "krb.h"
+
 #ifdef _WINDOWS
-#include <windows.h>
-#include <malloc.h>    /* REQUIRED for near/far declarations */
+#include <errno.h>
+
+typedef DWORD OSErr;
+#define noErr 0
+#define cKrbCredsDontExist 12001
+#define cKrbSessDoesntExist 12002
+#define OFFSETOF(x) x
+#define _nmalloc malloc
+#define _nrealloc realloc
+#define _nfree free
+#define memFullErr ENOMEM
 #endif
 
 #ifndef unix
@@ -24,7 +35,6 @@
 #endif
 
 #ifdef unix
-
 /* Unix interface to memory cache Mac functions.  */
 
 #include <stdio.h>
@@ -47,9 +57,9 @@ typedef int OSErr;
 
 #endif /* unix */
 
-#include "krb.h"
 #include "memcache.h"
 
+
 /* Lower level data structures  */
 
 static int             fNumSessions = 0;
@@ -206,7 +216,7 @@ change_cache()
  * message will be broadcast to all top level windows when
  * the credential cache changes.
  */
-unsigned int INTERFACE
+unsigned int
 krb_get_notification_message(void)
 {
        static UINT message = 0;
@@ -221,8 +231,6 @@ krb_get_notification_message(void)
 #endif /* Windows */
 
 
-#include "krb_driver.h"
-
 /* The low level routines in this file are capable of storing
    tickets for multiple "sessions", each led by a different
    ticket-granting ticket.  For now, since the top level code
@@ -264,7 +272,7 @@ static char curr_auth_uinst [INST_SZ];
     via ResEdit.
 
  */
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 in_tkt(pname,pinst)
     char *pname;
     char *pinst;
@@ -291,7 +299,7 @@ in_tkt(pname,pinst)
  * failure.
  *
  */
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 dest_tkt()
 {
        /*      
@@ -350,7 +358,7 @@ int dest_all_tkts()
 
 
 /* krb_get_tf_realm -- return the realm of the current ticket file. */
-int
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_tf_realm (tktfile, lrealm)
        char *tktfile;
        char *lrealm;           /* Result stored through here */
@@ -362,7 +370,7 @@ krb_get_tf_realm (tktfile, lrealm)
 
 /* krb_get_tf_fullname -- return name, instance and realm of the
 principal in the current ticket file. */
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_tf_fullname (tktfile, name, instance, realm)
   char *tktfile;
   char *name;
@@ -413,7 +421,7 @@ krb_get_tf_fullname (tktfile, name, instance, realm)
  * information from the file.  If successful, it returns KSUCCESS.
  * On failure it returns a Kerberos error code.
  */
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_get_cred (service, instance, realm, c)
        char *service;          /* Service name */
        char *instance;         /* Instance */
@@ -453,7 +461,7 @@ krb_get_cred (service, instance, realm, c)
  * Returns KSUCCESS if all goes well, otherwise KFAILURE.
  */
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_save_credentials(sname, sinst, srealm, session, 
                        lifetime, kvno, ticket, issue_date)
 
@@ -484,7 +492,7 @@ krb_save_credentials(sname, sinst, srealm, session,
        return KSUCCESS;
 }
 
-int INTERFACE
+int
 krb_delete_cred (sname, sinstance, srealm)
        char *sname;
        char *sinstance;
@@ -504,7 +512,7 @@ krb_delete_cred (sname, sinstance, srealm)
     */
 }      
 
-int INTERFACE
+int
 krb_get_nth_cred (sname, sinstance, srealm, n)
        char *sname;
        char *sinstance;
@@ -521,7 +529,7 @@ krb_get_nth_cred (sname, sinstance, srealm, n)
  * Return the number of credentials in the current credential cache (ticket cache).
  * On error, returns -1. 
  */
-int INTERFACE
+int
 krb_get_num_cred ()
 {
   int n;
index 2b092809419b23bd551e2d0840c78d210e05fca7..39a2e2f68b7b0811cb7b2de74cec6765c7012913 100644 (file)
@@ -14,7 +14,6 @@
 #define        DEFINE_SOCKADDR         /* Ask for sockets declarations from krb.h. */
 #include <stdio.h>
 #include "krb.h"
-#include "krb4-proto.h"
 #include <errno.h>
 #include <string.h>
 
 /*
  * Build a "sendauth" packet compatible with Unix sendauth/recvauth.
  */
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_mk_auth(options, ticket, service, inst, realm, checksum, version, buf)
      long options;             /* bit-pattern of options */
      KTEXT ticket;             /* where to put ticket (return); or
                                   supplied in case of KOPT_DONT_MK_REQ */
-     char *service;            /* service name */
-     char *inst;               /* instance (OUTPUT canonicalized) */
-     char *realm;              /* realm */
+     char FAR *service;                /* service name */
+     char FAR *inst;           /* instance (OUTPUT canonicalized) */
+     char FAR *realm;          /* realm */
      unsigned KRB4_32 checksum; /* checksum to include in request */
-     char *version;            /* version string */
+     char FAR *version;                /* version string */
      KTEXT buf;                        /* Output buffer to fill  */
 {
     int rem, i;
@@ -186,15 +185,15 @@ krb_mk_auth(options, ticket, service, inst, realm, checksum, version, buf)
  * and "schedule" returns the key schedule for that decryption.  The
  * the local and server addresses are given in "laddr" and "faddr".
  */
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_check_auth (buf, checksum, msg_data, session, schedule, laddr, faddr)
      KTEXT buf;                        /* The response we read from app server */
      unsigned KRB4_32 checksum; /* checksum we included in request */
-     MSG_DAT *msg_data;                /* mutual auth MSG_DAT (return) */
+     MSG_DAT FAR *msg_data;    /* mutual auth MSG_DAT (return) */
      C_Block session;          /* credentials (input) */
      Key_schedule schedule;    /* key schedule (return) */
-     struct sockaddr_in *laddr;        /* local address */
-     struct sockaddr_in *faddr;        /* address of foreign host on fd */
+     struct sockaddr_in FAR *laddr;    /* local address */
+     struct sockaddr_in FAR *faddr;    /* address of foreign host on fd */
 {
     int cc;
     unsigned KRB4_32 cksum;
@@ -204,7 +203,7 @@ krb_check_auth (buf, checksum, msg_data, session, schedule, laddr, faddr)
     key_sched(session, schedule);
 #endif /* !NOENCRYPTION */
     if (cc = krb_rd_priv(buf->dat, buf->length, schedule,
-                        (C_Block *)session, faddr, laddr, msg_data))
+                        session, faddr, laddr, msg_data))
        return(cc);
 
     /* fetch the (incremented) checksum that we supplied in the request */
index 830ee716b90bf26f325d76d641b9a859271b7ec7..e30e299bc436823614a32a1c70d8ec7cfdfcf505 100644 (file)
  * string              e_string                given error text
  */
 
-long INTERFACE
+KRB5_DLLIMP long KRB5_CALLCONV
 krb_mk_err(p,e,e_string)
-    u_char *p;                 /* Where to build error packet */
-    KRB4_32 e;         /* Error code */
-    char *e_string;            /* Text of error */
+    u_char FAR *p;             /* Where to build error packet */
+    KRB4_32 e;                 /* Error code */
+    char FAR *e_string;                /* Text of error */
 {
     u_char      *start;
 
index 5f26111c3be77b7c5285ff5c0dfad2ceadaacc93..feb12b7ab9d3ac959f9f4a94d99d23ee7c0b5dab 100644 (file)
 extern char *malloc(), *calloc(), *realloc();
 #endif
 
-/* Define a couple of function types including parameters.  These
-   are needed on MS-Windows to convert arguments of the function pointers
-   to the proper FAR types during calls.  These definitions are found in
-   <krb-sed.h> but the code is too opaque unless they are also here.  */
-#ifndef        KEY_PROC_TYPE_DEFINED
-typedef int (*key_proc_type) PROTOTYPE ((char *, char *, char *,
-                                            char *, C_Block));
-#endif
 
 int
 krb_mk_preauth(preauth_p, preauth_len,
index 72fff70071c7c41a89d9e9f0d63555ce6f763dd1..068b17dec71a1a3221f3d7fe3b355943d71d0eb0 100644 (file)
@@ -79,17 +79,17 @@ extern int krb_debug;
 #endif
  */
 
-long INTERFACE
+KRB5_DLLIMP long KRB5_CALLCONV
 krb_mk_priv(in,out,length,schedule,key,sender,receiver)
-    u_char *in;                 /* application data */
-    u_char *out;                /* put msg here, leave room for
-                                 * header! breaks if in and out
-                                 * (header stuff) overlap */
+    u_char FAR *in;            /* application data */
+    u_char FAR *out;           /* put msg here, leave room for
+                                * header! breaks if in and out
+                                * (header stuff) overlap */
     unsigned KRB4_32 length;   /* of in data */
-    Key_schedule schedule;      /* precomputed key schedule */
-    C_Block *key;               /* encryption key for seed and ivec */
-    struct sockaddr_in *sender; /* sender address */
-    struct sockaddr_in *receiver; /* receiver address */
+    Key_schedule schedule;     /* precomputed key schedule */
+    C_Block key;               /* encryption key for seed and ivec */
+    struct sockaddr_in FAR *sender;   /* sender address */
+    struct sockaddr_in FAR *receiver; /* receiver address */
 {
     register u_char     *p,*q;
     u_char *c_length_ptr;
index 0cb953fc53998bd5ce35b546e93b40c42be65d6e..7fb01d2f82eab85b354f15223a702d2d47ae0141 100644 (file)
@@ -68,13 +68,13 @@ static int lifetime = 255;          /* Default based on the TGT */
  *                  all rounded up to multiple of 8.
  */
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_mk_req(authent,service,instance,realm,checksum)
-    register KTEXT   authent;  /* Place to build the authenticator */
-    char    *service;           /* Name of the service */
-    char    *instance;          /* Service instance */
-    char    *realm;             /* Authentication domain of service */
-    KRB4_32    checksum;           /* Checksum of data (optional) */
+    register   KTEXT authent;  /* Place to build the authenticator */
+    char       FAR *service;   /* Name of the service */
+    char       FAR *instance;  /* Service instance */
+    char       FAR *realm;     /* Authentication domain of service */
+    KRB4_32    checksum;       /* Checksum of data (optional) */
 {
     KTEXT_ST req_st; /* Temp storage for req id */
     KTEXT req_id = &req_st;
index c3ed94d3230e65778825649c42ba527d270457e0..9e24db0c428157d32dba04bc59eb30bc967936b5 100644 (file)
@@ -60,7 +60,7 @@ extern int krb_debug;
  *                                             above using "key"
  */
 
-long INTERFACE
+KRB5_DLLIMP long KRB5_CALLCONV
 krb_mk_safe(in,out,length,key,sender,receiver)
     u_char *in;                        /* application data */
     u_char *out;               /*
@@ -69,7 +69,7 @@ krb_mk_safe(in,out,length,key,sender,receiver)
                                 * overlap
                                 */
     unsigned KRB4_32 length;   /* of in data */
-    C_Block *key;              /* encryption key for seed and ivec */
+    C_Block key;               /* encryption key for seed and ivec */
     struct sockaddr_in *sender;        /* sender address */
     struct sockaddr_in *receiver; /* receiver address */
 {
@@ -142,7 +142,7 @@ krb_mk_safe(in,out,length,key,sender,receiver)
     memset((char*) big_cksum, 0, sizeof(big_cksum));
 #else /* Do encryption */
     /* calculate the checksum of length, timestamps, and input data */
-    cksum = quad_cksum(q,big_cksum,p-q,2,(C_Block*) key);
+    cksum = quad_cksum(q, (u_char *)big_cksum, p-q, 2, key);
 #endif /* NOENCRYPTION */
     DEB (("\ncksum = %u",cksum));
 
index 275e5cbea9fb746ea8cb6ef03c2588f64b054036..4149be9642701c2d282ac972ee352459f687b1e8 100644 (file)
@@ -23,8 +23,8 @@
  */
 
 #include "krb.h"
+
 #include <string.h>
-#include <sys/file.h>
 #include <stdio.h>
 #include <fcntl.h>
 #ifdef HAS_UNISTD_H
@@ -39,13 +39,14 @@ extern char *krb__get_srvtabname();
    The key (exact match) must already be in the file;
    version numbers are not checked.
  */
+KRB5_DLLIMP int KRB5_CALLCONV
 put_svc_key(sfile,name,inst,realm,newvno,key)
-       char *sfile;
-       char *name;
-       char *inst;
-       char *realm;
+       char FAR *sfile;
+       char FAR *name;
+       char FAR *inst;
+       char FAR *realm;
        int newvno;
-       char *key;
+       char FAR *key;
 {
        int fd;
        char fname[SNAME_SZ], finst[INST_SZ], frlm[REALM_SZ];
index 2b105a01f8498e11fa6c5329086c6e942cef37d3..b7f6a8cc9383f61840acf281b9ce8a1d8c843972 100644 (file)
  * The AUTH_MSG_APPL_ERR message format can be found in mk_err.c
  */
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_rd_err(in,in_length,code,m_data)
-    u_char *in;                 /* pointer to the msg received */
+    u_char FAR *in;                 /* pointer to the msg received */
     u_long in_length;           /* of in msg */
-    long *code;                 /* received error code */
-    MSG_DAT *m_data;
+    long FAR *code;                 /* received error code */
+    MSG_DAT FAR *m_data;
 {
     register u_char *p;
     int swap_bytes = 0;
index 7c4f613a42291cc70d07e18e8e4fa2476089d368..4a30886169688766b2ec9157e9ab731de9569d0c 100644 (file)
@@ -65,12 +65,12 @@ int private_msg_ver = KRB_PROT_VERSION;
  * information, MSG_DAT, is defined in "krb.h".
  */
 
-long INTERFACE
+KRB5_DLLIMP long KRB5_CALLCONV
 krb_rd_priv(in,in_length,schedule,key,sender,receiver,m_data)
     u_char *in;                        /* pointer to the msg received */
     unsigned KRB4_32 in_length; /* length of "in" msg */
     Key_schedule schedule;     /* precomputed key schedule */
-    C_Block *key;              /* encryption key for seed and ivec */
+    C_Block key;               /* encryption key for seed and ivec */
     struct sockaddr_in *sender;
     struct sockaddr_in *receiver;
     MSG_DAT *m_data;           /*various input/output data from msg */
@@ -113,8 +113,8 @@ krb_rd_priv(in,in_length,schedule,key,sender,receiver,m_data)
 
 #ifndef NOENCRYPTION
     /* pcbc decrypt, use key as ivec */
-    pcbc_encrypt((C_Block *) q,(C_Block *) q, (long) c_length,
-                 schedule,key,DECRYPT);
+    pcbc_encrypt((C_Block *)q, (C_Block *)q, (long)c_length,
+                 schedule, (C_Block *)key, DECRYPT);
 #endif
 
     /* safely get application data length */
@@ -206,7 +206,7 @@ krb_rd_priv(in,in_length,schedule,key,sender,receiver,m_data)
      * calculate the checksum of the length, sequence,
      * and input data, on the sending byte order!!
      */
-    calc_cksum = quad_cksum(q,NULL,p-q,0,key);
+    calc_cksum = quad_cksum(q, NULL, p-q, 0, key);
 
     DEB (("\ncalc_cksum = %u, received cksum = %u",
               calc_cksum, cksum));
index fc9580ce65d6e81d404704af4d77e4caf7fa7d99..bb03f7ef46edf6aae9733167dca6a81d8ca8fa80 100644 (file)
@@ -121,14 +121,14 @@ krb_set_key(key,cvt)
  * Mutual authentication is not implemented.
  */
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_rd_req(authent,service,instance,from_addr,ad,fn)
     register KTEXT authent;    /* The received message */
-    char *service;             /* Service name */
-    char *instance;            /* Service instance */
+    char FAR *service;         /* Service name */
+    char FAR *instance;                /* Service instance */
     unsigned KRB4_32 from_addr; /* Net address of originating host */
-    AUTH_DAT *ad;              /* Structure to be filled in */
-    char *fn;                  /* Filename to get keys from */
+    AUTH_DAT FAR *ad;          /* Structure to be filled in */
+    char FAR *fn;              /* Filename to get keys from */
 {
     KTEXT_ST ticket;           /* Temp storage for ticket */
     KTEXT tkt = &ticket;
index 1135e801ccd5fd914cca950b30a6edc6bdfdc402..ad75f4d385315043049e023584fb027d6774c2c0 100644 (file)
@@ -48,14 +48,14 @@ extern int krb_debug;
  * information, MSG_DAT, is defined in "krb.h".
  */
 
-long INTERFACE
+KRB5_DLLIMP long KRB5_CALLCONV
 krb_rd_safe(in,in_length,key,sender,receiver,m_data)
-    u_char *in;                 /* pointer to the msg received */
-    unsigned KRB4_32 in_length; /* length of "in" msg */
-    C_Block *key;               /* encryption key for seed and ivec */
-    struct sockaddr_in *sender; /* sender's address */
-    struct sockaddr_in *receiver; /* receiver's address -- me */
-    MSG_DAT *m_data;           /* where to put message information */
+    u_char FAR *in;                    /* pointer to the msg received */
+    unsigned KRB4_32 in_length;                /* length of "in" msg */
+    C_Block FAR key;                   /* encryption key for seed and ivec */
+    struct sockaddr_in FAR *sender;    /* sender's address */
+    struct sockaddr_in FAR *receiver;  /* receiver's address -- me */
+    MSG_DAT FAR *m_data;               /* where to put message information */
 {
     unsigned KRB4_32 calc_cksum[4];
     unsigned KRB4_32 big_cksum[4];
index 5701cd3f6a5fe8be3c951abc6338f9438b513e62..c6be216fa283740078ef1fd9791a2f9d710f0304 100644 (file)
@@ -113,13 +113,14 @@ int vxworks_srvtab_read(fd, s, n)
 }
 #endif
 
-int read_service_key(service,instance,realm,kvno,file,key)
-    char *service;              /* Service Name */
-    char *instance;             /* Instance name or "*" */
-    char *realm;                /* Realm */
-    int kvno;                   /* Key version number */
-    char *file;                 /* Filename */
-    char *key;                  /* Pointer to key to be filled in */
+KRB5_DLLIMP int KRB5_CALLCONV
+read_service_key(service,instance,realm,kvno,file,key)
+    char FAR *service;         /* Service Name */
+    char FAR *instance;                /* Instance name or "*" */
+    char FAR *realm;           /* Realm */
+    int kvno;                  /* Key version number */
+    char FAR *file;            /* Filename */
+    char FAR *key;             /* Pointer to key to be filled in */
 {
     int kret;
     
@@ -192,13 +193,14 @@ int read_service_key(service,instance,realm,kvno,file,key)
 /* kvno is passed by reference, so that if it is zero, and we find a match,
    the match gets written back into *kvno so the caller can find it.
  */
-int get_service_key(service,instance,realm,kvno,file,key)
-    char *service;              /* Service Name */
-    char *instance;             /* Instance name or "*" */
-    char *realm;                /* Realm */
-    int  *kvno;                 /* Key version number */
-    char *file;                 /* Filename */
-    char *key;                  /* Pointer to key to be filled in */
+KRB5_DLLIMP int KRB5_CALLCONV
+get_service_key(service,instance,realm,kvno,file,key)
+    char FAR *service;              /* Service Name */
+    char FAR *instance;             /* Instance name or "*" */
+    char FAR *realm;                /* Realm */
+    int  FAR *kvno;                 /* Key version number */
+    char FAR *file;                 /* Filename */
+    char FAR *key;                  /* Pointer to key to be filled in */
 {
     char serv[SNAME_SZ];
     char inst[INST_SZ];
index cff11cc8e38aa760a8cee966cb7f9dac1b740cef..73af92931de95f12c912ed1606edf5598cd53f70 100644 (file)
@@ -10,6 +10,9 @@
  */
 
 #include "mit-copyright.h"
+#define        DEFINE_SOCKADDR         /* Ask for MAXHOSTNAMELEN */
+#include "krb.h"
+
 #include <string.h>
 #include <stdio.h>
 #include <ctype.h>
@@ -18,8 +21,6 @@
 #else
 extern char *malloc();
 #endif
-#define        DEFINE_SOCKADDR         /* Ask for MAXHOSTNAMELEN */
-#include "krb.h"
 
 /*
  * krb_realmofhost.
@@ -41,9 +42,9 @@ extern char *malloc();
 
 static char ret_realm[REALM_SZ+1];
 
-char * INTERFACE
+KRB5_DLLIMP char FAR * KRB5_CALLCONV
 krb_realmofhost(host)
-char *host;
+char FAR *host;
 {
        char *domain;
        FILE *trans_file;
index 2a1f3bc056c1b01437dbfab3467aa16797e0b785..e62e3f954c8b41df47dcd604d33ae0030fb6b53d 100644 (file)
@@ -25,7 +25,9 @@
  * be sure to support old versions of krb_sendauth!
  */
 
+#ifndef _WINDOWS
 extern int errno;
+#endif
 
 /*
  * krb_recvauth() reads (and optionally responds to) a message sent
@@ -112,20 +114,20 @@ extern int errno;
 #define        max(a,b) (((a) > (b)) ? (a) : (b))
 #endif /* max */
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_recvauth(options, fd, ticket, service, instance, faddr, laddr, kdata,
             filename, schedule, version)
-long options;                   /* bit-pattern of options */
-int fd;                                 /* file descr. to read from */
-KTEXT ticket;                   /* storage for client's ticket */
-char *service;                  /* service expected */
-char *instance;                         /* inst expected (may be filled in) */
-struct sockaddr_in *faddr;      /* address of foreign host on fd */
-struct sockaddr_in *laddr;      /* local address */
-AUTH_DAT *kdata;                /* kerberos data (returned) */
-char *filename;                         /* name of file with service keys */
-Key_schedule schedule;          /* key schedule (return) */
-char *version;                  /* version string (filled in) */
+    long options;                       /* bit-pattern of options */
+    int fd;                             /* file descr. to read from */
+    KTEXT ticket;                       /* storage for client's ticket */
+    char FAR *service;                  /* service expected */
+    char FAR *instance;                         /* inst expected (may be filled in) */
+    struct sockaddr_in FAR *faddr;      /* address of foreign host on fd */
+    struct sockaddr_in FAR *laddr;      /* local address */
+    AUTH_DAT FAR *kdata;                /* kerberos data (returned) */
+    char FAR *filename;                         /* name of file with service keys */
+    Key_schedule schedule;              /* key schedule (return) */
+    char FAR *version;                  /* version string (filled in) */
 {
 
     int i, cc, old_vers = 0;
index d8a89cdcfa353ff0ac2f7242e9441f168059cf46..12033787c1015c95f09884cf5ccf7397f4743582 100644 (file)
  * to avoid namespace pollution.
  */
 
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_save_credentials(service, instance, realm, session, lifetime, kvno,
                  ticket, issue_date)
-    char *service;              /* Service name */
-    char *instance;             /* Instance */
-    char *realm;                /* Auth domain */
-    C_Block session;            /* Session key */
-    int lifetime;               /* Lifetime */
-    int kvno;                   /* Key version number */
-    KTEXT ticket;               /* The ticket itself */
-    long issue_date;            /* The issue time */
+    char FAR *service;         /* Service name */
+    char FAR *instance;                /* Instance */
+    char FAR *realm;           /* Auth domain */
+    C_Block FAR *session;      /* Session key */
+    int lifetime;              /* Lifetime */
+    int kvno;                  /* Key version number */
+    KTEXT ticket;              /* The ticket itself */
+    long issue_date;           /* The issue time */
 {
     int tf_status;   /* return values of the tf_util calls */
 
index 97fdac780b1b604fe4047c0c777fafd0b16ff51c..7f9620d1282dbc36b50ade0baea7c8aeb7182371 100644 (file)
@@ -224,7 +224,7 @@ send_to_kdc(pkt,rpkt,realm)
             retval = /*errno */SKDC_CANT;
             goto rtn;
         }
-        _fmemcpy(cp, host->h_addr, host->h_length);
+        memcpy(cp, host->h_addr, host->h_length);
 
 /* At least Sun OS version 3.2 (or worse) and Ultrix version 2.2
    (or worse) only return one name ... */
index 05902faad73b1ce0340115f2ebe4855fd631d8a9..3470dc20901f421507d3420dfb1440aea9b73300 100644 (file)
@@ -15,7 +15,6 @@
 #include <string.h>
 #include <errno.h>
 #include <sys/stat.h>
-#include <sys/file.h>
 #include <fcntl.h>
 
 #ifdef TKT_SHMEM
index aac6ec467f8ec37959fb03efeb85a9ec1c5033a3..f1554ab97f566a9ca374aff7fb9952ad9f64a3d5 100644 (file)
@@ -9,12 +9,22 @@
  */
 
 #include "mit-copyright.h"
-#include <stdio.h>
 #include "krb.h"
+#include <stdio.h>
 #include <string.h>
-#include <sys/param.h>
+#include <sys/types.h>
 
+#ifdef HAS_STDLIB_H
+#include <stdlib.h>
+#else
 char *getenv();
+#endif
+
+
+#ifdef _WINDOWS
+typedef unsigned long uid_t;
+uid_t getuid(void) { return 0; }
+#endif /* _WINDOWS */
 
 /*
  * This routine is used to generate the name of the file that holds
index eeafdb9d7eaed9410b18275f90d4535b6b445b20..a05b0c05bf20ea91ed1cdd6cadde9104bd7af898 100644 (file)
 #include <sys/time.h>
 
 /* Start and end Kerberos library access.  On Unix, this is a No-op.  */
-int INTERFACE
+int
 krb_start_session (x)
        char *x;
 {
        return KSUCCESS;
 }
 
-int INTERFACE
+int
 krb_end_session (x)
        char *x;
 {
        return KSUCCESS;
 }
 
-char FAR * INTERFACE
+char FAR *
 krb_get_default_user ()
 {
        return 0;               /* FIXME */
 }
 
-int INTERFACE
+int
 krb_set_default_user (x)
        char *x;
 {
index de8b62015fe21f96fdf5e940a0dd1d0983ac1045..c22584656edde645fcbd576f68dc444ca22028a1 100644 (file)
 #include <stdio.h>
 #include <windows.h>
 
-static HINSTANCE hlibinstance;
-
-/* 
- * WinSock support.
- *
- * Do the WinSock initialization call, keeping all the hair here.
- *
- * This routine is called by SOCKET_INITIALIZE in include/c-windows.h.
- * The code is pretty much copied from winsock.txt from winsock-1.1,
- * available from:
- * ftp://sunsite.unc.edu/pub/micro/pc-stuff/ms-windows/winsock/winsock-1.1
- */
-int
-win_socket_initialize()
-{
-    WORD wVersionRequested;
-    WSADATA wsaData;
-    int err;
-
-    wVersionRequested = 0x0101;                /* We need version 1.1 */
-
-    err = WSAStartup (wVersionRequested, &wsaData);
-    if (err != 0) 
-       return err;             /* Library couldn't initialize */
-
-    if (wVersionRequested != wsaData.wVersion) {
-       /* DLL couldn't support our version of the spec */
-       WSACleanup ();
-       return -104;            /* FIXME -- better error? */
-    }
-
-    return 0;
-}
 
 /*
  * We needed a way to print out what might be FAR pointers on Windows,
@@ -64,43 +31,14 @@ far_fputs(string, stream)
        return fprintf(stream, "%Fs", string);
 }
 
-
-BOOL CALLBACK
-LibMain(hInst, wDataSeg, cbHeap, CmdLine)
-       HINSTANCE hInst;
-       WORD wDataSeg;
-       WORD cbHeap;
-       LPSTR CmdLine;
-{
-       hlibinstance = hInst;
-
-       return 1;
-}
-
-
-int CALLBACK __export
-WEP(nParam)
-       int nParam;
-{
-       return 1;
-}
-
-
-HINSTANCE
-get_lib_instance()
-{
-       return hlibinstance;
-}
-
-
-int INTERFACE
+int
 krb_start_session(x)
      char *x;
 {
        return KSUCCESS;
 }
 
-int INTERFACE
+int
 krb_end_session(x)
      char *x;
 {
@@ -112,6 +50,3 @@ krb_set_tkt_string(val)
 char *val;
 {
 }
-
-/* FIXME -- Mark... */
-int krb_ignore_ip_address = 0;
index 914ba77413c186e99dc0f2a2e3b8d373c1c39797..706205fe5cad29c080f96ed21d5fcf7738386842 100644 (file)
@@ -9,11 +9,38 @@
  *   g_cnffil.c
  */
 
-#include <windows.h>
+#include "krb.h"
+#include "k5-int.h"
 #include <stdio.h>
 #include <assert.h>
 
-#include "krb.h"
+
+char *
+krb__get_srvtabname(default_srvtabname)
+       char *default_srvtabname;
+{
+       krb5_context context;
+       const char* names[3];
+       char **full_name = 0, **cpp;
+       krb5_error_code retval;
+       char *retname;
+
+       krb5_init_context(&context);
+       names[0] = "libdefaults";
+       names[1] = "krb4_srvtab";
+       names[2] = 0;
+       retval = profile_get_values(context->profile, names, &full_name);
+       if (retval == 0 && full_name && full_name[0]) {
+               retname = strdup(full_name[0]);
+               for (cpp = full_name; *cpp; cpp++) 
+                       krb5_xfree(*cpp);
+               krb5_xfree(full_name);
+       } else {
+               retname = strdup(default_srvtabname);
+       }
+       krb5_free_context(context);
+       return retname;
+}
 
 /*
  * Returns an open file handle to the configuration file.  This
@@ -84,7 +111,7 @@ krb__get_realmsfile()
  * the [DEFAULTS] section of the "kerberos.ini" file located in the
  * Windows directory.
  */
-char FAR * INTERFACE
+KRB5_DLLIMP char FAR * KRB5_CALLCONV
 krb_get_default_user()
 {
        static char username[ANAME_SZ];
@@ -99,7 +126,7 @@ krb_get_default_user()
 /*
  * Sets the default user name stored in the "kerberos.ini" file.
  */
-int INTERFACE
+KRB5_DLLIMP int KRB5_CALLCONV
 krb_set_default_user(username)
        char *username;
 {
index 9022d1b9a22ab01d239a0cefa8bc0861c58a2922..2334d289d3fec1b3859e7d4e9c5d21d67605a1bf 100644 (file)
 #include <windows.h>
 #include <dos.h>
 
+#ifdef _WIN32
+
+unsigned KRB4_32
+win_time_gmt_unixsec (usecptr)
+    unsigned KRB4_32   *usecptr;
+{
+    struct _timeb timeptr;
+
+    _ftime(&timeptr);                           /* Get the current time */
+
+    if (usecptr)
+       *usecptr = timeptr.millitm * 1000;
+
+    return timeptr.time + CONVERT_TIME_EPOCH;
+}
+
+#else
+
 /*
  * Time handling.  Translate Unix time calls into Kerberos internal 
  * procedure calls.  See ../../include/c-win.h.
@@ -25,9 +43,9 @@
  * to using the AT hardware clock and converting it to Unix time.
  */
 
-unsigned KRB_INT32
+unsigned KRB4_32
 win_time_gmt_unixsec (usecptr)
-       unsigned KRB_INT32      *usecptr;
+       unsigned KRB4_32        *usecptr;
 {
        struct tm tm;
        union _REGS inregs;
@@ -77,6 +95,7 @@ win_time_gmt_unixsec (usecptr)
        return time + CONVERT_TIME_EPOCH;
 }
 
+#endif
 
 /*
  * This routine figures out the current time epoch and returns the
diff --git a/src/lib/krb4/winsock.def b/src/lib/krb4/winsock.def
deleted file mode 100644 (file)
index cada779..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-;  
-;         File: winsock.def 
-;       System: MS-Windows 3.x 
-;      Summary: Module definition file for Windows Sockets DLL.  
-;  
-;      This file is from
-;  ftp://sunsite.unc.edu/pub/micro/pc-stuff/ms-windows/winsock/winsock-1.1
-;      except that we made all the routine names uppercase, to match what
-;      MicroSoft C does when you declare an interface routine PASCAL
-;      (the way all these routines are declared in .../include/winsock.h).
-;
-
-LIBRARY         WINSOCK         ; Application's module name 
-
-DESCRIPTION     'BSD Socket API for Windows' 
-
-EXETYPE         WINDOWS         ; required for all windows applications 
-
-STUB            'WINSTUB.EXE'   ; generates error message if application 
-                                ; is run without Windows 
-
-;CODE can be FIXED in memory because of potential upcalls 
-CODE            PRELOAD         FIXED 
-
-;DATA must be SINGLE and at a FIXED location since this is a DLL 
-DATA            PRELOAD         FIXED           SINGLE
-
-HEAPSIZE        1024 
-STACKSIZE       16384 
-
-; All functions that will be called by any Windows routine 
-; must be exported.  Any additional exports beyond those defined
-; here must have ordinal numbers 1000 or above. 
-
-EXPORTS 
-        ACCEPT                         @1 
-        BIND                           @2 
-        CLOSESOCKET                    @3 
-        CONNECT                        @4 
-        GETPEERNAME                    @5 
-        GETSOCKNAME                    @6 
-        GETSOCKOPT                     @7 
-        HTONL                          @8 
-        HTONS                          @9 
-        INET_ADDR                      @10 
-        INET_NTOA                      @11 
-        IOCTLSOCKET                    @12 
-        LISTEN                         @13 
-        NTOHL                          @14 
-        NTOHS                          @15 
-        RECV                           @16 
-        RECVFROM                       @17 
-        SELECT                         @18 
-        SEND                           @19 
-        SENDTO                         @20 
-        SETSOCKOPT                     @21 
-        SHUTDOWN                       @22 
-        SOCKET                         @23 
-
-        GETHOSTBYADDR                  @51 
-        GETHOSTBYNAME                  @52 
-        GETPROTOBYNAME                 @53 
-        GETPROTOBYNUMBER               @54 
-        GETSERVBYNAME                  @55 
-        GETSERVBYPORT                  @56 
-        GETHOSTNAME                    @57
-
-        WSAASYNCSELECT                 @101 
-        WSAASYNCGETHOSTBYADDR          @102 
-        WSAASYNCGETHOSTBYNAME          @103 
-        WSAASYNCGETPROTOBYNUMBER       @104 
-        WSAASYNCGETPROTOBYNAME         @105 
-        WSAASYNCGETSERVBYPORT          @106 
-        WSAASYNCGETSERVBYNAME          @107 
-        WSACANCELASYNCREQUEST          @108 
-        WSASETBLOCKINGHOOK             @109 
-        WSAUNHOOKBLOCKINGHOOK          @110 
-        WSAGETLASTERROR                @111 
-        WSASETLASTERROR                @112 
-        WSACANCELBLOCKINGCALL          @113 
-        WSAISBLOCKING                  @114 
-        WSASTARTUP                     @115 
-        WSACLEANUP                     @116 
-
-        __WSAFDISSET                   @151 
-
-        WEP                            @500    RESIDENTNAME 
-
-;eof 
-