From b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9 Mon Sep 17 00:00:00 2001 From: beck <> Date: Wed, 15 May 2002 02:29:21 +0000 Subject: OpenSSL 0.9.7 stable 2002 05 08 merge --- src/lib/libcrypto/md4/Makefile.ssl | 15 +++++++++------ src/lib/libcrypto/md4/md4.h | 14 ++++++++------ src/lib/libcrypto/md4/md4_dgst.c | 3 ++- src/lib/libcrypto/md4/md4_locl.h | 2 +- src/lib/libcrypto/md4/md4test.c | 7 +++++-- 5 files changed, 25 insertions(+), 16 deletions(-) (limited to 'src/lib/libcrypto/md4') diff --git a/src/lib/libcrypto/md4/Makefile.ssl b/src/lib/libcrypto/md4/Makefile.ssl index 646607274e..58c2b20a78 100644 --- a/src/lib/libcrypto/md4/Makefile.ssl +++ b/src/lib/libcrypto/md4/Makefile.ssl @@ -12,7 +12,8 @@ INSTALL_PREFIX= OPENSSLDIR= /usr/local/ssl INSTALLTOP=/usr/local/ssl MAKE= make -f Makefile.ssl -MAKEDEPEND= $(TOP)/util/domd $(TOP) +MAKEDEPPROG= makedepend +MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) MAKEFILE= Makefile.ssl AR= ar r @@ -40,8 +41,7 @@ all: lib lib: $(LIBOBJ) $(AR) $(LIB) $(LIBOBJ) - @echo You may get an error following this line. Please ignore. - - $(RANLIB) $(LIB) + $(RANLIB) $(LIB) || echo Never mind. @touch lib files: @@ -80,6 +80,9 @@ clean: # DO NOT DELETE THIS LINE -- make depend depends on it. -md4_dgst.o: ../../include/openssl/md4.h ../../include/openssl/opensslconf.h -md4_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md4_locl.h -md4_one.o: ../../include/openssl/md4.h +md4_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/md4.h +md4_dgst.o: ../../include/openssl/opensslconf.h +md4_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md4_dgst.c +md4_dgst.o: md4_locl.h +md4_one.o: ../../include/openssl/e_os2.h ../../include/openssl/md4.h +md4_one.o: ../../include/openssl/opensslconf.h md4_one.c diff --git a/src/lib/libcrypto/md4/md4.h b/src/lib/libcrypto/md4/md4.h index c794e186db..7a7b23682f 100644 --- a/src/lib/libcrypto/md4/md4.h +++ b/src/lib/libcrypto/md4/md4.h @@ -59,11 +59,13 @@ #ifndef HEADER_MD4_H #define HEADER_MD4_H +#include + #ifdef __cplusplus extern "C" { #endif -#ifdef NO_MD4 +#ifdef OPENSSL_NO_MD4 #error MD4 is disabled. #endif @@ -74,9 +76,9 @@ extern "C" { * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ -#if defined(WIN16) || defined(__LP32__) +#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) #define MD4_LONG unsigned long -#elif defined(_CRAY) || defined(__ILP64__) +#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) #define MD4_LONG unsigned long #define MD4_LONG_LOG2 3 /* @@ -102,9 +104,9 @@ typedef struct MD4state_st int num; } MD4_CTX; -void MD4_Init(MD4_CTX *c); -void MD4_Update(MD4_CTX *c, const void *data, unsigned long len); -void MD4_Final(unsigned char *md, MD4_CTX *c); +int MD4_Init(MD4_CTX *c); +int MD4_Update(MD4_CTX *c, const void *data, unsigned long len); +int MD4_Final(unsigned char *md, MD4_CTX *c); unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md); void MD4_Transform(MD4_CTX *c, const unsigned char *b); #ifdef __cplusplus diff --git a/src/lib/libcrypto/md4/md4_dgst.c b/src/lib/libcrypto/md4/md4_dgst.c index 81488ae2e2..6446f5f5e7 100644 --- a/src/lib/libcrypto/md4/md4_dgst.c +++ b/src/lib/libcrypto/md4/md4_dgst.c @@ -70,7 +70,7 @@ const char *MD4_version="MD4" OPENSSL_VERSION_PTEXT; #define INIT_DATA_C (unsigned long)0x98badcfeL #define INIT_DATA_D (unsigned long)0x10325476L -void MD4_Init(MD4_CTX *c) +int MD4_Init(MD4_CTX *c) { c->A=INIT_DATA_A; c->B=INIT_DATA_B; @@ -79,6 +79,7 @@ void MD4_Init(MD4_CTX *c) c->Nl=0; c->Nh=0; c->num=0; + return 1; } #ifndef md4_block_host_order diff --git a/src/lib/libcrypto/md4/md4_locl.h b/src/lib/libcrypto/md4/md4_locl.h index 0a2b39018d..a8d31d7a73 100644 --- a/src/lib/libcrypto/md4/md4_locl.h +++ b/src/lib/libcrypto/md4/md4_locl.h @@ -68,7 +68,7 @@ void md4_block_host_order (MD4_CTX *c, const void *p,int num); void md4_block_data_order (MD4_CTX *c, const void *p,int num); -#if defined(__i386) || defined(_M_IX86) || defined(__INTEL__) +#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) /* * *_block_host_order is expected to handle aligned data while * *_block_data_order - unaligned. As algorithm and host (x86) diff --git a/src/lib/libcrypto/md4/md4test.c b/src/lib/libcrypto/md4/md4test.c index 97e6e21efd..e0fdc42282 100644 --- a/src/lib/libcrypto/md4/md4test.c +++ b/src/lib/libcrypto/md4/md4test.c @@ -60,13 +60,14 @@ #include #include -#ifdef NO_MD4 +#ifdef OPENSSL_NO_MD4 int main(int argc, char *argv[]) { printf("No MD4 support\n"); return(0); } #else +#include #include static char *test[]={ @@ -96,13 +97,15 @@ int main(int argc, char *argv[]) int i,err=0; unsigned char **P,**R; char *p; + unsigned char md[MD4_DIGEST_LENGTH]; P=(unsigned char **)test; R=(unsigned char **)ret; i=1; while (*P != NULL) { - p=pt(MD4(&(P[0][0]),(unsigned long)strlen((char *)*P),NULL)); + EVP_Digest(&(P[0][0]),(unsigned long)strlen((char *)*P),md,NULL,EVP_md4(), NULL); + p=pt(md); if (strcmp(p,(char *)*R) != 0) { printf("error calculating MD4 on '%s'\n",*P); -- cgit v1.2.3-55-g6feb