diff options
| author | djm <> | 2006-06-27 05:05:42 +0000 |
|---|---|---|
| committer | djm <> | 2006-06-27 05:05:42 +0000 |
| commit | f6198d4d0ab97685dc56be2d48715ed39fcc74b9 (patch) | |
| tree | 6e28360095ed5ba5ef1760a419c43eef4ef6946b /src/lib/libcrypto/sha | |
| parent | 0ff0f9d99c40072de315264b0f602bd639e7f662 (diff) | |
| download | openbsd-f6198d4d0ab97685dc56be2d48715ed39fcc74b9.tar.gz openbsd-f6198d4d0ab97685dc56be2d48715ed39fcc74b9.tar.bz2 openbsd-f6198d4d0ab97685dc56be2d48715ed39fcc74b9.zip | |
import of openssl-0.9.7j
Diffstat (limited to 'src/lib/libcrypto/sha')
| -rw-r--r-- | src/lib/libcrypto/sha/sha1_one.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/sha/sha1_one.c b/src/lib/libcrypto/sha/sha1_one.c index 20e660c71d..f4694b701b 100644 --- a/src/lib/libcrypto/sha/sha1_one.c +++ b/src/lib/libcrypto/sha/sha1_one.c | |||
| @@ -61,14 +61,15 @@ | |||
| 61 | #include <openssl/sha.h> | 61 | #include <openssl/sha.h> |
| 62 | #include <openssl/crypto.h> | 62 | #include <openssl/crypto.h> |
| 63 | 63 | ||
| 64 | #ifndef OPENSSL_NO_SHA1 | 64 | #if !defined(OPENSSL_NO_SHA1) && !defined(OPENSSL_FIPS) |
| 65 | 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) |
| 66 | { | 66 | { |
| 67 | SHA_CTX c; | 67 | SHA_CTX c; |
| 68 | static unsigned char m[SHA_DIGEST_LENGTH]; | 68 | static unsigned char m[SHA_DIGEST_LENGTH]; |
| 69 | 69 | ||
| 70 | if (md == NULL) md=m; | 70 | if (md == NULL) md=m; |
| 71 | SHA1_Init(&c); | 71 | if (!SHA1_Init(&c)) |
| 72 | return NULL; | ||
| 72 | SHA1_Update(&c,d,n); | 73 | SHA1_Update(&c,d,n); |
| 73 | SHA1_Final(md,&c); | 74 | SHA1_Final(md,&c); |
| 74 | OPENSSL_cleanse(&c,sizeof(c)); | 75 | OPENSSL_cleanse(&c,sizeof(c)); |
