summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/md4
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/md4')
-rw-r--r--src/lib/libcrypto/md4/Makefile.ssl15
-rw-r--r--src/lib/libcrypto/md4/md4.h14
-rw-r--r--src/lib/libcrypto/md4/md4_dgst.c3
-rw-r--r--src/lib/libcrypto/md4/md4_locl.h2
-rw-r--r--src/lib/libcrypto/md4/md4test.c7
5 files changed, 25 insertions, 16 deletions
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=
12OPENSSLDIR= /usr/local/ssl 12OPENSSLDIR= /usr/local/ssl
13INSTALLTOP=/usr/local/ssl 13INSTALLTOP=/usr/local/ssl
14MAKE= make -f Makefile.ssl 14MAKE= make -f Makefile.ssl
15MAKEDEPEND= $(TOP)/util/domd $(TOP) 15MAKEDEPPROG= makedepend
16MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
16MAKEFILE= Makefile.ssl 17MAKEFILE= Makefile.ssl
17AR= ar r 18AR= ar r
18 19
@@ -40,8 +41,7 @@ all: lib
40 41
41lib: $(LIBOBJ) 42lib: $(LIBOBJ)
42 $(AR) $(LIB) $(LIBOBJ) 43 $(AR) $(LIB) $(LIBOBJ)
43 @echo You may get an error following this line. Please ignore. 44 $(RANLIB) $(LIB) || echo Never mind.
44 - $(RANLIB) $(LIB)
45 @touch lib 45 @touch lib
46 46
47files: 47files:
@@ -80,6 +80,9 @@ clean:
80 80
81# DO NOT DELETE THIS LINE -- make depend depends on it. 81# DO NOT DELETE THIS LINE -- make depend depends on it.
82 82
83md4_dgst.o: ../../include/openssl/md4.h ../../include/openssl/opensslconf.h 83md4_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/md4.h
84md4_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md4_locl.h 84md4_dgst.o: ../../include/openssl/opensslconf.h
85md4_one.o: ../../include/openssl/md4.h 85md4_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md4_dgst.c
86md4_dgst.o: md4_locl.h
87md4_one.o: ../../include/openssl/e_os2.h ../../include/openssl/md4.h
88md4_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 @@
59#ifndef HEADER_MD4_H 59#ifndef HEADER_MD4_H
60#define HEADER_MD4_H 60#define HEADER_MD4_H
61 61
62#include <openssl/e_os2.h>
63
62#ifdef __cplusplus 64#ifdef __cplusplus
63extern "C" { 65extern "C" {
64#endif 66#endif
65 67
66#ifdef NO_MD4 68#ifdef OPENSSL_NO_MD4
67#error MD4 is disabled. 69#error MD4 is disabled.
68#endif 70#endif
69 71
@@ -74,9 +76,9 @@ extern "C" {
74 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 76 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
75 */ 77 */
76 78
77#if defined(WIN16) || defined(__LP32__) 79#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__)
78#define MD4_LONG unsigned long 80#define MD4_LONG unsigned long
79#elif defined(_CRAY) || defined(__ILP64__) 81#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
80#define MD4_LONG unsigned long 82#define MD4_LONG unsigned long
81#define MD4_LONG_LOG2 3 83#define MD4_LONG_LOG2 3
82/* 84/*
@@ -102,9 +104,9 @@ typedef struct MD4state_st
102 int num; 104 int num;
103 } MD4_CTX; 105 } MD4_CTX;
104 106
105void MD4_Init(MD4_CTX *c); 107int MD4_Init(MD4_CTX *c);
106void MD4_Update(MD4_CTX *c, const void *data, unsigned long len); 108int MD4_Update(MD4_CTX *c, const void *data, unsigned long len);
107void MD4_Final(unsigned char *md, MD4_CTX *c); 109int MD4_Final(unsigned char *md, MD4_CTX *c);
108unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md); 110unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md);
109void MD4_Transform(MD4_CTX *c, const unsigned char *b); 111void MD4_Transform(MD4_CTX *c, const unsigned char *b);
110#ifdef __cplusplus 112#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;
70#define INIT_DATA_C (unsigned long)0x98badcfeL 70#define INIT_DATA_C (unsigned long)0x98badcfeL
71#define INIT_DATA_D (unsigned long)0x10325476L 71#define INIT_DATA_D (unsigned long)0x10325476L
72 72
73void MD4_Init(MD4_CTX *c) 73int MD4_Init(MD4_CTX *c)
74 { 74 {
75 c->A=INIT_DATA_A; 75 c->A=INIT_DATA_A;
76 c->B=INIT_DATA_B; 76 c->B=INIT_DATA_B;
@@ -79,6 +79,7 @@ void MD4_Init(MD4_CTX *c)
79 c->Nl=0; 79 c->Nl=0;
80 c->Nh=0; 80 c->Nh=0;
81 c->num=0; 81 c->num=0;
82 return 1;
82 } 83 }
83 84
84#ifndef md4_block_host_order 85#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 @@
68void md4_block_host_order (MD4_CTX *c, const void *p,int num); 68void md4_block_host_order (MD4_CTX *c, const void *p,int num);
69void md4_block_data_order (MD4_CTX *c, const void *p,int num); 69void md4_block_data_order (MD4_CTX *c, const void *p,int num);
70 70
71#if defined(__i386) || defined(_M_IX86) || defined(__INTEL__) 71#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
72/* 72/*
73 * *_block_host_order is expected to handle aligned data while 73 * *_block_host_order is expected to handle aligned data while
74 * *_block_data_order - unaligned. As algorithm and host (x86) 74 * *_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 @@
60#include <string.h> 60#include <string.h>
61#include <stdlib.h> 61#include <stdlib.h>
62 62
63#ifdef NO_MD4 63#ifdef OPENSSL_NO_MD4
64int main(int argc, char *argv[]) 64int main(int argc, char *argv[])
65{ 65{
66 printf("No MD4 support\n"); 66 printf("No MD4 support\n");
67 return(0); 67 return(0);
68} 68}
69#else 69#else
70#include <openssl/evp.h>
70#include <openssl/md4.h> 71#include <openssl/md4.h>
71 72
72static char *test[]={ 73static char *test[]={
@@ -96,13 +97,15 @@ int main(int argc, char *argv[])
96 int i,err=0; 97 int i,err=0;
97 unsigned char **P,**R; 98 unsigned char **P,**R;
98 char *p; 99 char *p;
100 unsigned char md[MD4_DIGEST_LENGTH];
99 101
100 P=(unsigned char **)test; 102 P=(unsigned char **)test;
101 R=(unsigned char **)ret; 103 R=(unsigned char **)ret;
102 i=1; 104 i=1;
103 while (*P != NULL) 105 while (*P != NULL)
104 { 106 {
105 p=pt(MD4(&(P[0][0]),(unsigned long)strlen((char *)*P),NULL)); 107 EVP_Digest(&(P[0][0]),(unsigned long)strlen((char *)*P),md,NULL,EVP_md4(), NULL);
108 p=pt(md);
106 if (strcmp(p,(char *)*R) != 0) 109 if (strcmp(p,(char *)*R) != 0)
107 { 110 {
108 printf("error calculating MD4 on '%s'\n",*P); 111 printf("error calculating MD4 on '%s'\n",*P);