diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2002-05-15 02:29:22 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2002-05-15 02:29:22 +0000 |
commit | 4df88d25cb3419048d1bcf9740d37d4c459aef22 (patch) | |
tree | 97858aa44644bc9b64d1775a8bbccfb5baca24d3 /lib/libcrypto/md5 | |
parent | 998d0d156e423800e9a2fa1a482c0726f14201c2 (diff) |
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'lib/libcrypto/md5')
-rw-r--r-- | lib/libcrypto/md5/Makefile.ssl | 11 | ||||
-rw-r--r-- | lib/libcrypto/md5/asm/md5-sparcv9.S | 8 | ||||
-rw-r--r-- | lib/libcrypto/md5/md5.h | 12 | ||||
-rw-r--r-- | lib/libcrypto/md5/md5_dgst.c | 3 | ||||
-rw-r--r-- | lib/libcrypto/md5/md5_locl.h | 6 | ||||
-rw-r--r-- | lib/libcrypto/md5/md5test.c | 7 |
6 files changed, 26 insertions, 21 deletions
diff --git a/lib/libcrypto/md5/Makefile.ssl b/lib/libcrypto/md5/Makefile.ssl index 784215579b4..f9a1190efba 100644 --- a/lib/libcrypto/md5/Makefile.ssl +++ b/lib/libcrypto/md5/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 @@ -50,8 +51,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 # elf @@ -130,5 +130,6 @@ clean: # DO NOT DELETE THIS LINE -- make depend depends on it. md5_dgst.o: ../../include/openssl/md5.h ../../include/openssl/opensslconf.h -md5_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md5_locl.h -md5_one.o: ../../include/openssl/md5.h +md5_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md5_dgst.c +md5_dgst.o: md5_locl.h +md5_one.o: ../../include/openssl/md5.h md5_one.c diff --git a/lib/libcrypto/md5/asm/md5-sparcv9.S b/lib/libcrypto/md5/asm/md5-sparcv9.S index ca4257f1341..a599ed5660b 100644 --- a/lib/libcrypto/md5/asm/md5-sparcv9.S +++ b/lib/libcrypto/md5/asm/md5-sparcv9.S @@ -24,12 +24,12 @@ * * To compile with SC4.x/SC5.x: * - * cc -xarch=v[9|8plus] -DULTRASPARC -DMD5_BLOCK_DATA_ORDER \ + * cc -xarch=v[9|8plus] -DOPENSSL_SYSNAME_ULTRASPARC -DMD5_BLOCK_DATA_ORDER \ * -c md5-sparcv9.S * * and with gcc: * - * gcc -mcpu=ultrasparc -DULTRASPARC -DMD5_BLOCK_DATA_ORDER \ + * gcc -mcpu=ultrasparc -DOPENSSL_SYSNAME_ULTRASPARC -DMD5_BLOCK_DATA_ORDER \ * -c md5-sparcv9.S * * or if above fails (it does if you have gas): @@ -72,7 +72,7 @@ #define Dval R8 #if defined(MD5_BLOCK_DATA_ORDER) -# if defined(ULTRASPARC) +# if defined(OPENSSL_SYSNAME_ULTRASPARC) # define LOAD lda # define X(i) [%i1+i*4]%asi # define md5_block md5_block_asm_data_order_aligned @@ -1012,7 +1012,7 @@ md5_block: st B,[Bptr] nop != -#ifdef ULTRASPARC +#ifdef OPENSSL_SYSNAME_ULTRASPARC bg,a,pt %icc,.Lmd5_block_loop #else bg,a .Lmd5_block_loop diff --git a/lib/libcrypto/md5/md5.h b/lib/libcrypto/md5/md5.h index d10bc8397ff..52cb753e6a9 100644 --- a/lib/libcrypto/md5/md5.h +++ b/lib/libcrypto/md5/md5.h @@ -63,7 +63,7 @@ extern "C" { #endif -#ifdef NO_MD5 +#ifdef OPENSSL_NO_MD5 #error MD5 is disabled. #endif @@ -74,9 +74,9 @@ extern "C" { * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ -#if defined(WIN16) || defined(__LP32__) +#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) #define MD5_LONG unsigned long -#elif defined(_CRAY) || defined(__ILP64__) +#elif defined(OENSSL_SYS_CRAY) || defined(__ILP64__) #define MD5_LONG unsigned long #define MD5_LONG_LOG2 3 /* @@ -102,9 +102,9 @@ typedef struct MD5state_st int num; } MD5_CTX; -void MD5_Init(MD5_CTX *c); -void MD5_Update(MD5_CTX *c, const void *data, unsigned long len); -void MD5_Final(unsigned char *md, MD5_CTX *c); +int MD5_Init(MD5_CTX *c); +int MD5_Update(MD5_CTX *c, const void *data, unsigned long len); +int MD5_Final(unsigned char *md, MD5_CTX *c); unsigned char *MD5(const unsigned char *d, unsigned long n, unsigned char *md); void MD5_Transform(MD5_CTX *c, const unsigned char *b); #ifdef __cplusplus diff --git a/lib/libcrypto/md5/md5_dgst.c b/lib/libcrypto/md5/md5_dgst.c index 23d196b8d45..c38a3f021e9 100644 --- a/lib/libcrypto/md5/md5_dgst.c +++ b/lib/libcrypto/md5/md5_dgst.c @@ -70,7 +70,7 @@ const char *MD5_version="MD5" OPENSSL_VERSION_PTEXT; #define INIT_DATA_C (unsigned long)0x98badcfeL #define INIT_DATA_D (unsigned long)0x10325476L -void MD5_Init(MD5_CTX *c) +int MD5_Init(MD5_CTX *c) { c->A=INIT_DATA_A; c->B=INIT_DATA_B; @@ -79,6 +79,7 @@ void MD5_Init(MD5_CTX *c) c->Nl=0; c->Nh=0; c->num=0; + return 1; } #ifndef md5_block_host_order diff --git a/lib/libcrypto/md5/md5_locl.h b/lib/libcrypto/md5/md5_locl.h index c9124841228..34c5257306d 100644 --- a/lib/libcrypto/md5/md5_locl.h +++ b/lib/libcrypto/md5/md5_locl.h @@ -66,9 +66,9 @@ #endif #ifdef MD5_ASM -# if defined(__i386) || defined(_M_IX86) || defined(__INTEL__) +# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) # define md5_block_host_order md5_block_asm_host_order -# elif defined(__sparc) && defined(ULTRASPARC) +# elif defined(__sparc) && defined(OPENSSL_SYS_ULTRASPARC) void md5_block_asm_data_order_aligned (MD5_CTX *c, const MD5_LONG *p,int num); # define HASH_BLOCK_DATA_ORDER_ALIGNED md5_block_asm_data_order_aligned # endif @@ -77,7 +77,7 @@ void md5_block_host_order (MD5_CTX *c, const void *p,int num); void md5_block_data_order (MD5_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/lib/libcrypto/md5/md5test.c b/lib/libcrypto/md5/md5test.c index 6bd86563020..862b89658aa 100644 --- a/lib/libcrypto/md5/md5test.c +++ b/lib/libcrypto/md5/md5test.c @@ -60,13 +60,14 @@ #include <string.h> #include <stdlib.h> -#ifdef NO_MD5 +#ifdef OPENSSL_NO_MD5 int main(int argc, char *argv[]) { printf("No MD5 support\n"); return(0); } #else +#include <openssl/evp.h> #include <openssl/md5.h> 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[MD5_DIGEST_LENGTH]; P=(unsigned char **)test; R=(unsigned char **)ret; i=1; while (*P != NULL) { - p=pt(MD5(&(P[0][0]),(unsigned long)strlen((char *)*P),NULL)); + EVP_Digest(&(P[0][0]),(unsigned long)strlen((char *)*P),md,NULL,EVP_md5(), NULL); + p=pt(md); if (strcmp(p,(char *)*R) != 0) { printf("error calculating MD5 on '%s'\n",*P); |