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
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
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
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 */
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 */
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));
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));