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 | |
parent | 2b85e23d2e0c4f5c8ee1cc7d38fc42ce18e13f1c (diff) | |
download | openssl-new-fbe6ba81e97e6df79f0ff3417b370a21668f774d.tar.gz |
Check return values of <Digest>_Init functions in low level digest calls.
-rw-r--r-- | crypto/md2/md2_one.c | 3 | ||||
-rw-r--r-- | crypto/md4/md4_one.c | 3 | ||||
-rw-r--r-- | crypto/md5/md5_one.c | 3 | ||||
-rw-r--r-- | crypto/mdc2/mdc2_one.c | 3 | ||||
-rw-r--r-- | crypto/ripemd/rmd_one.c | 3 | ||||
-rw-r--r-- | crypto/sha/sha1_one.c | 3 | ||||
-rw-r--r-- | crypto/sha/sha_one.c | 3 |
7 files changed, 14 insertions, 7 deletions
diff --git a/crypto/md2/md2_one.c b/crypto/md2/md2_one.c index dab35071ac..f7fef5cc0a 100644 --- a/crypto/md2/md2_one.c +++ b/crypto/md2/md2_one.c @@ -69,7 +69,8 @@ unsigned char *MD2(const unsigned char *d, size_t n, unsigned char *md) static unsigned char m[MD2_DIGEST_LENGTH]; if (md == NULL) md=m; - MD2_Init(&c); + if (!MD2_Init(&c)) + return NULL; #ifndef CHARSET_EBCDIC MD2_Update(&c,d,n); #else diff --git a/crypto/md4/md4_one.c b/crypto/md4/md4_one.c index 64601b62df..bb64362638 100644 --- a/crypto/md4/md4_one.c +++ b/crypto/md4/md4_one.c @@ -71,7 +71,8 @@ unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md) static unsigned char m[MD4_DIGEST_LENGTH]; if (md == NULL) md=m; - MD4_Init(&c); + if (!MD4_Init(&c)) + return NULL; #ifndef CHARSET_EBCDIC MD4_Update(&c,d,n); #else diff --git a/crypto/md5/md5_one.c b/crypto/md5/md5_one.c index 9918243ea2..43fee89379 100644 --- a/crypto/md5/md5_one.c +++ b/crypto/md5/md5_one.c @@ -71,7 +71,8 @@ unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md) static unsigned char m[MD5_DIGEST_LENGTH]; if (md == NULL) md=m; - MD5_Init(&c); + if (!MD5_Init(&c)) + return NULL; #ifndef CHARSET_EBCDIC MD5_Update(&c,d,n); #else diff --git a/crypto/mdc2/mdc2_one.c b/crypto/mdc2/mdc2_one.c index cd569aa865..72647f67ed 100644 --- a/crypto/mdc2/mdc2_one.c +++ b/crypto/mdc2/mdc2_one.c @@ -66,7 +66,8 @@ unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md) static unsigned char m[MDC2_DIGEST_LENGTH]; if (md == NULL) md=m; - MDC2_Init(&c); + if (!MDC2_Init(&c)) + return NULL; MDC2_Update(&c,d,n); MDC2_Final(md,&c); OPENSSL_cleanse(&c,sizeof(c)); /* security consideration */ diff --git a/crypto/ripemd/rmd_one.c b/crypto/ripemd/rmd_one.c index bfc4d83fe0..3efb13758f 100644 --- a/crypto/ripemd/rmd_one.c +++ b/crypto/ripemd/rmd_one.c @@ -68,7 +68,8 @@ unsigned char *RIPEMD160(const unsigned char *d, size_t n, static unsigned char m[RIPEMD160_DIGEST_LENGTH]; if (md == NULL) md=m; - RIPEMD160_Init(&c); + if (!RIPEMD160_Init(&c)) + return NULL; RIPEMD160_Update(&c,d,n); RIPEMD160_Final(md,&c); OPENSSL_cleanse(&c,sizeof(c)); /* security consideration */ 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)); |