diff options
| author | markus <> | 2003-05-12 02:18:40 +0000 |
|---|---|---|
| committer | markus <> | 2003-05-12 02:18:40 +0000 |
| commit | d4fcd82bb7f6d603bd61e19a81ba97337b89dfca (patch) | |
| tree | d52e3a0f1f08f65ad283027e560e17ed0d720462 /src/lib/libcrypto/sha | |
| parent | 582bbd139cd2afd58d10dc051c5b0b989b441074 (diff) | |
| download | openbsd-d4fcd82bb7f6d603bd61e19a81ba97337b89dfca.tar.gz openbsd-d4fcd82bb7f6d603bd61e19a81ba97337b89dfca.tar.bz2 openbsd-d4fcd82bb7f6d603bd61e19a81ba97337b89dfca.zip | |
merge 0.9.7b with local changes; crank majors for libssl/libcrypto
Diffstat (limited to 'src/lib/libcrypto/sha')
| -rw-r--r-- | src/lib/libcrypto/sha/Makefile.ssl | 28 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha1_one.c | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha1test.c | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha_locl.h | 12 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha_one.c | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/shatest.c | 4 |
6 files changed, 30 insertions, 24 deletions
diff --git a/src/lib/libcrypto/sha/Makefile.ssl b/src/lib/libcrypto/sha/Makefile.ssl index 0aa678d6f4..d52fb62b4f 100644 --- a/src/lib/libcrypto/sha/Makefile.ssl +++ b/src/lib/libcrypto/sha/Makefile.ssl | |||
| @@ -47,14 +47,8 @@ lib: $(LIBOBJ) | |||
| 47 | @touch lib | 47 | @touch lib |
| 48 | 48 | ||
| 49 | # elf | 49 | # elf |
| 50 | asm/sx86-elf.o: asm/sx86unix.cpp | 50 | asm/sx86-elf.s: asm/sha1-586.pl ../perlasm/x86asm.pl |
| 51 | $(CPP) -DELF -x c asm/sx86unix.cpp | as -o asm/sx86-elf.o | 51 | (cd asm; $(PERL) sha1-586.pl elf $(CFLAGS) $(PROCESSOR) > sx86-elf.s) |
| 52 | |||
| 53 | # solaris | ||
| 54 | asm/sx86-sol.o: asm/sx86unix.cpp | ||
| 55 | $(CC) -E -DSOL asm/sx86unix.cpp | sed 's/^#.*//' > asm/sx86-sol.s | ||
| 56 | as -o asm/sx86-sol.o asm/sx86-sol.s | ||
| 57 | rm -f asm/sx86-sol.s | ||
| 58 | 52 | ||
| 59 | # a.out | 53 | # a.out |
| 60 | asm/sx86-out.o: asm/sx86unix.cpp | 54 | asm/sx86-out.o: asm/sx86unix.cpp |
| @@ -92,24 +86,30 @@ lint: | |||
| 92 | lint -DLINT $(INCLUDES) $(SRC)>fluff | 86 | lint -DLINT $(INCLUDES) $(SRC)>fluff |
| 93 | 87 | ||
| 94 | depend: | 88 | depend: |
| 95 | $(MAKEDEPEND) $(CFLAG) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC) | 89 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) |
| 96 | 90 | ||
| 97 | dclean: | 91 | dclean: |
| 98 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | 92 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new |
| 99 | mv -f Makefile.new $(MAKEFILE) | 93 | mv -f Makefile.new $(MAKEFILE) |
| 100 | 94 | ||
| 101 | clean: | 95 | clean: |
| 102 | rm -f asm/sx86unix.cpp *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o | 96 | rm -f asm/sx86unix.cpp asm/*-elf.* *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o |
| 103 | 97 | ||
| 104 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 98 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
| 105 | 99 | ||
| 106 | sha1_one.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 100 | sha1_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 107 | sha1_one.o: ../../include/openssl/sha.h sha1_one.c | 101 | sha1_one.o: ../../include/openssl/opensslconf.h |
| 102 | sha1_one.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
| 103 | sha1_one.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
| 104 | sha1_one.o: ../../include/openssl/symhacks.h sha1_one.c | ||
| 108 | sha1dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 105 | sha1dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h |
| 109 | sha1dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h | 106 | sha1dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h |
| 110 | sha1dgst.o: ../md32_common.h sha1dgst.c sha_locl.h | 107 | sha1dgst.o: ../md32_common.h sha1dgst.c sha_locl.h |
| 111 | sha_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 108 | sha_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h |
| 112 | sha_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h | 109 | sha_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h |
| 113 | sha_dgst.o: ../md32_common.h sha_dgst.c sha_locl.h | 110 | sha_dgst.o: ../md32_common.h sha_dgst.c sha_locl.h |
| 114 | sha_one.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 111 | sha_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 115 | sha_one.o: ../../include/openssl/sha.h sha_one.c | 112 | sha_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 113 | sha_one.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
| 114 | sha_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 115 | sha_one.o: sha_one.c | ||
diff --git a/src/lib/libcrypto/sha/sha1_one.c b/src/lib/libcrypto/sha/sha1_one.c index e6a24888ed..20e660c71d 100644 --- a/src/lib/libcrypto/sha/sha1_one.c +++ b/src/lib/libcrypto/sha/sha1_one.c | |||
| @@ -59,6 +59,7 @@ | |||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include <string.h> | 60 | #include <string.h> |
| 61 | #include <openssl/sha.h> | 61 | #include <openssl/sha.h> |
| 62 | #include <openssl/crypto.h> | ||
| 62 | 63 | ||
| 63 | #ifndef OPENSSL_NO_SHA1 | 64 | #ifndef OPENSSL_NO_SHA1 |
| 64 | unsigned char *SHA1(const unsigned char *d, unsigned long n, unsigned char *md) | 65 | unsigned char *SHA1(const unsigned char *d, unsigned long n, unsigned char *md) |
| @@ -70,7 +71,7 @@ unsigned char *SHA1(const unsigned char *d, unsigned long n, unsigned char *md) | |||
| 70 | SHA1_Init(&c); | 71 | SHA1_Init(&c); |
| 71 | SHA1_Update(&c,d,n); | 72 | SHA1_Update(&c,d,n); |
| 72 | SHA1_Final(md,&c); | 73 | SHA1_Final(md,&c); |
| 73 | memset(&c,0,sizeof(c)); | 74 | OPENSSL_cleanse(&c,sizeof(c)); |
| 74 | return(md); | 75 | return(md); |
| 75 | } | 76 | } |
| 76 | #endif | 77 | #endif |
diff --git a/src/lib/libcrypto/sha/sha1test.c b/src/lib/libcrypto/sha/sha1test.c index 499a1cf5af..4f2e4ada2d 100644 --- a/src/lib/libcrypto/sha/sha1test.c +++ b/src/lib/libcrypto/sha/sha1test.c | |||
| @@ -60,6 +60,8 @@ | |||
| 60 | #include <string.h> | 60 | #include <string.h> |
| 61 | #include <stdlib.h> | 61 | #include <stdlib.h> |
| 62 | 62 | ||
| 63 | #include "../e_os.h" | ||
| 64 | |||
| 63 | #ifdef OPENSSL_NO_SHA | 65 | #ifdef OPENSSL_NO_SHA |
| 64 | int main(int argc, char *argv[]) | 66 | int main(int argc, char *argv[]) |
| 65 | { | 67 | { |
| @@ -155,7 +157,7 @@ int main(int argc, char *argv[]) | |||
| 155 | } | 157 | } |
| 156 | else | 158 | else |
| 157 | printf("test 3 ok\n"); | 159 | printf("test 3 ok\n"); |
| 158 | exit(err); | 160 | EXIT(err); |
| 159 | EVP_MD_CTX_cleanup(&c); | 161 | EVP_MD_CTX_cleanup(&c); |
| 160 | return(0); | 162 | return(0); |
| 161 | } | 163 | } |
diff --git a/src/lib/libcrypto/sha/sha_locl.h b/src/lib/libcrypto/sha/sha_locl.h index 471dfb9f8f..2dd63a62a6 100644 --- a/src/lib/libcrypto/sha/sha_locl.h +++ b/src/lib/libcrypto/sha/sha_locl.h | |||
| @@ -224,10 +224,10 @@ int HASH_INIT (SHA_CTX *c) | |||
| 224 | void HASH_BLOCK_HOST_ORDER (SHA_CTX *c, const void *d, int num) | 224 | void HASH_BLOCK_HOST_ORDER (SHA_CTX *c, const void *d, int num) |
| 225 | { | 225 | { |
| 226 | const SHA_LONG *W=d; | 226 | const SHA_LONG *W=d; |
| 227 | register unsigned long A,B,C,D,E,T; | 227 | register unsigned MD32_REG_T A,B,C,D,E,T; |
| 228 | #ifndef MD32_XARRAY | 228 | #ifndef MD32_XARRAY |
| 229 | unsigned long XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, | 229 | unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, |
| 230 | XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15; | 230 | XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15; |
| 231 | #else | 231 | #else |
| 232 | SHA_LONG XX[16]; | 232 | SHA_LONG XX[16]; |
| 233 | #endif | 233 | #endif |
| @@ -349,10 +349,10 @@ void HASH_BLOCK_HOST_ORDER (SHA_CTX *c, const void *d, int num) | |||
| 349 | void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, int num) | 349 | void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, int num) |
| 350 | { | 350 | { |
| 351 | const unsigned char *data=p; | 351 | const unsigned char *data=p; |
| 352 | register unsigned long A,B,C,D,E,T,l; | 352 | register unsigned MD32_REG_T A,B,C,D,E,T,l; |
| 353 | #ifndef MD32_XARRAY | 353 | #ifndef MD32_XARRAY |
| 354 | unsigned long XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, | 354 | unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, |
| 355 | XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15; | 355 | XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15; |
| 356 | #else | 356 | #else |
| 357 | SHA_LONG XX[16]; | 357 | SHA_LONG XX[16]; |
| 358 | #endif | 358 | #endif |
diff --git a/src/lib/libcrypto/sha/sha_one.c b/src/lib/libcrypto/sha/sha_one.c index 5426faae4a..e61c63f3e9 100644 --- a/src/lib/libcrypto/sha/sha_one.c +++ b/src/lib/libcrypto/sha/sha_one.c | |||
| @@ -59,6 +59,7 @@ | |||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include <string.h> | 60 | #include <string.h> |
| 61 | #include <openssl/sha.h> | 61 | #include <openssl/sha.h> |
| 62 | #include <openssl/crypto.h> | ||
| 62 | 63 | ||
| 63 | #ifndef OPENSSL_NO_SHA0 | 64 | #ifndef OPENSSL_NO_SHA0 |
| 64 | unsigned char *SHA(const unsigned char *d, unsigned long n, unsigned char *md) | 65 | unsigned char *SHA(const unsigned char *d, unsigned long n, unsigned char *md) |
| @@ -70,7 +71,7 @@ unsigned char *SHA(const unsigned char *d, unsigned long n, unsigned char *md) | |||
| 70 | SHA_Init(&c); | 71 | SHA_Init(&c); |
| 71 | SHA_Update(&c,d,n); | 72 | SHA_Update(&c,d,n); |
| 72 | SHA_Final(md,&c); | 73 | SHA_Final(md,&c); |
| 73 | memset(&c,0,sizeof(c)); | 74 | OPENSSL_cleanse(&c,sizeof(c)); |
| 74 | return(md); | 75 | return(md); |
| 75 | } | 76 | } |
| 76 | #endif | 77 | #endif |
diff --git a/src/lib/libcrypto/sha/shatest.c b/src/lib/libcrypto/sha/shatest.c index 331294a74f..5d2b1d3b1a 100644 --- a/src/lib/libcrypto/sha/shatest.c +++ b/src/lib/libcrypto/sha/shatest.c | |||
| @@ -60,6 +60,8 @@ | |||
| 60 | #include <string.h> | 60 | #include <string.h> |
| 61 | #include <stdlib.h> | 61 | #include <stdlib.h> |
| 62 | 62 | ||
| 63 | #include "../e_os.h" | ||
| 64 | |||
| 63 | #ifdef OPENSSL_NO_SHA | 65 | #ifdef OPENSSL_NO_SHA |
| 64 | int main(int argc, char *argv[]) | 66 | int main(int argc, char *argv[]) |
| 65 | { | 67 | { |
| @@ -156,7 +158,7 @@ int main(int argc, char *argv[]) | |||
| 156 | else | 158 | else |
| 157 | printf("test 3 ok\n"); | 159 | printf("test 3 ok\n"); |
| 158 | EVP_MD_CTX_cleanup(&c); | 160 | EVP_MD_CTX_cleanup(&c); |
| 159 | exit(err); | 161 | EXIT(err); |
| 160 | return(0); | 162 | return(0); |
| 161 | } | 163 | } |
| 162 | 164 | ||
