summaryrefslogtreecommitdiff
path: root/usr/src/common/openssl/crypto/md2
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/common/openssl/crypto/md2')
-rw-r--r--usr/src/common/openssl/crypto/md2/md2.h8
-rw-r--r--usr/src/common/openssl/crypto/md2/md2_dgst.c6
-rw-r--r--usr/src/common/openssl/crypto/md2/md2_one.c5
-rw-r--r--usr/src/common/openssl/crypto/md2/md2test.c6
4 files changed, 15 insertions, 10 deletions
diff --git a/usr/src/common/openssl/crypto/md2/md2.h b/usr/src/common/openssl/crypto/md2/md2.h
index ad9241455c..5b71855cb2 100644
--- a/usr/src/common/openssl/crypto/md2/md2.h
+++ b/usr/src/common/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/usr/src/common/openssl/crypto/md2/md2_dgst.c b/usr/src/common/openssl/crypto/md2/md2_dgst.c
index ecb64f0ec4..15e77d60be 100644
--- a/usr/src/common/openssl/crypto/md2/md2_dgst.c
+++ b/usr/src/common/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/usr/src/common/openssl/crypto/md2/md2_one.c b/usr/src/common/openssl/crypto/md2/md2_one.c
index 835160ef56..f7fef5cc0a 100644
--- a/usr/src/common/openssl/crypto/md2/md2_one.c
+++ b/usr/src/common/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/usr/src/common/openssl/crypto/md2/md2test.c b/usr/src/common/openssl/crypto/md2/md2test.c
index 9c1e28b6ce..db5f5bc6d2 100644
--- a/usr/src/common/openssl/crypto/md2/md2test.c
+++ b/usr/src/common/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)