X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=crypto%2Fmdc2%2Fmdc2_one.c;h=72647f67ede4ee05b5b11d261b22587f7ad296e7;hb=cf8bac445660fca7a354f8cb78aeaac623afc12e;hp=488ae39283463563146aacc27292ff2c2075c603;hpb=d02b48c63a58ea4367a0e905979f140b7d090f86;p=openssl.git diff --git a/crypto/mdc2/mdc2_one.c b/crypto/mdc2/mdc2_one.c index 488ae39283..72647f67ed 100644 --- a/crypto/mdc2/mdc2_one.c +++ b/crypto/mdc2/mdc2_one.c @@ -1,5 +1,5 @@ /* crypto/mdc2/mdc2_one.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -58,21 +58,19 @@ #include #include "cryptlib.h" -#include "mdc2.h" +#include -unsigned char *MDC2(d, n, md) -unsigned char *d; -unsigned long n; -unsigned char *md; +unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md) { MDC2_CTX c; 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); - memset(&c,0,sizeof(c)); /* security consideration */ + OPENSSL_cleanse(&c,sizeof(c)); /* security consideration */ return(md); }