diff options
Diffstat (limited to 'src/lib/libcrypto/sha')
| -rw-r--r-- | src/lib/libcrypto/sha/Makefile | 75 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha_dgst.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/shatest.c | 4 |
3 files changed, 39 insertions, 46 deletions
diff --git a/src/lib/libcrypto/sha/Makefile b/src/lib/libcrypto/sha/Makefile index f4741b9ee6..e6eccb05f9 100644 --- a/src/lib/libcrypto/sha/Makefile +++ b/src/lib/libcrypto/sha/Makefile | |||
| @@ -38,25 +38,16 @@ top: | |||
| 38 | all: lib | 38 | all: lib |
| 39 | 39 | ||
| 40 | lib: $(LIBOBJ) | 40 | lib: $(LIBOBJ) |
| 41 | $(ARX) $(LIB) $(LIBOBJ) | 41 | $(AR) $(LIB) $(LIBOBJ) |
| 42 | $(RANLIB) $(LIB) || echo Never mind. | 42 | $(RANLIB) $(LIB) || echo Never mind. |
| 43 | @touch lib | 43 | @touch lib |
| 44 | 44 | ||
| 45 | # ELF | 45 | sha1-586.s: asm/sha1-586.pl ../perlasm/x86asm.pl |
| 46 | sx86-elf.s: asm/sha1-586.pl ../perlasm/x86asm.pl | 46 | $(PERL) asm/sha1-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ |
| 47 | (cd asm; $(PERL) sha1-586.pl elf $(CFLAGS) $(PROCESSOR) > ../$@) | 47 | sha256-586.s: asm/sha256-586.pl ../perlasm/x86asm.pl |
| 48 | s512sse2-elf.s: asm/sha512-sse2.pl ../perlasm/x86asm.pl | 48 | $(PERL) asm/sha256-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ |
| 49 | (cd asm; $(PERL) sha512-sse2.pl elf $(CFLAGS) $(PROCESSOR) > ../$@) | 49 | sha512-586.s: asm/sha512-586.pl ../perlasm/x86asm.pl |
| 50 | # COFF | 50 | $(PERL) asm/sha512-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ |
| 51 | sx86-cof.s: asm/sha1-586.pl ../perlasm/x86asm.pl | ||
| 52 | (cd asm; $(PERL) sha1-586.pl coff $(CFLAGS) $(PROCESSOR) > ../$@) | ||
| 53 | s512sse2-cof.s: asm/sha512-sse2.pl ../perlasm/x86asm.pl | ||
| 54 | (cd asm; $(PERL) sha512-sse2.pl coff $(CFLAGS) $(PROCESSOR) > ../$@) | ||
| 55 | # a.out | ||
| 56 | sx86-out.s: asm/sha1-586.pl ../perlasm/x86asm.pl | ||
| 57 | (cd asm; $(PERL) sha1-586.pl a.out $(CFLAGS) $(PROCESSOR) > ../$@) | ||
| 58 | s512sse2-out.s: asm/sha512-sse2.pl ../perlasm/x86asm.pl | ||
| 59 | (cd asm; $(PERL) sha512-sse2.pl a.out $(CFLAGS) $(PROCESSOR) > ../$@) | ||
| 60 | 51 | ||
| 61 | sha1-ia64.s: asm/sha1-ia64.pl | 52 | sha1-ia64.s: asm/sha1-ia64.pl |
| 62 | (cd asm; $(PERL) sha1-ia64.pl ../$@ $(CFLAGS)) | 53 | (cd asm; $(PERL) sha1-ia64.pl ../$@ $(CFLAGS)) |
| @@ -65,10 +56,25 @@ sha256-ia64.s: asm/sha512-ia64.pl | |||
| 65 | sha512-ia64.s: asm/sha512-ia64.pl | 56 | sha512-ia64.s: asm/sha512-ia64.pl |
| 66 | (cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS)) | 57 | (cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS)) |
| 67 | 58 | ||
| 59 | sha256-armv4.s: asm/sha256-armv4.pl | ||
| 60 | $(PERL) $< $@ | ||
| 61 | |||
| 68 | # Solaris make has to be explicitly told | 62 | # Solaris make has to be explicitly told |
| 69 | sha1-x86_64.s: asm/sha1-x86_64.pl; $(PERL) asm/sha1-x86_64.pl $@ | 63 | sha1-x86_64.s: asm/sha1-x86_64.pl; $(PERL) asm/sha1-x86_64.pl $(PERLASM_SCHEME) > $@ |
| 70 | sha256-x86_64.s:asm/sha512-x86_64.pl; $(PERL) asm/sha512-x86_64.pl $@ | 64 | sha256-x86_64.s:asm/sha512-x86_64.pl; $(PERL) asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@ |
| 71 | sha512-x86_64.s:asm/sha512-x86_64.pl; $(PERL) asm/sha512-x86_64.pl $@ | 65 | sha512-x86_64.s:asm/sha512-x86_64.pl; $(PERL) asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@ |
| 66 | sha1-sparcv9.s: asm/sha1-sparcv9.pl; $(PERL) asm/sha1-sparcv9.pl $@ $(CFLAGS) | ||
| 67 | sha256-sparcv9.s:asm/sha512-sparcv9.pl; $(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS) | ||
| 68 | sha512-sparcv9.s:asm/sha512-sparcv9.pl; $(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS) | ||
| 69 | |||
| 70 | sha1-ppc.s: asm/sha1-ppc.pl; $(PERL) asm/sha1-ppc.pl $(PERLASM_SCHEME) $@ | ||
| 71 | sha256-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@ | ||
| 72 | sha512-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@ | ||
| 73 | |||
| 74 | # GNU make "catch all" | ||
| 75 | sha1-%.s: asm/sha1-%.pl; $(PERL) $< $@ | ||
| 76 | sha256-%.s: asm/sha512-%.pl; $(PERL) $< $@ | ||
| 77 | sha512-%.s: asm/sha512-%.pl; $(PERL) $< $@ | ||
| 72 | 78 | ||
| 73 | files: | 79 | files: |
| 74 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | 80 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO |
| @@ -113,31 +119,24 @@ sha1_one.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
| 113 | sha1_one.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 119 | sha1_one.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 114 | sha1_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 120 | sha1_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 115 | sha1_one.o: sha1_one.c | 121 | sha1_one.o: sha1_one.c |
| 116 | sha1dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/fips.h | 122 | sha1dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h |
| 117 | sha1dgst.o: ../../include/openssl/opensslconf.h | ||
| 118 | sha1dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h | 123 | sha1dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h |
| 119 | sha1dgst.o: ../md32_common.h sha1dgst.c sha_locl.h | 124 | sha1dgst.o: ../md32_common.h sha1dgst.c sha_locl.h |
| 120 | sha256.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 125 | sha256.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 121 | sha256.o: ../../include/openssl/fips.h ../../include/openssl/opensslconf.h | 126 | sha256.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 122 | sha256.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 127 | sha256.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
| 123 | sha256.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 128 | sha256.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 124 | sha256.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 129 | sha256.o: ../../include/openssl/symhacks.h ../md32_common.h sha256.c |
| 125 | sha256.o: ../md32_common.h sha256.c | ||
| 126 | sha512.o: ../../e_os.h ../../include/openssl/bio.h | 130 | sha512.o: ../../e_os.h ../../include/openssl/bio.h |
| 127 | sha512.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 131 | sha512.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 128 | sha512.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 132 | sha512.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 129 | sha512.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h | 133 | sha512.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
| 130 | sha512.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 134 | sha512.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 131 | sha512.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | 135 | sha512.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 132 | sha512.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 136 | sha512.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 133 | sha512.o: ../../include/openssl/symhacks.h ../cryptlib.h sha512.c | 137 | sha512.o: ../cryptlib.h sha512.c |
| 134 | sha_dgst.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h | 138 | sha_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h |
| 135 | sha_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 139 | sha_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h |
| 136 | sha_dgst.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h | ||
| 137 | sha_dgst.o: ../../include/openssl/opensslconf.h | ||
| 138 | sha_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
| 139 | sha_dgst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
| 140 | sha_dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 141 | sha_dgst.o: ../md32_common.h sha_dgst.c sha_locl.h | 140 | sha_dgst.o: ../md32_common.h sha_dgst.c sha_locl.h |
| 142 | sha_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 141 | sha_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 143 | sha_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 142 | sha_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
diff --git a/src/lib/libcrypto/sha/sha_dgst.c b/src/lib/libcrypto/sha/sha_dgst.c index 598f4d721a..70eb56032c 100644 --- a/src/lib/libcrypto/sha/sha_dgst.c +++ b/src/lib/libcrypto/sha/sha_dgst.c | |||
| @@ -57,12 +57,6 @@ | |||
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #include <openssl/opensslconf.h> | 59 | #include <openssl/opensslconf.h> |
| 60 | #include <openssl/crypto.h> | ||
| 61 | #ifdef OPENSSL_FIPS | ||
| 62 | #include <openssl/fips.h> | ||
| 63 | #endif | ||
| 64 | |||
| 65 | #include <openssl/err.h> | ||
| 66 | #if !defined(OPENSSL_NO_SHA0) && !defined(OPENSSL_NO_SHA) | 60 | #if !defined(OPENSSL_NO_SHA0) && !defined(OPENSSL_NO_SHA) |
| 67 | 61 | ||
| 68 | #undef SHA_1 | 62 | #undef SHA_1 |
diff --git a/src/lib/libcrypto/sha/shatest.c b/src/lib/libcrypto/sha/shatest.c index ed0fe06a7b..27614646d1 100644 --- a/src/lib/libcrypto/sha/shatest.c +++ b/src/lib/libcrypto/sha/shatest.c | |||
| @@ -123,9 +123,9 @@ int main(int argc, char *argv[]) | |||
| 123 | i=1; | 123 | i=1; |
| 124 | while (*P != NULL) | 124 | while (*P != NULL) |
| 125 | { | 125 | { |
| 126 | EVP_Digest(*P,strlen((char *)*P),md,NULL,EVP_sha(), NULL); | 126 | EVP_Digest(*P,strlen(*P),md,NULL,EVP_sha(), NULL); |
| 127 | p=pt(md); | 127 | p=pt(md); |
| 128 | if (strcmp(p,(char *)*R) != 0) | 128 | if (strcmp(p,*R) != 0) |
| 129 | { | 129 | { |
| 130 | printf("error calculating SHA on '%s'\n",*P); | 130 | printf("error calculating SHA on '%s'\n",*P); |
| 131 | printf("got %s instead of %s\n",p,*R); | 131 | printf("got %s instead of %s\n",p,*R); |
