+Thu Mar 2 17:43:25 1995 Keith Vetter (keithv@fusion.com)
+
+ * Makefile.in: added rules to make a DLL from a lib.
+ * win_glue.c, librcrypto.def: needed for making a DLL.
+
Tue Feb 28 00:15:06 1995 John Gilmore (gnu at toad.com)
* cryptoconf.c, des_md5.c: Avoid <krb5/...> includes.
LDFLAGS = -g
##DOSBUILDTOP = ..\..
-##DOSLIBNAME=libcrypto.$(LIBEXT)
+##DOSLIBNAME=crypto.lib
##DOS!include $(BUILDTOP)\config\windows.in
TST=if test -n "`cat DONE`" ; then
all-unix::
-all-windows:: $(OBJS)
+all-windows:: $(OBJS) win_glue.obj
+
+win_glue.obj:: win_glue.c
+ $(CC) $(CFLAGS) /c $*.c
+
+libcrypto.lib:: libcrypto.dll
+ implib /nologo $@ $(@R).dll
+
+libcrypto.dll:: $(LIBNAME)
+ link /co /noe /nologo win_glue,libcrypto.dll,nul,\
+ crypto.lib winsock ldllcew libw,libcrypto.def
+ rc /p /k $@
libcrypto.a: des/DONE md4/DONE md5/DONE crc32/DONE os/DONE $(OBJS)
(cd des; $(TST) $(ARADD) ../$@ `cat DONE` ; fi)
$(RANLIB) $(DESTDIR)$(KRB5_LIBDIR)/libcrypto.a
clean:: clean-$(WHAT)
- $(RM) libcrypto.$(LIBEXT) libcrypto.bak
+ $(RM) libcrypto.$(LIBEXT) libcrypto.dll libcrypto.bak
clean-unix::
+clean-windows::
+ $(RM) crypto.lib crypto.bak
+
check:: check-$(WHAT)
check-unix::
@echo Making check in ..\os
-$(MAKE) -$(MFLAGS) check
cd ..
+
+all-windows:: libcrypto.lib
+
+Thu Mar 2 17:48:08 1995 Keith Vetter (keithv@fusion.com)
+
+ * Makefile.in: changed LIBNAME for the PC
+ * crc.c, crctest.c: added cast on the assignment of bits of
+ a long into characters.
+
Mon Feb 20 15:37:10 1995 Keith Vetter (keithv@fusion.com)
* crc.c: changed API to INTERFACE
CFLAGS = $(CCOPTS) $(DEFS)
##DOSBUILDTOP = ..\..\..
-##DOSLIBNAME=..\libcrypto.$(LIBEXT)
+##DOSLIBNAME=..\crypto.lib
##DOS!include $(BUILDTOP)\config\windows.in
OBJS= crc.$(OBJEXT)
int i;
data = (u_char *)in;
- for (i=0; i<in_length;i++) {
- idx = (data[i] ^ c);
+ for (i=0; i < (int) in_length;i++) {
+ idx = (int) (data[i] ^ c);
idx &= 0xff;
c >>= 8;
c ^= crc_table[idx];
/* c now holds the result */
outcksum->checksum_type = CKSUMTYPE_CRC32;
outcksum->length = 4;
- outcksum->contents[0] = c & 0xff;
- outcksum->contents[1] = (c >> 8) & 0xff;
- outcksum->contents[2] = (c >> 16) & 0xff;
- outcksum->contents[3] = (c >> 24) & 0xff;
+ outcksum->contents[0] = (krb5_octet) (c & 0xff);
+ outcksum->contents[1] = (krb5_octet) ((c >> 8) & 0xff);
+ outcksum->contents[2] = (krb5_octet) ((c >> 16) & 0xff);
+ outcksum->contents[3] = (krb5_octet) ((c >> 24) & 0xff);
return 0;
}
expected_crc);
exit(1);
}
- outbytes[0] = expect & 0xff;
- outbytes[1] = (expect >> 8) & 0xff;
- outbytes[2] = (expect >> 16) & 0xff;
- outbytes[3] = (expect >> 24) & 0xff;
+ outbytes[0] = (unsigned char) (expect & 0xff);
+ outbytes[1] = (unsigned char) ((expect >> 8) & 0xff);
+ outbytes[2] = (unsigned char) ((expect >> 16) & 0xff);
+ outbytes[3] = (unsigned char) ((expect >> 24) & 0xff);
if (sscanf(input, "%lx", &expect) != 1) {
fprintf(stderr, "bad expectation '%s', not hex\n",
expected_crc);
exit(1);
}
- inbytes[0] = expect & 0xff;
- inbytes[1] = (expect >> 8) & 0xff;
- inbytes[2] = (expect >> 16) & 0xff;
- inbytes[3] = (expect >> 24) & 0xff;
+ inbytes[0] = (unsigned char) (expect & 0xff);
+ inbytes[1] = (unsigned char) ((expect >> 8) & 0xff);
+ inbytes[2] = (unsigned char) ((expect >> 16) & 0xff);
+ inbytes[3] = (unsigned char) ((expect >> 24) & 0xff);
(*crc32_cksumtable_entry.sum_func)((krb5_pointer)inbytes,
in_length, 0, 0, &outck);
+Thu Mar 2 17:50:39 1995 Keith Vetter (keithv@fusion.com)
+
+ * Makefile.in: changed LIBNAME for the PC.
+ * f_tables.h. f_cbc.c: added cast on the assignment of bits of
+ a long into characters.
+ * string2k.c: promoted an int into a long.
+
Thu Mar 2 18:09:28 1995 Theodore Y. Ts'o <tytso@dcl>
* Makefile.in (ISODELIB): Remove reference to $(ISODELIB).
LDFLAGS = -g
##DOSBUILDTOP = ..\..\..
-##DOSLIBNAME=..\libcrypto.$(LIBEXT)
+##DOSLIBNAME=..\crypto.lib
##DOS!include $(BUILDTOP)\config\windows.in
COMERRLIB=$(BUILDTOP)/util/et/libcom_err.$(LIBEXT)
op += (int) length;
switch(length) {
case 8:
- *(--op) = right & 0xff;
+ *(--op) = (unsigned char) (right & 0xff);
case 7:
- *(--op) = (right >> 8) & 0xff;
+ *(--op) = (unsigned char) ((right >> 8) & 0xff);
case 6:
- *(--op) = (right >> 16) & 0xff;
+ *(--op) = (unsigned char) ((right >> 16) & 0xff);
case 5:
- *(--op) = (right >> 24) & 0xff;
+ *(--op) = (unsigned char) ((right >> 24) & 0xff);
case 4:
- *(--op) = left & 0xff;
+ *(--op) = (unsigned char) (left & 0xff);
case 3:
- *(--op) = (left >> 8) & 0xff;
+ *(--op) = (unsigned char) ((left >> 8) & 0xff);
case 2:
- *(--op) = (left >> 16) & 0xff;
+ *(--op) = (unsigned char) ((left >> 16) & 0xff);
case 1:
- *(--op) = (left >> 24) & 0xff;
+ *(--op) = (unsigned char) ((left >> 24) & 0xff);
break;
}
break; /* we're done */
(lr) |= (unsigned KRB_INT32)(*(ip)++)
#define PUT_HALF_BLOCK(lr, op) \
- *(op)++ = ((lr) >> 24) & 0xff; \
- *(op)++ = ((lr) >> 16) & 0xff; \
- *(op)++ = ((lr) >> 8) & 0xff; \
- *(op)++ = (lr) & 0xff
+ *(op)++ = (unsigned char) (((lr) >> 24) & 0xff); \
+ *(op)++ = (unsigned char) (((lr) >> 16) & 0xff); \
+ *(op)++ = (unsigned char) (((lr) >> 8) & 0xff); \
+ *(op)++ = (unsigned char) ((lr) & 0xff)
#endif /* __DES_TABLES_H__ */
register char *str, *copystr;
register krb5_octet *key;
- register unsigned temp,i;
+ register unsigned temp;
+ register long i;
register int j;
register long length;
unsigned char *k_p;
--- /dev/null
+;-----------------------------
+; CRYPTO.DEF - module definition file
+;-----------------------------
+
+LIBRARY CRYPTO
+DESCRIPTION 'DLL for Kerberos cryptography support'
+EXETYPE WINDOWS
+CODE PRELOAD MOVEABLE DISCARDABLE
+DATA PRELOAD MOVEABLE SINGLE
+HEAPSIZE 8192
+
+EXPORTS
+ WEP @1 RESIDENTNAME
+ LIBMAIN @2
+ CRC32_SUM_FUNC @3
+ KRB5_RANDOM_CONFOUNDER @4
+ MAKE_KEY_SCHED @5
+ MD4_CRYPTO_SUM_FUNC @6
+ MD4_SUM_FUNC @7
+ MD4FINAL @8
+ MD4INIT @9
+ MD4UPDATE @10
+ MD5_CRYPTO_SUM_FUNC @11
+ MD5_SUM_FUNC @12
+ MD5FINAL @13
+ MD5INIT @14
+ MD5UPDATE @15
+ MIT_DES_CBC_CHECKSUM @16
+ MIT_DES_CBC_CKSUM @17
+ MIT_DES_CBC_ENCRYPT @18
+ MIT_DES_CHECK_KEY_PARITY @19
+ MIT_DES_CRC_DECRYPT_FUNC @20
+ MIT_DES_CRC_ENCRYPT_FUNC @21
+ MIT_DES_ECB_ENCRYPT @22
+ MIT_DES_FINISH_KEY @23
+ MIT_DES_FINISH_RANDOM_KEY @24
+ MIT_DES_FIXUP_KEY_PARITY @25
+ MIT_DES_GENERATE_RANDOM_BLOCK @26
+ MIT_DES_INIT_RANDOM_KEY @27
+ MIT_DES_INIT_RANDOM_NUMBER_GENERATOR @28
+ MIT_DES_IS_WEAK_KEY @29
+ MIT_DES_KEY_SCHED @30
+ MIT_DES_MD5_DECRYPT_FUNC @31
+ MIT_DES_MD5_ENCRYPT_FUNC @32
+ MIT_DES_NEW_RANDOM_KEY @33
+ MIT_DES_PROCESS_KEY @34
+ MIT_DES_RANDOM_KEY @35
+ MIT_DES_SET_RANDOM_GENERATOR_SEED @36
+ MIT_DES_SET_SEQUENCE_NUMBER @37
+ MIT_DES_STRING_TO_KEY @38
+ MIT_RAW_DES_DECRYPT_FUNC @39
+ MIT_RAW_DES_ENCRYPT_FUNC @40
+Thu Mar 2 17:53:35 1995 Keith Vetter (keithv@fusion.com)
+
+ * Makefile.in: changed LIBNAME for the PC
+
Tue Feb 28 00:19:06 1995 John Gilmore (gnu at toad.com)
* rsa-md4.h: Avoid <krb5/...> includes.
LDFLAGS = -g
##DOSBUILDTOP = ..\..\..
-##DOSLIBNAME=..\libcrypto.$(LIBEXT)
+##DOSLIBNAME=..\crypto.lib
##DOS!include $(BUILDTOP)\config\windows.in
OBJS= md4.$(OBJEXT) md4glue.$(OBJEXT) md4crypto.$(OBJEXT)
+Thu Mar 2 17:54:26 1995 Keith Vetter (keithv@fusion.com)
+
+ * Makefile.in: changed LIBNAME for the PC
+
Tue Feb 28 00:20:15 1995 John Gilmore (gnu at toad.com)
* md5.c, md5crypto.c, md5glue.c, t_mddriver.c: Avoid <krb5/...>
LDFLAGS = -g
##DOSBUILDTOP = ..\..\..
-##DOSLIBNAME=..\libcrypto.$(LIBEXT)
+##DOSLIBNAME=..\crypto.lib
##DOS!include $(BUILDTOP)\config\windows.in
OBJS= md5.$(OBJEXT) md5glue.$(OBJEXT) md5crypto.$(OBJEXT)
+Thu Mar 2 17:56:48 1995 Keith Vetter (keithv@fusion.com)
+
+ * Makefile.in: changed LIBNAME for the PC, and brought in ustime
+ and localaddr from the krb/os directory.
+ * rnd_conf.c: added cast to the seed assignment.
+
Mon Feb 20 16:25:36 1995 Keith Vetter (keithv@fusion.com)
* Makfile.in: made to work for the PC
LDFLAGS = -g
##DOSBUILDTOP = ..\..\..
-##DOSLIBNAME=..\libcrypto.$(LIBEXT)
+##DOSLIBNAME=..\crypto.lib
##DOS!include $(BUILDTOP)\config\windows.in
LIBOBJS = @LIBOBJS@
all-unix:: $(OBJS)
-all-windows: rnd_confoun.obj
+all-windows: rnd_confoun.obj localaddr.obj ustime.obj
-localaddr.c: ../../krb5/os/localaddr.c
- -$(LN) $(srcdir)/../../krb5/os/localaddr.c $@
+localaddr.c: ..$(S)..$(S)krb5$(S)os$(S)localaddr.c
+ -$(LN) $(srcdir)$(S)..$(S)..$(S)krb5$(S)os$(S)localaddr.c $@
-ustime.c: ../../krb5/os/ustime.c
- -$(LN) $(srcdir)/../../krb5/os/ustime.c $@
+ustime.c: ..$(S)..$(S)krb5$(S)os$(S)ustime.c
+ -$(LN) $(srcdir)$(S)..$(S)..$(S)krb5$(S)os$(S)ustime.c $@
-memmove.c: ../../krb5/posix/memmove.c
- -$(LN) $(srcdir)/../../krb5/posix/memmove.c $@
+memmove.c: ..$(S)..$(S)krb5$(S)posix$(S)memmove.c
+ -$(LN) $(srcdir)$(S)..$(S)..$(S)krb5$(S)posix$(S)memmove.c $@
clean::
$(RM) ustime.c localaddr.c memmove.c
if (!seeded) {
/* time() defined in 4.12.2.4, but returns a time_t, which is an
"arithmetic type" (4.12.1) */
- rval = time(0);
+ rval = (RAND_TYPE) time(0);
SRAND(rval);
#ifdef HAVE_GETPID
rval = RAND();
--- /dev/null
+#define NEED_SOCKETS
+#include <k5-int.h>
+
+/*
+ * 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;
+}
+
+BOOL CALLBACK
+LibMain(hInst, wDataSeg, cbHeap, CmdLine)
+ HINSTANCE hInst;
+ WORD wDataSeg;
+ WORD cbHeap;
+ LPSTR CmdLine;
+{
+ win_socket_initialize ();
+ return 1;
+}
+
+
+int CALLBACK __export
+WEP(nParam)
+ int nParam;
+{
+ return 1;
+}