Synchronise the VMS build with the Unix one.
[oweals/openssl.git] / crypto / asn1 / a_digest.c
index 692d4d9f1d6cbca073dc87c07fcf153d36a723f3..8257b8639e12f3a6fd2ec8204a93e79f9e06e4fa 100644 (file)
 
 #include <stdio.h>
 #include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 
 #include "cryptlib.h"
+
+#ifndef NO_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
 #include <openssl/evp.h>
 #include <openssl/buffer.h>
+#include <openssl/x509.h>
 
-int ASN1_digest(int (*i2d)(), EVP_MD *type, char *data, unsigned char *md,
-            unsigned int *len)
+int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
+               unsigned char *md, unsigned int *len)
        {
        EVP_MD_CTX ctx;
        int i;
        unsigned char *str,*p;
 
        i=i2d(data,NULL);
-       if ((str=(unsigned char *)Malloc(i)) == NULL) return(0);
+       if ((str=(unsigned char *)OPENSSL_malloc(i)) == NULL) return(0);
        p=str;
        i2d(data,&p);
 
        EVP_DigestInit(&ctx,type);
        EVP_DigestUpdate(&ctx,str,i);
        EVP_DigestFinal(&ctx,md,len);
-       Free(str);
+       OPENSSL_free(str);
        return(1);
        }