diff options
author | markus <> | 2003-05-11 21:36:59 +0000 |
---|---|---|
committer | markus <> | 2003-05-11 21:36:59 +0000 |
commit | 9cea7b85baecb1a02a3ea617de73d9693a9792eb (patch) | |
tree | b0ca83a03e35572831c5818cd2011868d462a5d1 /src/lib/libcrypto/sha | |
parent | f8f1d7fabf136ce9810602509c477d2c42bf6d1c (diff) | |
download | openbsd-9cea7b85baecb1a02a3ea617de73d9693a9792eb.tar.gz openbsd-9cea7b85baecb1a02a3ea617de73d9693a9792eb.tar.bz2 openbsd-9cea7b85baecb1a02a3ea617de73d9693a9792eb.zip |
import 0.9.7b (without idea and rc5)
Diffstat (limited to 'src/lib/libcrypto/sha')
-rw-r--r-- | src/lib/libcrypto/sha/sha1test.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/sha/sha_one.c | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/sha/shatest.c | 4 |
3 files changed, 8 insertions, 3 deletions
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_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 | ||