EXIT() needs to be in a function that returns int.
[openssl.git] / crypto / evp / m_ripemd.c
index 3d781a4e8df6dabea4dd1529e59981d39d8c7801..64725528dcc0492c8e04fd3e83ff9fd4d0330085 100644 (file)
@@ -56,7 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
-#ifndef NO_RIPEMD
+#ifndef OPENSSL_NO_RIPEMD
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/ripemd.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
 
-static EVP_MD ripemd160_md=
+static int init(EVP_MD_CTX *ctx)
+       { return RIPEMD160_Init(ctx->md_data); }
+
+static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count)
+       { return RIPEMD160_Update(ctx->md_data,data,count); }
+
+static int final(EVP_MD_CTX *ctx,unsigned char *md)
+       { return RIPEMD160_Final(md,ctx->md_data); }
+
+static const EVP_MD ripemd160_md=
        {
        NID_ripemd160,
        NID_ripemd160WithRSA,
        RIPEMD160_DIGEST_LENGTH,
-       RIPEMD160_Init,
-       RIPEMD160_Update,
-       RIPEMD160_Final,
+       0,
+       init,
+       update,
+       final,
+       NULL,
+       NULL,
        EVP_PKEY_RSA_method,
        RIPEMD160_CBLOCK,
        sizeof(EVP_MD *)+sizeof(RIPEMD160_CTX),
        };
 
-EVP_MD *EVP_ripemd160(void)
+const EVP_MD *EVP_ripemd160(void)
        {
        return(&ripemd160_md);
        }