diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2005-04-14 22:58:44 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2005-04-14 22:58:44 +0000 |
commit | fbe6ba81e97e6df79f0ff3417b370a21668f774d (patch) | |
tree | dcf42dd313acf7144db057c14a117342808af051 /crypto/sha | |
parent | 2b85e23d2e0c4f5c8ee1cc7d38fc42ce18e13f1c (diff) |
Check return values of <Digest>_Init functions in low level digest calls.
Diffstat (limited to 'crypto/sha')
-rw-r--r-- | crypto/sha/sha1_one.c | 3 | ||||
-rw-r--r-- | crypto/sha/sha_one.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/crypto/sha/sha1_one.c b/crypto/sha/sha1_one.c index 582b25394c..7c65b60276 100644 --- a/crypto/sha/sha1_one.c +++ b/crypto/sha/sha1_one.c @@ -68,7 +68,8 @@ unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md) static unsigned char m[SHA_DIGEST_LENGTH]; if (md == NULL) md=m; - SHA1_Init(&c); + if (!SHA1_Init(&c)) + return NULL; SHA1_Update(&c,d,n); SHA1_Final(md,&c); OPENSSL_cleanse(&c,sizeof(c)); diff --git a/crypto/sha/sha_one.c b/crypto/sha/sha_one.c index 371ffddac6..3bae623ce8 100644 --- a/crypto/sha/sha_one.c +++ b/crypto/sha/sha_one.c @@ -68,7 +68,8 @@ unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md) static unsigned char m[SHA_DIGEST_LENGTH]; if (md == NULL) md=m; - SHA_Init(&c); + if (!SHA_Init(&c)) + return NULL; SHA_Update(&c,d,n); SHA_Final(md,&c); OPENSSL_cleanse(&c,sizeof(c)); |