RT2465: Silence some gcc warnings
[openssl.git] / crypto / mdc2 / mdc2_one.c
index 488ae39283463563146aacc27292ff2c2075c603..72647f67ede4ee05b5b11d261b22587f7ad296e7 100644 (file)
@@ -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
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "mdc2.h"
+#include <openssl/mdc2.h>
 
-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);
        }