From: Dr. Stephen Henson Date: Thu, 14 Apr 2005 22:59:17 +0000 (+0000) Subject: Fix from HEAD. X-Git-Tag: BEN_FIPS_TEST_8~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8fc6cb77c50247b17d13353b65baea974c282691;p=openssl Fix from HEAD. --- diff --git a/crypto/md2/md2_one.c b/crypto/md2/md2_one.c index 835160ef56..8c36ba5779 100644 --- a/crypto/md2/md2_one.c +++ b/crypto/md2/md2_one.c @@ -69,7 +69,8 @@ unsigned char *MD2(const unsigned char *d, unsigned long 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 00565507e4..50f79352f6 100644 --- a/crypto/md4/md4_one.c +++ b/crypto/md4/md4_one.c @@ -71,7 +71,8 @@ unsigned char *MD4(const unsigned char *d, unsigned long 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 c5dd2d81db..44c6c455d1 100644 --- a/crypto/md5/md5_one.c +++ b/crypto/md5/md5_one.c @@ -71,7 +71,8 @@ unsigned char *MD5(const unsigned char *d, unsigned long 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 37f06c8d77..067a82a9b7 100644 --- a/crypto/mdc2/mdc2_one.c +++ b/crypto/mdc2/mdc2_one.c @@ -66,7 +66,8 @@ unsigned char *MDC2(const unsigned char *d, unsigned long 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 f8b580c33a..b88446b267 100644 --- a/crypto/ripemd/rmd_one.c +++ b/crypto/ripemd/rmd_one.c @@ -68,7 +68,8 @@ unsigned char *RIPEMD160(const unsigned char *d, unsigned long 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 20e660c71d..e6d225216f 100644 --- a/crypto/sha/sha1_one.c +++ b/crypto/sha/sha1_one.c @@ -68,7 +68,8 @@ unsigned char *SHA1(const unsigned char *d, unsigned long 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 e61c63f3e9..d4f4d344df 100644 --- a/crypto/sha/sha_one.c +++ b/crypto/sha/sha_one.c @@ -68,7 +68,8 @@ unsigned char *SHA(const unsigned char *d, unsigned long 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));