From f1625f274acf5dcd5601f6cb5e29e233b2a441a3 Mon Sep 17 00:00:00 2001 From: djm <> Date: Sat, 6 Sep 2008 12:15:54 +0000 Subject: import of OpenSSL 0.9.8h --- src/lib/libcrypto/md2/Makefile | 22 +++++++++------------- src/lib/libcrypto/md2/md2.h | 12 +++++------- src/lib/libcrypto/md2/md2_dgst.c | 12 +++++------- src/lib/libcrypto/md2/md2_one.c | 2 +- src/lib/libcrypto/md2/md2test.c | 6 +++++- 5 files changed, 25 insertions(+), 29 deletions(-) (limited to 'src/lib/libcrypto/md2') diff --git a/src/lib/libcrypto/md2/Makefile b/src/lib/libcrypto/md2/Makefile index 9d0351bb2f..17f878aeb7 100644 --- a/src/lib/libcrypto/md2/Makefile +++ b/src/lib/libcrypto/md2/Makefile @@ -7,11 +7,6 @@ TOP= ../.. CC= cc INCLUDES= CFLAG=-g -INSTALL_PREFIX= -OPENSSLDIR= /usr/local/ssl -INSTALLTOP=/usr/local/ssl -MAKEDEPPROG= makedepend -MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) MAKEFILE= Makefile AR= ar r @@ -51,6 +46,7 @@ links: @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) install: + @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ do \ (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ @@ -66,6 +62,7 @@ lint: lint -DLINT $(INCLUDES) $(SRC)>fluff depend: + @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) dclean: @@ -77,17 +74,16 @@ clean: # DO NOT DELETE THIS LINE -- make depend depends on it. -md2_dgst.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h -md2_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h -md2_dgst.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h +md2_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h md2_dgst.o: ../../include/openssl/md2.h ../../include/openssl/opensslconf.h -md2_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h -md2_dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -md2_dgst.o: md2_dgst.c +md2_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h +md2_dgst.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h +md2_dgst.o: ../../include/openssl/symhacks.h md2_dgst.c md2_one.o: ../../e_os.h ../../include/openssl/bio.h md2_one.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h md2_one.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h md2_one.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h md2_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h -md2_one.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -md2_one.o: ../../include/openssl/symhacks.h ../cryptlib.h md2_one.c +md2_one.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h +md2_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +md2_one.o: ../cryptlib.h md2_one.c diff --git a/src/lib/libcrypto/md2/md2.h b/src/lib/libcrypto/md2/md2.h index d0ef9da08e..a46120e7d4 100644 --- a/src/lib/libcrypto/md2/md2.h +++ b/src/lib/libcrypto/md2/md2.h @@ -59,13 +59,14 @@ #ifndef HEADER_MD2_H #define HEADER_MD2_H +#include /* OPENSSL_NO_MD2, MD2_INT */ #ifdef OPENSSL_NO_MD2 #error MD2 is disabled. #endif +#include #define MD2_DIGEST_LENGTH 16 #define MD2_BLOCK 16 -#include /* MD2_INT */ #ifdef __cplusplus extern "C" { @@ -73,20 +74,17 @@ extern "C" { typedef struct MD2state_st { - int num; + unsigned int num; unsigned char data[MD2_BLOCK]; MD2_INT cksm[MD2_BLOCK]; MD2_INT state[MD2_BLOCK]; } MD2_CTX; const char *MD2_options(void); -#ifdef OPENSSL_FIPS -int private_MD2_Init(MD2_CTX *c); -#endif int MD2_Init(MD2_CTX *c); -int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len); +int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); int MD2_Final(unsigned char *md, MD2_CTX *c); -unsigned char *MD2(const unsigned char *d, unsigned long n,unsigned char *md); +unsigned char *MD2(const unsigned char *d, size_t n,unsigned char *md); #ifdef __cplusplus } #endif diff --git a/src/lib/libcrypto/md2/md2_dgst.c b/src/lib/libcrypto/md2/md2_dgst.c index 8124acd687..6f68b25c6a 100644 --- a/src/lib/libcrypto/md2/md2_dgst.c +++ b/src/lib/libcrypto/md2/md2_dgst.c @@ -62,10 +62,8 @@ #include #include #include -#include -#include -const char *MD2_version="MD2" OPENSSL_VERSION_PTEXT; +const char MD2_version[]="MD2" OPENSSL_VERSION_PTEXT; /* Implemented from RFC1319 The MD2 Message-Digest Algorithm */ @@ -118,7 +116,7 @@ const char *MD2_options(void) return("md2(int)"); } -FIPS_NON_FIPS_MD_Init(MD2) +int MD2_Init(MD2_CTX *c) { c->num=0; memset(c->state,0,sizeof c->state); @@ -127,7 +125,7 @@ FIPS_NON_FIPS_MD_Init(MD2) return 1; } -int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len) +int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len) { register UCHAR *p; @@ -147,7 +145,7 @@ int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len) } else { - memcpy(&(p[c->num]),data,(int)len); + memcpy(&(p[c->num]),data,len); /* data+=len; */ c->num+=(int)len; return 1; @@ -161,7 +159,7 @@ int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len) data+=MD2_BLOCK; len-=MD2_BLOCK; } - memcpy(p,data,(int)len); + memcpy(p,data,len); c->num=(int)len; return 1; } diff --git a/src/lib/libcrypto/md2/md2_one.c b/src/lib/libcrypto/md2/md2_one.c index 8c36ba5779..f7fef5cc0a 100644 --- a/src/lib/libcrypto/md2/md2_one.c +++ b/src/lib/libcrypto/md2/md2_one.c @@ -63,7 +63,7 @@ /* This is a separate file so that #defines in cryptlib.h can * map my MD functions to different names */ -unsigned char *MD2(const unsigned char *d, unsigned long n, unsigned char *md) +unsigned char *MD2(const unsigned char *d, size_t n, unsigned char *md) { MD2_CTX c; static unsigned char m[MD2_DIGEST_LENGTH]; diff --git a/src/lib/libcrypto/md2/md2test.c b/src/lib/libcrypto/md2/md2test.c index 9c1e28b6ce..db5f5bc6d2 100644 --- a/src/lib/libcrypto/md2/md2test.c +++ b/src/lib/libcrypto/md2/md2test.c @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) i=1; while (*P != NULL) { - EVP_Digest((unsigned char *)*P,(unsigned long)strlen(*P),md,NULL,EVP_md2(), NULL); + EVP_Digest((unsigned char *)*P,strlen(*P),md,NULL,EVP_md2(), NULL); p=pt(md); if (strcmp(p,*R) != 0) { @@ -124,7 +124,11 @@ int main(int argc, char *argv[]) R++; P++; } +#ifdef OPENSSL_SYS_NETWARE + if (err) printf("ERROR: %d\n", err); +#endif EXIT(err); + return err; } static char *pt(unsigned char *md) -- cgit v1.2.3-55-g6feb