diff options
| author | beck <> | 2002-05-15 02:29:21 +0000 |
|---|---|---|
| committer | beck <> | 2002-05-15 02:29:21 +0000 |
| commit | b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9 (patch) | |
| tree | fa27cf82a1250b64ed3bf5f4a18c7354d470bbcc /src/lib/libcrypto/md4 | |
| parent | e471e1ea98d673597b182ea85f29e30c97cd08b5 (diff) | |
| download | openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.gz openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.bz2 openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.zip | |
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'src/lib/libcrypto/md4')
| -rw-r--r-- | src/lib/libcrypto/md4/Makefile.ssl | 15 | ||||
| -rw-r--r-- | src/lib/libcrypto/md4/md4.h | 14 | ||||
| -rw-r--r-- | src/lib/libcrypto/md4/md4_dgst.c | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/md4/md4_locl.h | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/md4/md4test.c | 7 |
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= | |||
| 12 | OPENSSLDIR= /usr/local/ssl | 12 | OPENSSLDIR= /usr/local/ssl |
| 13 | INSTALLTOP=/usr/local/ssl | 13 | INSTALLTOP=/usr/local/ssl |
| 14 | MAKE= make -f Makefile.ssl | 14 | MAKE= make -f Makefile.ssl |
| 15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) | 15 | MAKEDEPPROG= makedepend |
| 16 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
| 16 | MAKEFILE= Makefile.ssl | 17 | MAKEFILE= Makefile.ssl |
| 17 | AR= ar r | 18 | AR= ar r |
| 18 | 19 | ||
| @@ -40,8 +41,7 @@ all: lib | |||
| 40 | 41 | ||
| 41 | lib: $(LIBOBJ) | 42 | lib: $(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 | ||
| 47 | files: | 47 | files: |
| @@ -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 | ||
| 83 | md4_dgst.o: ../../include/openssl/md4.h ../../include/openssl/opensslconf.h | 83 | md4_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/md4.h |
| 84 | md4_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md4_locl.h | 84 | md4_dgst.o: ../../include/openssl/opensslconf.h |
| 85 | md4_one.o: ../../include/openssl/md4.h | 85 | md4_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md4_dgst.c |
| 86 | md4_dgst.o: md4_locl.h | ||
| 87 | md4_one.o: ../../include/openssl/e_os2.h ../../include/openssl/md4.h | ||
| 88 | md4_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 |
| 63 | extern "C" { | 65 | extern "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 | ||
| 105 | void MD4_Init(MD4_CTX *c); | 107 | int MD4_Init(MD4_CTX *c); |
| 106 | void MD4_Update(MD4_CTX *c, const void *data, unsigned long len); | 108 | int MD4_Update(MD4_CTX *c, const void *data, unsigned long len); |
| 107 | void MD4_Final(unsigned char *md, MD4_CTX *c); | 109 | int MD4_Final(unsigned char *md, MD4_CTX *c); |
| 108 | unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md); | 110 | unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md); |
| 109 | void MD4_Transform(MD4_CTX *c, const unsigned char *b); | 111 | void 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 | ||
| 73 | void MD4_Init(MD4_CTX *c) | 73 | int 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 @@ | |||
| 68 | void md4_block_host_order (MD4_CTX *c, const void *p,int num); | 68 | void md4_block_host_order (MD4_CTX *c, const void *p,int num); |
| 69 | void md4_block_data_order (MD4_CTX *c, const void *p,int num); | 69 | void 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 |
| 64 | int main(int argc, char *argv[]) | 64 | int 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 | ||
| 72 | static char *test[]={ | 73 | static 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); |
