+Mon Feb 20 15:48:16 1995 Keith Vetter (keithv@fusion.com)
+
+ * windows.in: changed API to INTERFACE
+
Mon Feb 6 19:33:57 1995 Keith Vetter (keithv@fusion.com)
* pre.in: Added macros for directory syntax, filename extensions
# /* The name of the C compiler for the target */
CC=cl /nologo
CL=
-CCOPTS=/ALw /Zpa /GD2s /Os /Zi /Od /W2
-CCOPTS2=/AL /Zpa /G2s /Os /Zi /Od /W2 -DAPI=
+CCOPTS=/ALw /Zpa /GD2s /Os /Zi /Od /W2 $(XTRA)
+CCOPTS2=/AL /Zpa /G2s /Os /Zi /Od /W2 -DINTERFACE= $(XTRA)
CPPFLAGS = -I$(SRCTOP)/include
DEFS = $(CPPFLAGS)
CFLAGS2 = $(CCOPTS2) $(DEFS)
MV=ren
LN=copy
LIB=lib
+AWK=rem
ARADD=rem
RANLIB=rem
+Mon Feb 20 16:54:51 1995 Keith Vetter (keithv@fusion.com)
+
+ * encryption.h, los-proto.h, rsa-md5.h: added windows
+ INTERFACE keyword.
+ * Makefile.in: removed isode cruft ala Feb 10 changes but for windows
+
Thu Feb 16 20:12:23 1995 John Gilmore (gnu at toad.com)
* configure.in: Use AC_HAVE_HEADER rather than AC_HEADER_CHECK.
copy stock\config.win config.h
echo /* not used in windows */ > osconf.h
echo /* not used in windows */ > autoconf.h
- copy $(BUILDTOP)\lib\krb5\asn.1\krb5_decode.h .\asn.1\krb5_decode.h
- copy $(BUILDTOP)\lib\krb5\asn.1\krb5_encode.h .\asn.1\krb5_encode.h
includes:: autoconf.h
/* could be used in a table to find an etype and initialize a block */
typedef struct _krb5_cryptosystem_entry {
krb5_magic magic;
- krb5_error_code (*encrypt_func) NPROTOTYPE(( krb5_const_pointer /* in */,
+ krb5_error_code (INTERFACE *encrypt_func) NPROTOTYPE(( krb5_const_pointer /* in */,
krb5_pointer /* out */,
const size_t,
krb5_encrypt_block *,
krb5_pointer));
- krb5_error_code (*decrypt_func) NPROTOTYPE(( krb5_const_pointer /* in */,
+ krb5_error_code (INTERFACE *decrypt_func) NPROTOTYPE(( krb5_const_pointer /* in */,
krb5_pointer /* out */,
const size_t,
krb5_encrypt_block *,
krb5_pointer));
- krb5_error_code (*process_key) NPROTOTYPE(( krb5_encrypt_block *,
+ krb5_error_code (INTERFACE *process_key) NPROTOTYPE(( krb5_encrypt_block *,
const krb5_keyblock *));
- krb5_error_code (*finish_key) NPROTOTYPE(( krb5_encrypt_block *));
- krb5_error_code (*string_to_key) NPROTOTYPE(( const krb5_encrypt_block *,
+ krb5_error_code (INTERFACE *finish_key) NPROTOTYPE(( krb5_encrypt_block *));
+ krb5_error_code (INTERFACE *string_to_key) NPROTOTYPE(( const krb5_encrypt_block *,
const krb5_keytype,
krb5_keyblock *,
const krb5_data *,
const krb5_data *));
- krb5_error_code (*init_random_key) NPROTOTYPE(( const krb5_keyblock *,
+ krb5_error_code (INTERFACE *init_random_key) NPROTOTYPE(( const krb5_keyblock *,
krb5_pointer *));
- krb5_error_code (*finish_random_key) NPROTOTYPE(( krb5_pointer *));
- krb5_error_code (*random_key) NPROTOTYPE(( const krb5_encrypt_block *,
+ krb5_error_code (INTERFACE *finish_random_key) NPROTOTYPE(( krb5_pointer *));
+ krb5_error_code (INTERFACE *random_key) NPROTOTYPE(( const krb5_encrypt_block *,
krb5_pointer,
krb5_keyblock **));
int block_length;
} krb5_cs_table_entry;
/* could be used in a table to find a sumtype */
-typedef krb5_error_code (API *SUM_FUNC) NPROTOTYPE ((krb5_pointer /* in */,
- size_t /* in_length */,
+typedef krb5_error_code (INTERFACE *SUM_FUNC) NPROTOTYPE (
+ (krb5_pointer /* in */,
+ size_t /* in_length */,
krb5_pointer /* key/seed */,
size_t /* key/seed size */,
krb5_checksum FAR * /* out_cksum */));
krb5_boolean krb5_kuserok
PROTOTYPE((krb5_context,
krb5_principal, const char *));
-krb5_error_code krb5_random_confounder
+krb5_error_code INTERFACE krb5_random_confounder
PROTOTYPE((int,
krb5_pointer ));
krb5_error_code krb5_gen_replay_name
} MD5_CTX;
#if defined(__STDC__) || defined(KRB5_PROVIDE_PROTOTYPES)
-extern void MD5Init(MD5_CTX *);
-extern void MD5Update (MD5_CTX *, unsigned char *, unsigned int);
-extern void MD5Final (MD5_CTX *);
+extern void INTERFACE MD5Init(MD5_CTX FAR *);
+extern void INTERFACE MD5Update (MD5_CTX FAR *, unsigned char FAR *, unsigned int);
+extern void INTERFACE MD5Final (MD5_CTX FAR *);
#else
-extern void MD5Init();
-extern void MD5Update ();
-extern void MD5Final ();
+extern void INTERFACE MD5Init();
+extern void INTERFACE MD5Update ();
+extern void INTERFACE MD5Final ();
#endif
#define RSA_MD5_CKSUM_LENGTH 16
+Mon Feb 20 15:25:26 1995 Keith Vetter (keithv@fusion.com)
+
+ * config.h: changed API to INTERFACE.
+ * config.win: changed API to INTERFACE and changed BITS16
+ to SIZEOF_INT/SIZEOF_LONG to track an autoconf change.
+
Mon Feb 6 20:5:58 1995 Keith Vetter (keithv@fusion.com)
* config.win: new file--windows base template for config.h
* Windows requires a different api interface to each function. Here
* just define it as NULL.
*/
-#define API
+#define INTERFACE
#define FAR
#endif /* KRB5_CONFIG__ */
#define KRB5_KDB5_DBM__ /* Don't load kdb_dbm.h */
#define BITS16
+#define SIZEOF_INT 2
+#define SIZEOF_SHORT 2
+#define SIZEOF_LONG 4
#define USE_STRING_H
#define HAVE_SRAND
#define _U_LONG_DEFINED
#endif
-#ifndef API
-#define API __far __export __pascal
+#ifndef INTERFACE
+#define INTERFACE __far __export __pascal
#endif
#define FAR __far
-I$(srcdir)/md5
LDFLAGS = -g
+##DOSBUILDTOP = ..\..
+##DOSLIBNAME=libcrypto.$(LIBEXT)
+##DOS!include $(BUILDTOP)\config\windows.in
+
TST=if test -n "`cat DONE`" ; then
-OBJS= cryptoconf.o \
- des_crc.o \
- des_md5.o \
- raw_des.o
+OBJS= cryptoconf.$(OBJEXT) \
+ des_crc.$(OBJEXT) \
+ des_md5.$(OBJEXT) \
+ raw_des.$(OBJEXT)
SRCS= $(srcdir)/cryptoconf.c \
$(srcdir)/des_crc.c \
$(srcdir)/des_md5.c \
$(srcdir)/raw_des.c
-all::
+all:: all-$(WHAT)
+
+all-unix::
+
+all-windows:: $(OBJS)
libcrypto.a: des/DONE md4/DONE md5/DONE crc32/DONE os/DONE $(OBJS)
(cd des; $(TST) $(ARADD) ../$@ `cat DONE` ; fi)
$(INSTALL_DATA) libcrypto.a $(DESTDIR)$(KRB5_LIBDIR)/libcrypto.a
$(RANLIB) $(DESTDIR)$(KRB5_LIBDIR)/libcrypto.a
-clean::
- $(RM) libcrypto.a
+clean:: clean-$(WHAT)
+ $(RM) libcrypto.$(LIBEXT) libcrypto.bak
+
+clean-unix::
+
+check:: check-$(WHAT)
+
+check-unix::
+
+all-windows::
+ cd crc32
+ @echo Making in ..\crc32
+ -$(MAKE) -$(MFLAGS)
+ cd ..\des
+ @echo Making in des
+ -$(MAKE) -$(MFLAGS)
+ cd ..\md4
+ @echo Making in ..\md4
+ -$(MAKE) -$(MFLAGS)
+ cd ..\md5
+ @echo Making in ..\md5
+ -$(MAKE) -$(MFLAGS)
+ cd ..\os
+ @echo Making in ..\os
+ -$(MAKE) -$(MFLAGS)
+ cd ..
+
+clean-windows::
+ cd crc32
+ @echo Making clean in ..\crc32
+ -$(MAKE) -$(MFLAGS) clean
+ cd ..\des
+ @echo Making clean in des
+ -$(MAKE) -$(MFLAGS) clean
+ cd ..\md4
+ @echo Making clean in ..\md4
+ -$(MAKE) -$(MFLAGS) clean
+ cd ..\md5
+ @echo Making clean in ..\md5
+ -$(MAKE) -$(MFLAGS) clean
+ cd ..\os
+ @echo Making clean in ..\os
+ -$(MAKE) -$(MFLAGS) clean
+ cd ..
+
+
+check-windows::
+ cd crc32
+ @echo Making check in ..\crc32
+ -$(MAKE) -$(MFLAGS) check
+ cd ..\des
+ @echo Making check in des
+ -$(MAKE) -$(MFLAGS) check
+ cd ..\md4
+ @echo Making check in ..\md4
+ -$(MAKE) -$(MFLAGS) check
+ cd ..\md5
+ @echo Making check in ..\md5
+ -$(MAKE) -$(MFLAGS) check
+ cd ..\os
+ @echo Making check in ..\os
+ -$(MAKE) -$(MFLAGS) check
+ cd ..
+Mon Feb 20 15:37:10 1995 Keith Vetter (keithv@fusion.com)
+
+ * crc.c: changed API to INTERFACE
+
Fri Feb 20 11:08:00 1995 Keith Vetter (keithv@fusion.com)
* crc.c: added function prototype and removed a function
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
};
-krb5_error_code API
+krb5_error_code INTERFACE
crc32_sum_func NPROTOTYPE((krb5_pointer in, size_t in_length,
krb5_pointer seed, size_t seed_length, krb5_checksum *outcksum));
-krb5_error_code API
+krb5_error_code INTERFACE
crc32_sum_func(in, in_length, seed, seed_length, outcksum)
krb5_pointer in;
size_t in_length;
+Mon Feb 20 16:10:29 1995 Keith Vetter (keithv@fusion.com)
+
+ * Makefile.in: made to work under windows PC
+ * cbc_cksu.c cs_entry.c finish_k.c fin_rndk.c f_cbc.c f_cksum.c
+ f_ecb.c f_parity.c f_pcbc.c f_sched.c init_rke.c key_sche.c
+ new_rn_k.c process_.c random_k.c string2k.c weak_key.c: added
+ windows INTERFACE keyword.
+ * string2key.c: needed long -> int casts for memset and malloc
+
Wed Feb 8 13:59:05 1995 Theodore Y. Ts'o (tytso@dcl)
* des.h: Add KRB5_INT32 definitions for non-32 int platforms.
CFLAGS = $(CCOPTS) $(DEFS)
LDFLAGS = -g
-ISODELIB=@ISODELIB@
-COMERRLIB=$(BUILDTOP)/util/et/libcom_err.a
+##DOSBUILDTOP = ..\..\..
+##DOSLIBNAME=..\libcrypto.$(LIBEXT)
+##DOS!include $(BUILDTOP)\config\windows.in
-all:: $(OBJS)
+ISODELIB=@ISODELIB@
+COMERRLIB=$(BUILDTOP)/util/et/libcom_err.$(LIBEXT)
-KLIB = $(TOPLIBD)/libkrb5.a $(TOPLIBD)/libcrypto.a $(ISODELIB) $(COMERRLIB)
-DEPKLIB = $(TOPLIBD)/libkrb5.a $(TOPLIBD)/libcrypto.a $(COMERRLIB)
+KLIB = $(TOPLIBD)/libkrb5.$(LIBEXT) $(TOPLIBD)/libcrypto.$(LIBEXT) $(ISODELIB) $(COMERRLIB)
+DEPKLIB = $(TOPLIBD)/libkrb5.$(LIBEXT) $(TOPLIBD)/libcrypto.$(LIBEXT) $(COMERRLIB)
OTHERSRCS=$(srcdir)/f_cbc.c $(srcdir)/f_cksum.c \
$(srcdir)/f_sched.c $(srcdir)/f_ecb.c $(srcdir)/f_parity.c \
$(srcdir)/f_tables.c
-OTHEROBJS=f_cbc.o f_cksum.o f_sched.o f_ecb.o f_parity.o f_tables.o
-
-OBJS= cbc_cksum.o \
- cs_entry.o \
- finish_key.o \
- fin_rndkey.o \
- init_rkey.o \
- process_ky.o \
- random_key.o \
- string2key.o \
- new_rn_key.o \
- key_sched.o \
- weak_key.o \
+OTHEROBJS=f_cbc.$(OBJEXT) f_cksum.$(OBJEXT) f_sched.$(OBJEXT) f_ecb.$(OBJEXT) f_parity.$(OBJEXT) f_tables.$(OBJEXT)
+
+OBJS= cbc_cksum.$(OBJEXT) \
+ cs_entry.$(OBJEXT) \
+ finish_key.$(OBJEXT) \
+ fin_rndkey.$(OBJEXT) \
+ init_rkey.$(OBJEXT) \
+ process_ky.$(OBJEXT) \
+ random_key.$(OBJEXT) \
+ string2key.$(OBJEXT) \
+ new_rn_key.$(OBJEXT) \
+ key_sched.$(OBJEXT) \
+ weak_key.$(OBJEXT) \
$(OTHEROBJS)
SRCS= $(srcdir)/cs_entry.c \
$(srcdir)/weak_key.c \
$(OTHERSRCS)
-includes:: depend
+all:: $(OBJS)
-all::
+includes:: depend
depend:: $(SRCS)
clean::
$(RM) fp.c ip.c key_perm.h odd.h p.c p_table.h s_table.h
-verify: verify.o $(DEPKLIB)
- $(CC) -o $@ verify.o $(KLIB) $(LIBS) $(LDFLAGS)
+verify: verify.$(OBJEXT) $(DEPKLIB)
+ $(CC) -o $@ verify.$(OBJEXT) $(KLIB) $(LIBS) $(LDFLAGS)
-destest: destest.o $(DEPKLIB)
- $(CC) -o $@ destest.o $(KLIB) $(LIBS) $(LDFLAGS)
+destest: destest.$(OBJEXT) $(DEPKLIB)
+ $(CC) -o $@ destest.$(OBJEXT) $(KLIB) $(LIBS) $(LDFLAGS)
-check:: destest verify
+check:: check-$(WHAT)
+
+check-unix:: destest verify
./verify -z
./verify -m
./verify
./destest < $(srcdir)/keytest.data
+check-windows::
+
clean::
- $(RM) destest verify destest.o verify.o
+ $(RM) destest verify destest.$(OBJEXT) verify.$(OBJEXT)
returns: errors
*/
-krb5_error_code mit_des_cbc_checksum(in, in_length, key, key_size, cksum)
+krb5_error_code INTERFACE
+mit_des_cbc_checksum(in, in_length, key, key_size, cksum)
krb5_pointer in;
size_t in_length;
krb5_pointer key;
size_t key_size;
- krb5_checksum * cksum;
+ krb5_checksum FAR * cksum;
{
struct mit_des_ks_struct *schedule; /* pointer to key schedules */
krb5_octet *contents;
#include "k5-int.h"
#include "des_int.h"
-extern krb5_error_code mit_des_cbc_checksum PROTOTYPE ((krb5_pointer ,
+extern krb5_error_code INTERFACE mit_des_cbc_checksum PROTOTYPE ((
+ krb5_pointer ,
size_t ,
krb5_pointer ,
size_t ,
- krb5_checksum * ));
+ krb5_checksum FAR * ));
krb5_checksum_entry krb5_des_cbc_cksumtable_entry = {
#include <krb5/mit-des.h>
/* cbc_cksum.c */
-extern krb5_error_code mit_des_cbc_checksum
- PROTOTYPE((krb5_pointer, size_t,krb5_pointer,size_t, krb5_checksum * ));
+extern krb5_error_code INTERFACE mit_des_cbc_checksum
+ PROTOTYPE((krb5_pointer, size_t,krb5_pointer,size_t, krb5_checksum FAR * ));
/* cksum.c */
-extern void mit_des_cbc_cksum
+extern void INTERFACE mit_des_cbc_cksum
PROTOTYPE((krb5_octet *, krb5_octet *, long , mit_des_key_schedule ,
krb5_octet *));
/* des.c */
-extern int mit_des_ecb_encrypt
+extern int INTERFACE mit_des_ecb_encrypt
PROTOTYPE((unsigned long *, unsigned long *, mit_des_key_schedule , int ));
/* f_cbc.c */
-extern int mit_des_cbc_encrypt
+extern int INTERFACE mit_des_cbc_encrypt
PROTOTYPE((const mit_des_cblock *in, mit_des_cblock *out, long length,
mit_des_key_schedule schedule, mit_des_cblock ivec,
int encrypt));
/* fin_rndkey.c */
-extern krb5_error_code mit_des_finish_random_key
+extern krb5_error_code INTERFACE mit_des_finish_random_key
PROTOTYPE(( krb5_pointer *));
/* finish_key.c */
-extern krb5_error_code mit_des_finish_key
- PROTOTYPE(( krb5_encrypt_block *));
+extern krb5_error_code INTERFACE mit_des_finish_key
+ PROTOTYPE(( krb5_encrypt_block FAR *));
/* init_rkey.c */
-extern krb5_error_code mit_des_init_random_key
+extern krb5_error_code INTERFACE mit_des_init_random_key
PROTOTYPE(( const krb5_keyblock *, krb5_pointer *));
/* key_parity.c */
-extern void mit_des_fixup_key_parity PROTOTYPE((mit_des_cblock ));
-extern int mit_des_check_key_parity PROTOTYPE((mit_des_cblock ));
+extern void INTERFACE mit_des_fixup_key_parity PROTOTYPE((mit_des_cblock ));
+extern int INTERFACE mit_des_check_key_parity PROTOTYPE((mit_des_cblock ));
/* key_sched.c */
-extern int mit_des_key_sched
+extern int INTERFACE mit_des_key_sched
PROTOTYPE((mit_des_cblock , mit_des_key_schedule ));
/* new_rnd_key.c */
-extern int mit_des_new_random_key
+extern int INTERFACE mit_des_new_random_key
PROTOTYPE((mit_des_cblock , mit_des_random_key_seed *));
-extern void mit_des_init_random_number_generator
+extern void INTERFACE mit_des_init_random_number_generator
PROTOTYPE((mit_des_cblock, mit_des_random_key_seed *));
-extern void mit_des_set_random_generator_seed
+extern void INTERFACE mit_des_set_random_generator_seed
PROTOTYPE((mit_des_cblock , mit_des_random_key_seed *));
-extern void mit_des_set_sequence_number
+extern void INTERFACE mit_des_set_sequence_number
PROTOTYPE((mit_des_cblock , mit_des_random_key_seed *));
-extern void mit_des_generate_random_block
+extern void INTERFACE mit_des_generate_random_block
PROTOTYPE((mit_des_cblock , mit_des_random_key_seed *));
/* process_ky.c */
-extern krb5_error_code mit_des_process_key
+extern krb5_error_code INTERFACE mit_des_process_key
PROTOTYPE(( krb5_encrypt_block *, const krb5_keyblock *));
/* random_key.c */
-extern krb5_error_code mit_des_random_key
+extern krb5_error_code INTERFACE mit_des_random_key
PROTOTYPE(( const krb5_encrypt_block *, krb5_pointer , krb5_keyblock **));
/* string2key.c */
-extern krb5_error_code mit_des_string_to_key
+extern krb5_error_code INTERFACE mit_des_string_to_key
PROTOTYPE(( const krb5_encrypt_block *, const krb5_keytype,
krb5_keyblock *, const krb5_data *, const krb5_data *));
/* weak_key.c */
-extern int mit_des_is_weak_key PROTOTYPE((mit_des_cblock ));
+extern int INTERFACE mit_des_is_weak_key PROTOTYPE((mit_des_cblock ));
/* cmb_keys.c */
krb5_error_code mit_des_combine_subkeys
PROTOTYPE((const krb5_keyblock *, const krb5_keyblock *,
krb5_keyblock **));
+/* f_pcbc.c */
+int INTERFACE mit_des_pcbc_encrypt ();
+
+/* f_sched.c */
+int INTERFACE make_key_sched PROTOTYPE((mit_des_cblock, mit_des_key_schedule));
+
+
/* misc.c */
extern void swap_bits PROTOTYPE((char *));
extern unsigned long long_swap_bits PROTOTYPE((unsigned long ));
* cleartext.
*/
-int
+int INTERFACE
mit_des_cbc_encrypt(in, out, length, schedule, ivec, encrypt)
const des_cblock *in;
des_cblock *out;
* multiple of eight bytes.
*/
-unsigned long
+unsigned long INTERFACE
mit_des_cbc_cksum(in, out, length, schedule, ivec)
des_cblock *in;
des_cblock *out;
/*
* des_ecb_encrypt - {en,de}crypt a block in ECB mode
*/
-int
+int INTERFACE
mit_des_ecb_encrypt(in, out, schedule, encrypt)
des_cblock *in;
des_cblock *out;
#define pstep(x,step) (((x)&smask(step))^(((x)>>step)&smask(step)))
#define parity_char(x) pstep(pstep(pstep((x),4),2),1)
-void
+void INTERFACE
mit_des_fixup_key_parity(key)
register des_cblock key;
{
* See des_fix_key_parity for the definition of
* correct des parity.
*/
-int
+int INTERFACE
mit_des_check_key_parity(key)
register des_cblock key;
{
/*
* des_pcbc_encrypt - {en,de}crypt a stream in PCBC mode
*/
-int
+int INTERFACE
mit_des_pcbc_encrypt(in, out, length, schedule, ivec, encrypt)
des_cblock *in;
des_cblock *out;
/*
* Permute the key to give us our key schedule.
*/
-int
+int INTERFACE
make_key_sched(key, schedule)
mit_des_cblock key;
mit_des_key_schedule schedule;
free any resources held by "seed" and assigned by init_random_key()
*/
-krb5_error_code mit_des_finish_random_key (seed)
+krb5_error_code INTERFACE mit_des_finish_random_key (seed)
krb5_pointer * seed;
{
memset((char *)*seed, 0, sizeof(mit_des_random_key_seed) );
returns: errors
*/
-krb5_error_code mit_des_finish_key (eblock)
- krb5_encrypt_block * eblock;
+krb5_error_code INTERFACE
+mit_des_finish_key (eblock)
+ krb5_encrypt_block FAR * eblock;
{
memset((char *)eblock->priv, 0, sizeof(mit_des_key_schedule));
free(eblock->priv);
sequence information.
*/
-krb5_error_code mit_des_init_random_key (seedblock, seed)
+krb5_error_code INTERFACE
+mit_des_init_random_key (seedblock, seed)
const krb5_keyblock * seedblock;
krb5_pointer * seed;
{
#include "des_int.h"
#include <stdio.h>
-void make_key_sched PROTOTYPE((mit_des_cblock, mit_des_key_schedule));
+int INTERFACE
+make_key_sched PROTOTYPE((mit_des_cblock, mit_des_key_schedule));
-int
+int INTERFACE
mit_des_key_sched(k,schedule)
mit_des_cblock k;
mit_des_key_schedule schedule;
* to be a weak des key. Mit_Des_generate_random_block is used to
* provide the random bits.
*/
-int
+int INTERFACE
mit_des_new_random_key(key, p_seed)
mit_des_cblock key;
mit_des_random_key_seed *p_seed;
* Note: this routine calls mit_des_set_random_generator_seed.
*/
-void mit_des_init_random_number_generator(key,p_seed)
+void INTERFACE
+mit_des_init_random_number_generator(key,p_seed)
mit_des_cblock key;
mit_des_random_key_seed *p_seed;
{
* Requires: key is a valid des key. I.e., has correct parity and is not a
* weak des key.
*/
-void
+void INTERFACE
mit_des_set_random_generator_seed(key, p_seed)
mit_des_cblock key;
mit_des_random_key_seed *p_seed;
*
* Note that mit_des_set_random_generator_seed resets the sequence number to 0.
*/
-void
+void INTERFACE
mit_des_set_sequence_number(new_sequence_number, p_seed)
mit_des_cblock new_sequence_number;
mit_des_random_key_seed *p_seed;
* Requires: mit_des_set_random_generator_seed must have been called at least once
* before this routine is called.
*/
-void mit_des_generate_random_block(block, p_seed)
+void INTERFACE
+mit_des_generate_random_block(block, p_seed)
mit_des_cblock block;
mit_des_random_key_seed *p_seed;
{
returns: errors
*/
-krb5_error_code mit_des_process_key (eblock, keyblock)
+krb5_error_code INTERFACE
+mit_des_process_key (eblock, keyblock)
krb5_encrypt_block * eblock;
const krb5_keyblock * keyblock;
{
filling in the keyblock address in *keyblock
*/
-krb5_error_code mit_des_random_key (eblock, seed, keyblock)
+krb5_error_code INTERFACE
+mit_des_random_key (eblock, seed, keyblock)
const krb5_encrypt_block * eblock;
krb5_pointer seed;
krb5_keyblock ** keyblock;
returns: errors
*/
-krb5_error_code mit_des_string_to_key (eblock, keytype, keyblock, data, salt)
-const krb5_encrypt_block * eblock;
+krb5_error_code INTERFACE
+mit_des_string_to_key (eblock, keytype, keyblock, data, salt)
+const krb5_encrypt_block FAR * eblock;
const krb5_keytype keytype;
-krb5_keyblock * keyblock;
-const krb5_data * data;
-const krb5_data * salt;
+krb5_keyblock FAR * keyblock;
+const krb5_data FAR * data;
+const krb5_data FAR * salt;
{
register char *str, *copystr;
register krb5_octet *key;
else
length = data->length;
- copystr = malloc(length);
+ copystr = malloc((size_t) length);
if (!copystr) {
free(keyblock->contents);
keyblock->contents = 0;
memset((char *)key_sked, 0, sizeof(key_sked));
/* clean & free the input string */
- memset(copystr, 0, length);
+ memset(copystr, 0, (size_t) length);
krb5_xfree(copystr);
/* now fix up key parity again */
*
* Requires: key has correct odd parity.
*/
-int
+int INTERFACE
mit_des_is_weak_key(key)
mit_des_cblock key;
{
#include "crc-32.h"
#include "des_int.h"
-static krb5_error_code mit_des_crc_encrypt_func
+krb5_error_code INTERFACE mit_des_crc_encrypt_func
PROTOTYPE(( krb5_const_pointer, krb5_pointer, const size_t,
krb5_encrypt_block *, krb5_pointer ));
-static krb5_error_code mit_des_crc_decrypt_func
+krb5_error_code INTERFACE mit_des_crc_decrypt_func
PROTOTYPE(( krb5_const_pointer, krb5_pointer, const size_t,
krb5_encrypt_block *, krb5_pointer ));
};
-static krb5_error_code
+krb5_error_code INTERFACE
mit_des_crc_encrypt_func(in, out, size, key, ivec)
krb5_const_pointer in;
krb5_pointer out;
}
-static krb5_error_code
+krb5_error_code INTERFACE
mit_des_crc_decrypt_func(in, out, size, key, ivec)
krb5_const_pointer in;
krb5_pointer out;
if ( size < 2*sizeof(mit_des_cblock) )
return KRB5_BAD_MSIZE;
- retval = mit_des_cbc_encrypt(in,
- out,
+ retval = mit_des_cbc_encrypt((mit_des_cblock FAR *) in,
+ (mit_des_cblock FAR *) out,
size,
(struct mit_des_ks_struct *) key->priv,
ivec ? ivec : (krb5_pointer)key->key->contents,
#include <krb5/rsa-md5.h>
#include "des_int.h"
-static krb5_error_code mit_des_md5_encrypt_func
+krb5_error_code INTERFACE mit_des_md5_encrypt_func
PROTOTYPE(( krb5_const_pointer, krb5_pointer, const size_t,
krb5_encrypt_block *, krb5_pointer ));
-static krb5_error_code mit_des_md5_decrypt_func
+krb5_error_code INTERFACE mit_des_md5_decrypt_func
PROTOTYPE(( krb5_const_pointer, krb5_pointer, const size_t,
krb5_encrypt_block *, krb5_pointer ));
};
-static krb5_error_code
+krb5_error_code INTERFACE
mit_des_md5_encrypt_func(in, out, size, key, ivec)
krb5_const_pointer in;
krb5_pointer out;
}
-static krb5_error_code
+krb5_error_code INTERFACE
mit_des_md5_decrypt_func(in, out, size, key, ivec)
krb5_const_pointer in;
krb5_pointer out;
if ( size < 2*sizeof(mit_des_cblock) )
return KRB5_BAD_MSIZE;
- retval = mit_des_cbc_encrypt(in,
+ retval = mit_des_cbc_encrypt((const mit_des_cblock *) in,
out,
size,
(struct mit_des_ks_struct *) key->priv,
+Mon Feb 20 15:54:1 1995 Keith Vetter (keithv@fusion.com)
+
+ * Makefile.in: made to work for the PC
+ * md4.c, md4crypt.c md4glue.c: added windows INTERFACE keyword
+ * rsa-md4.h: added windows INTERFACE to prototypes
+
Thu Feb 2 03:00:41 1995 John Gilmore <gnu@cygnus.com>
* Makefile.in (CFLAGS): Handle $(srcdir) properly in -I options.
Wed Jan 25 20:08:47 1995 John Gilmore (gnu at toad.com)
* Makefile.in (CFLAGS): Add -I../des to pull in DES header file.
- * rsa-md4.h: New include file, moved from include/krb5, since
+ *
+rsa-md4.h: New include file, moved from include/krb5, since
it's only used locally.
* md4.c, md4crypto.c, md4driver.c, md4glue.c: Replace <.../...>
includes with "..."s.
CFLAGS = $(CCOPTS) $(DEFS) -I$(srcdir)/../des -I$(srcdir)
LDFLAGS = -g
-all:: $(OBJS) t_mddriver
+##DOSBUILDTOP = ..\..\..
+##DOSLIBNAME=..\libcrypto.$(LIBEXT)
+##DOS!include $(BUILDTOP)\config\windows.in
+OBJS= md4.$(OBJEXT) md4glue.$(OBJEXT) md4crypto.$(OBJEXT)
+SRCS= $(srcdir)/md4.c $(srcdir)/md4glue.c $(srcdir)/md4crypto.c
-OBJS= md4.o md4glue.o md4crypto.o
+all:: $(OBJS) all-$(WHAT)
-SRCS= $(srcdir)/md4.c $(srcdir)/md4glue.c $(srcdir)/md4crypto.c
+all-unix:: t_mddriver-unix
+
+all-windows::
t_mddriver.c: $(srcdir)/../md5/t_mddriver.c
$(CP) $(srcdir)/../md5/t_mddriver.c t_mddriver.c
t_mddriver.o: t_mddriver.c
$(CC) -DMD=4 $(CFLAGS) -c t_mddriver.c
-t_mddriver: t_mddriver.o md4.o
+t_mddriver-unix: t_mddriver.o md4.o
$(CC) $(CFLAGS) -o t_mddriver t_mddriver.o md4.o
-check:: t_mddriver
- ./t_mddriver -x
+t_mddriver-windows:
+ $(CP) $(srcdir)\..\md5\t_mddriver.c t_mddriver.c
+ $(CC) -DMD=4 $(CFLAGS2) -o t_mddriver t_mddriver.c md4.c
+ $(RM) md4.obj
+
+check:: t_mddriver-$(WHAT)
+ $(C)t_mddriver$(EXEEXT) -x
clean::
- $(RM) t_mddriver t_mddriver.o t_mddriver.c
+ $(RM) t_mddriver$(EXEEXT) t_mddriver.$(OBJEXT) t_mddriver.c
/* forward declaration */
#if defined(__STDC__) || defined(KRB5_PROVIDE_PROTOTYPES)
-static void Transform (krb5_ui_4 *, krb5_ui_4 *);
+static void Transform (krb5_ui_4 FAR *, krb5_ui_4 FAR *);
#else
static void Transform ();
#endif
{(a) += H ((b), (c), (d)) + (x) + UL(015666365641); \
(a) = ROTATE_LEFT ((a), (s));}
-void MD4Init (mdContext)
-MD4_CTX *mdContext;
+void INTERFACE
+MD4Init (mdContext)
+MD4_CTX FAR *mdContext;
{
mdContext->i[0] = mdContext->i[1] = (krb5_ui_4)0;
mdContext->buf[3] = UL(0x10325476);
}
-void MD4Update (mdContext, inBuf, inLen)
-MD4_CTX *mdContext;
-unsigned char *inBuf;
+void INTERFACE
+MD4Update (mdContext, inBuf, inLen)
+MD4_CTX FAR *mdContext;
+unsigned char FAR *inBuf;
unsigned int inLen;
{
krb5_ui_4 in[16];
}
}
-void MD4Final (mdContext)
-MD4_CTX *mdContext;
+void INTERFACE
+MD4Final (mdContext)
+MD4_CTX FAR *mdContext;
{
krb5_ui_4 in[16];
int mdi;
/* Basic MD4 step. Transform buf based on in.
*/
static void Transform (buf, in)
-krb5_ui_4 *buf;
-krb5_ui_4 *in;
+krb5_ui_4 FAR *buf;
+krb5_ui_4 FAR *in;
{
krb5_ui_4 a = buf[0], b = buf[1], c = buf[2], d = buf[3];
#include "rsa-md4.h"
#include "des_int.h" /* we cheat a bit and call it directly... */
-static krb5_error_code
+krb5_error_code INTERFACE
+md4_crypto_sum_func NPROTOTYPE((krb5_pointer in, size_t in_length,
+ krb5_pointer seed, size_t seed_length, krb5_checksum *outcksum));
+
+krb5_error_code INTERFACE
md4_crypto_sum_func(in, in_length, seed, seed_length, outcksum)
krb5_pointer in;
size_t in_length;
krb5_pointer seed;
size_t seed_length;
-krb5_checksum *outcksum;
+krb5_checksum FAR *outcksum;
{
krb5_octet outtmp[RSA_MD4_DES_CKSUM_LENGTH];
krb5_octet *input = (krb5_octet *)in;
if (retval = mit_des_process_key(&eblock, &keyblock))
return retval;
/* now encrypt it */
- retval = mit_des_cbc_encrypt(&outtmp[0],
- outcksum->contents,
+ retval = mit_des_cbc_encrypt((mit_des_cblock *)&outtmp[0],
+ (mit_des_cblock *)outcksum->contents,
RSA_MD4_DES_CKSUM_LENGTH,
(struct mit_des_ks_struct *)eblock.priv,
keyblock.contents,
#include "k5-int.h"
#include "rsa-md4.h"
-static krb5_error_code
+krb5_error_code INTERFACE
+md4_sum_func NPROTOTYPE((krb5_pointer in, size_t in_length,
+ krb5_pointer seed, size_t seed_length, krb5_checksum *outcksum));
+
+krb5_error_code INTERFACE
md4_sum_func(in, in_length, seed, seed_length, outcksum)
krb5_pointer in;
size_t in_length;
krb5_pointer seed;
size_t seed_length;
-krb5_checksum *outcksum;
+krb5_checksum FAR *outcksum;
{
krb5_octet *input = (krb5_octet *)in;
MD4_CTX working;
} MD4_CTX;
#ifdef __STDC__
-extern void MD4Init(MD4_CTX *);
-extern void MD4Update(MD4_CTX *, unsigned char *, unsigned int);
-extern void MD4Final(MD4_CTX *);
+extern void INTERFACE MD4Init(MD4_CTX FAR *);
+extern void INTERFACE MD4Update(MD4_CTX FAR *, unsigned char FAR *, unsigned int);
+extern void INTERFACE MD4Final(MD4_CTX FAR *);
#else
-void MD4Init ();
-void MD4Update ();
-void MD4Final ();
+void INTERFACE MD4Init ();
+void INTERFACE MD4Update ();
+void INTERFACE MD4Final ();
#endif
/*
+Mon Feb 20 15:54:1 1995 Keith Vetter (keithv@fusion.com)
+
+ * Makefile.in: made to work for the PC
+ * md5.c, md5crypt.c md5glue.c: added windows INTERFACE keyword
+
Thu Feb 2 03:01:28 1995 John Gilmore <gnu@cygnus.com>
* Makefile.in (CFLAGS): Handle $(srcdir) properly in -I options.
CFLAGS = $(CCOPTS) $(DEFS) -I$(srcdir)/../des
LDFLAGS = -g
-all:: $(OBJS) t_mddriver
+##DOSBUILDTOP = ..\..\..
+##DOSLIBNAME=..\libcrypto.$(LIBEXT)
+##DOS!include $(BUILDTOP)\config\windows.in
-OBJS= md5.o md5glue.o md5crypto.o
+OBJS= md5.$(OBJEXT) md5glue.$(OBJEXT) md5crypto.$(OBJEXT)
SRCS= $(srcdir)/md5.c $(srcdir)/md5glue.c $(srcdir)/md5crypto.c
-t_mddriver: t_mddriver.o md5.o
+all:: $(OBJS) all-$(WHAT)
+
+all-unix:: t_mddriver-unix
+
+all-windows::
+
+t_mddriver-unix: t_mddriver.o md5.o
$(CC) $(CFLAGS) -o t_mddriver t_mddriver.o md5.o
-check:: t_mddriver
- ./t_mddriver -x
+t_mddriver-windows:
+ $(CC) $(CFLAGS2) -o t_mddriver.exe t_mddriver.c md5.c
+ $(RM) md5.obj
+
+check:: t_mddriver-$(WHAT)
+ $(C)t_mddriver$(EXEEXT) -x
clean::
- $(RM) t_mddriver t_mddriver.o
+ $(RM) t_mddriver$(EXEEXT) t_mddriver.$(OBJEXT)
*/
/* forward declaration */
-static void Transform ();
+static void Transform PROTOTYPE((krb5_ui_4 FAR *buf, krb5_ui_4 FAR *in));
static unsigned char PADDING[64] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* The routine MD5Init initializes the message-digest context
mdContext. All fields are set to zero.
*/
-void MD5Init (mdContext)
-MD5_CTX *mdContext;
+void INTERFACE
+MD5Init (mdContext)
+MD5_CTX FAR *mdContext;
{
mdContext->i[0] = mdContext->i[1] = (krb5_ui_4)0;
account for the presence of each of the characters inBuf[0..inLen-1]
in the message whose digest is being computed.
*/
-void MD5Update (mdContext, inBuf, inLen)
-MD5_CTX *mdContext;
-unsigned char *inBuf;
+void INTERFACE
+MD5Update (mdContext, inBuf, inLen)
+MD5_CTX FAR *mdContext;
+unsigned char FAR *inBuf;
unsigned int inLen;
{
krb5_ui_4 in[16];
/* The routine MD5Final terminates the message-digest computation and
ends with the desired message digest in mdContext->digest[0...15].
*/
-void MD5Final (mdContext)
-MD5_CTX *mdContext;
+void INTERFACE
+MD5Final (mdContext)
+MD5_CTX FAR *mdContext;
{
krb5_ui_4 in[16];
int mdi;
/* Basic MD5 step. Transforms buf based on in.
*/
static void Transform (buf, in)
-krb5_ui_4 *buf;
-krb5_ui_4 *in;
+krb5_ui_4 FAR *buf;
+krb5_ui_4 FAR *in;
{
register krb5_ui_4 a = buf[0], b = buf[1], c = buf[2], d = buf[3];
#include <krb5/rsa-md5.h>
#include "des_int.h" /* we cheat a bit and call it directly... */
-static krb5_error_code
+krb5_error_code INTERFACE
+md5_crypto_sum_func NPROTOTYPE((krb5_pointer in, size_t in_length,
+ krb5_pointer seed, size_t seed_length, krb5_checksum *outcksum));
+
+krb5_error_code INTERFACE
md5_crypto_sum_func(in, in_length, seed, seed_length, outcksum)
krb5_pointer in;
size_t in_length;
krb5_pointer seed;
size_t seed_length;
-krb5_checksum *outcksum;
+krb5_checksum FAR *outcksum;
{
krb5_octet outtmp[RSA_MD5_DES_CKSUM_LENGTH];
krb5_octet *input = (krb5_octet *)in;
if (retval = mit_des_process_key(&eblock, &keyblock))
return retval;
/* now encrypt it */
- retval = mit_des_cbc_encrypt(&outtmp[0],
- outcksum->contents,
+ retval = mit_des_cbc_encrypt((mit_des_cblock *)&outtmp[0],
+ (mit_des_cblock *)outcksum->contents,
RSA_MD5_DES_CKSUM_LENGTH,
(struct mit_des_ks_struct *)eblock.priv,
keyblock.contents,
#include "k5-int.h"
#include <krb5/rsa-md5.h>
-static krb5_error_code
+krb5_error_code INTERFACE
+md5_sum_func NPROTOTYPE((krb5_pointer in, size_t in_length,
+ krb5_pointer seed, size_t seed_length, krb5_checksum *outcksum));
+
+krb5_error_code INTERFACE
md5_sum_func(in, in_length, seed, seed_length, outcksum)
krb5_pointer in;
size_t in_length;
krb5_pointer seed;
size_t seed_length;
-krb5_checksum *outcksum;
+krb5_checksum FAR *outcksum;
{
krb5_octet *input = (krb5_octet *)in;
MD5_CTX working;
+Mon Feb 20 16:25:36 1995 Keith Vetter (keithv@fusion.com)
+
+ * Makfile.in: made to work for the PC
+ * rnd_confoun.c: added windows INTERFACE keyword
+
Wed Jan 25 20:24:35 1995 John Gilmore (gnu at toad.com)
* rnd_confoun.c: Replace <.../...> includes with "..."s.
CFLAGS = $(CCOPTS) $(DEFS)
LDFLAGS = -g
+##DOSBUILDTOP = ..\..\..
+##DOSLIBNAME=..\libcrypto.$(LIBEXT)
+##DOS!include $(BUILDTOP)\config\windows.in
+
LIBOBJS = @LIBOBJS@
-all:: $(OBJS)
+OBJS= rnd_confoun.$(OBJEXT) localaddr.$(OBJEXT) ustime.$(OBJEXT) $(LIBOBJS)
+SRCS= rnd_confoun.c localaddr.c ustime.c
+all:: all-$(WHAT)
-OBJS= rnd_confoun.o localaddr.o ustime.o $(LIBOBJS)
+all-unix:: $(OBJS)
-SRCS= rnd_confoun.c localaddr.c ustime.c
+all-windows: rnd_confoun.obj
localaddr.c: ../../krb5/os/localaddr.c
-$(LN) $(srcdir)/../../krb5/os/localaddr.c $@
/*
* Generate a random confounder
*/
-krb5_error_code
+krb5_error_code INTERFACE
krb5_random_confounder(size, fillin)
int size;
krb5_pointer fillin;
#include "k5-int.h"
#include "des_int.h"
-static krb5_error_code mit_raw_des_encrypt_func
+krb5_error_code INTERFACE mit_raw_des_encrypt_func
PROTOTYPE(( krb5_const_pointer, krb5_pointer, const size_t,
krb5_encrypt_block *, krb5_pointer ));
-static krb5_error_code mit_raw_des_decrypt_func
+krb5_error_code INTERFACE mit_raw_des_decrypt_func
PROTOTYPE(( krb5_const_pointer, krb5_pointer, const size_t,
krb5_encrypt_block *, krb5_pointer ));
0
};
-static krb5_error_code
+krb5_error_code INTERFACE
mit_raw_des_decrypt_func(in, out, size, key, ivec)
krb5_const_pointer in;
krb5_pointer out;
krb5_encrypt_block * key;
krb5_pointer ivec;
{
- return (mit_des_cbc_encrypt (in,
+ return (mit_des_cbc_encrypt ((const mit_des_cblock *) in,
out,
size,
(struct mit_des_ks_struct *)key->priv,
MIT_DES_DECRYPT));
}
-static krb5_error_code
+krb5_error_code INTERFACE
mit_raw_des_encrypt_func(in, out, size, key, ivec)
krb5_const_pointer in;
krb5_pointer out;