diff options
Diffstat (limited to 'src/lib/libcrypto/md2')
| -rw-r--r-- | src/lib/libcrypto/md2/Makefile.ssl | 93 | ||||
| -rw-r--r-- | src/lib/libcrypto/md2/md2.h | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/md2/md2_dgst.c | 9 |
3 files changed, 103 insertions, 2 deletions
diff --git a/src/lib/libcrypto/md2/Makefile.ssl b/src/lib/libcrypto/md2/Makefile.ssl new file mode 100644 index 0000000000..3206924c90 --- /dev/null +++ b/src/lib/libcrypto/md2/Makefile.ssl | |||
| @@ -0,0 +1,93 @@ | |||
| 1 | # | ||
| 2 | # SSLeay/crypto/md/Makefile | ||
| 3 | # | ||
| 4 | |||
| 5 | DIR= md2 | ||
| 6 | TOP= ../.. | ||
| 7 | CC= cc | ||
| 8 | INCLUDES= | ||
| 9 | CFLAG=-g | ||
| 10 | INSTALL_PREFIX= | ||
| 11 | OPENSSLDIR= /usr/local/ssl | ||
| 12 | INSTALLTOP=/usr/local/ssl | ||
| 13 | MAKE= make -f Makefile.ssl | ||
| 14 | MAKEDEPPROG= makedepend | ||
| 15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
| 16 | MAKEFILE= Makefile.ssl | ||
| 17 | AR= ar r | ||
| 18 | |||
| 19 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
| 20 | |||
| 21 | GENERAL=Makefile | ||
| 22 | TEST=md2test.c | ||
| 23 | APPS= | ||
| 24 | |||
| 25 | LIB=$(TOP)/libcrypto.a | ||
| 26 | LIBSRC=md2_dgst.c md2_one.c | ||
| 27 | LIBOBJ=md2_dgst.o md2_one.o | ||
| 28 | |||
| 29 | SRC= $(LIBSRC) | ||
| 30 | |||
| 31 | EXHEADER= md2.h | ||
| 32 | HEADER= $(EXHEADER) | ||
| 33 | |||
| 34 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
| 35 | |||
| 36 | top: | ||
| 37 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) | ||
| 38 | |||
| 39 | all: lib | ||
| 40 | |||
| 41 | lib: $(LIBOBJ) | ||
| 42 | $(AR) $(LIB) $(LIBOBJ) | ||
| 43 | $(RANLIB) $(LIB) || echo Never mind. | ||
| 44 | @touch lib | ||
| 45 | |||
| 46 | files: | ||
| 47 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | ||
| 48 | |||
| 49 | links: | ||
| 50 | @sh $(TOP)/util/point.sh Makefile.ssl Makefile | ||
| 51 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) | ||
| 52 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) | ||
| 53 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) | ||
| 54 | |||
| 55 | install: | ||
| 56 | @for i in $(EXHEADER) ; \ | ||
| 57 | do \ | ||
| 58 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | ||
| 59 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | ||
| 60 | done; | ||
| 61 | |||
| 62 | tags: | ||
| 63 | ctags $(SRC) | ||
| 64 | |||
| 65 | tests: | ||
| 66 | |||
| 67 | lint: | ||
| 68 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
| 69 | |||
| 70 | depend: | ||
| 71 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) | ||
| 72 | |||
| 73 | dclean: | ||
| 74 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
| 75 | mv -f Makefile.new $(MAKEFILE) | ||
| 76 | |||
| 77 | clean: | ||
| 78 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
| 79 | |||
| 80 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
| 81 | |||
| 82 | md2_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
| 83 | md2_dgst.o: ../../include/openssl/md2.h ../../include/openssl/opensslconf.h | ||
| 84 | md2_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
| 85 | md2_dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 86 | md2_dgst.o: md2_dgst.c | ||
| 87 | md2_one.o: ../../e_os.h ../../include/openssl/bio.h | ||
| 88 | md2_one.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
| 89 | md2_one.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
| 90 | md2_one.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
| 91 | md2_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 92 | md2_one.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
| 93 | md2_one.o: ../../include/openssl/symhacks.h ../cryptlib.h md2_one.c | ||
diff --git a/src/lib/libcrypto/md2/md2.h b/src/lib/libcrypto/md2/md2.h index a46120e7d4..d59c9f2593 100644 --- a/src/lib/libcrypto/md2/md2.h +++ b/src/lib/libcrypto/md2/md2.h | |||
| @@ -81,6 +81,9 @@ typedef struct MD2state_st | |||
| 81 | } MD2_CTX; | 81 | } MD2_CTX; |
| 82 | 82 | ||
| 83 | const char *MD2_options(void); | 83 | const char *MD2_options(void); |
| 84 | #ifdef OPENSSL_FIPS | ||
| 85 | int private_MD2_Init(MD2_CTX *c); | ||
| 86 | #endif | ||
| 84 | int MD2_Init(MD2_CTX *c); | 87 | int MD2_Init(MD2_CTX *c); |
| 85 | int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); | 88 | int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); |
| 86 | int MD2_Final(unsigned char *md, MD2_CTX *c); | 89 | int MD2_Final(unsigned char *md, MD2_CTX *c); |
diff --git a/src/lib/libcrypto/md2/md2_dgst.c b/src/lib/libcrypto/md2/md2_dgst.c index c57b3da288..cc4eeaf7a7 100644 --- a/src/lib/libcrypto/md2/md2_dgst.c +++ b/src/lib/libcrypto/md2/md2_dgst.c | |||
| @@ -62,6 +62,11 @@ | |||
| 62 | #include <openssl/md2.h> | 62 | #include <openssl/md2.h> |
| 63 | #include <openssl/opensslv.h> | 63 | #include <openssl/opensslv.h> |
| 64 | #include <openssl/crypto.h> | 64 | #include <openssl/crypto.h> |
| 65 | #ifdef OPENSSL_FIPS | ||
| 66 | #include <openssl/fips.h> | ||
| 67 | #endif | ||
| 68 | |||
| 69 | #include <openssl/err.h> | ||
| 65 | 70 | ||
| 66 | const char MD2_version[]="MD2" OPENSSL_VERSION_PTEXT; | 71 | const char MD2_version[]="MD2" OPENSSL_VERSION_PTEXT; |
| 67 | 72 | ||
| @@ -73,7 +78,7 @@ const char MD2_version[]="MD2" OPENSSL_VERSION_PTEXT; | |||
| 73 | static void md2_block(MD2_CTX *c, const unsigned char *d); | 78 | static void md2_block(MD2_CTX *c, const unsigned char *d); |
| 74 | /* The magic S table - I have converted it to hex since it is | 79 | /* The magic S table - I have converted it to hex since it is |
| 75 | * basically just a random byte string. */ | 80 | * basically just a random byte string. */ |
| 76 | static const MD2_INT S[256]={ | 81 | static MD2_INT S[256]={ |
| 77 | 0x29, 0x2E, 0x43, 0xC9, 0xA2, 0xD8, 0x7C, 0x01, | 82 | 0x29, 0x2E, 0x43, 0xC9, 0xA2, 0xD8, 0x7C, 0x01, |
| 78 | 0x3D, 0x36, 0x54, 0xA1, 0xEC, 0xF0, 0x06, 0x13, | 83 | 0x3D, 0x36, 0x54, 0xA1, 0xEC, 0xF0, 0x06, 0x13, |
| 79 | 0x62, 0xA7, 0x05, 0xF3, 0xC0, 0xC7, 0x73, 0x8C, | 84 | 0x62, 0xA7, 0x05, 0xF3, 0xC0, 0xC7, 0x73, 0x8C, |
| @@ -116,7 +121,7 @@ const char *MD2_options(void) | |||
| 116 | return("md2(int)"); | 121 | return("md2(int)"); |
| 117 | } | 122 | } |
| 118 | 123 | ||
| 119 | int MD2_Init(MD2_CTX *c) | 124 | FIPS_NON_FIPS_MD_Init(MD2) |
| 120 | { | 125 | { |
| 121 | c->num=0; | 126 | c->num=0; |
| 122 | memset(c->state,0,sizeof c->state); | 127 | memset(c->state,0,sizeof c->state); |
