summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/md2
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/md2')
-rw-r--r--crypto/openssl/crypto/md2/Makefile22
-rw-r--r--crypto/openssl/crypto/md2/md2.h8
-rw-r--r--crypto/openssl/crypto/md2/md2_dgst.c6
-rw-r--r--crypto/openssl/crypto/md2/md2_one.c5
-rw-r--r--crypto/openssl/crypto/md2/md2test.c6
5 files changed, 25 insertions, 22 deletions
diff --git a/crypto/openssl/crypto/md2/Makefile b/crypto/openssl/crypto/md2/Makefile
index 975eda2..17f878a 100644
--- a/crypto/openssl/crypto/md2/Makefile
+++ b/crypto/openssl/crypto/md2/Makefile
@@ -1,5 +1,5 @@
#
-# SSLeay/crypto/md/Makefile
+# OpenSSL/crypto/md/Makefile
#
DIR= md2
@@ -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,7 +46,8 @@ links:
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
install:
- @for i in $(EXHEADER) ; \
+ @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
+ @headerlist="$(EXHEADER)"; for i in $$headerlist ; \
do \
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
chmod 644 $(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:
@@ -79,13 +76,14 @@ clean:
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/crypto/openssl/crypto/md2/md2.h b/crypto/openssl/crypto/md2/md2.h
index ad92414..5b71855 100644
--- a/crypto/openssl/crypto/md2/md2.h
+++ b/crypto/openssl/crypto/md2/md2.h
@@ -59,13 +59,13 @@
#ifndef HEADER_MD2_H
#define HEADER_MD2_H
+#include <openssl/opensslconf.h> /* OPENSSL_NO_MD2, MD2_INT */
#ifdef OPENSSL_NO_MD2
#error MD2 is disabled.
#endif
#define MD2_DIGEST_LENGTH 16
#define MD2_BLOCK 16
-#include <openssl/opensslconf.h> /* MD2_INT */
#ifdef __cplusplus
extern "C" {
@@ -73,7 +73,7 @@ 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];
@@ -81,9 +81,9 @@ typedef struct MD2state_st
const char *MD2_options(void);
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/crypto/openssl/crypto/md2/md2_dgst.c b/crypto/openssl/crypto/md2/md2_dgst.c
index ecb64f0..15e77d6 100644
--- a/crypto/openssl/crypto/md2/md2_dgst.c
+++ b/crypto/openssl/crypto/md2/md2_dgst.c
@@ -125,7 +125,7 @@ int MD2_Init(MD2_CTX *c)
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;
@@ -145,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;
@@ -159,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/crypto/openssl/crypto/md2/md2_one.c b/crypto/openssl/crypto/md2/md2_one.c
index 835160e..f7fef5c 100644
--- a/crypto/openssl/crypto/md2/md2_one.c
+++ b/crypto/openssl/crypto/md2/md2_one.c
@@ -63,13 +63,14 @@
/* 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];
if (md == NULL) md=m;
- MD2_Init(&c);
+ if (!MD2_Init(&c))
+ return NULL;
#ifndef CHARSET_EBCDIC
MD2_Update(&c,d,n);
#else
diff --git a/crypto/openssl/crypto/md2/md2test.c b/crypto/openssl/crypto/md2/md2test.c
index 9c1e28b..db5f5bc 100644
--- a/crypto/openssl/crypto/md2/md2test.c
+++ b/crypto/openssl/crypto/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)
OpenPOWER on IntegriCloud