X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fevp%2Fm_md2.c;h=1eae4ed38cb4e9d4dcefe63f87fed2f48d727520;hp=3281e91809f41f75fcaf6f00263dd898e1478838;hb=9c52d2cc75c2978dbee5075bfeed9968c68f403d;hpb=d02f751ce1d13183a0c0e5528ec89f76587ed989;ds=sidebyside diff --git a/crypto/evp/m_md2.c b/crypto/evp/m_md2.c index 3281e91809..1eae4ed38c 100644 --- a/crypto/evp/m_md2.c +++ b/crypto/evp/m_md2.c @@ -56,27 +56,43 @@ * [including the GNU Public Licence.] */ -#ifndef NO_MD2 #include #include "cryptlib.h" + +#ifndef OPENSSL_NO_MD2 + #include #include #include +#include +#include + +static int init(EVP_MD_CTX *ctx) + { return MD2_Init(ctx->md_data); } + +static int update(EVP_MD_CTX *ctx,const void *data,size_t count) + { return MD2_Update(ctx->md_data,data,count); } + +static int final(EVP_MD_CTX *ctx,unsigned char *md) + { return MD2_Final(md,ctx->md_data); } -static EVP_MD md2_md= +static const EVP_MD md2_md= { NID_md2, NID_md2WithRSAEncryption, MD2_DIGEST_LENGTH, - MD2_Init, - MD2_Update, - MD2_Final, + 0, + init, + update, + final, + NULL, + NULL, EVP_PKEY_RSA_method, MD2_BLOCK, sizeof(EVP_MD *)+sizeof(MD2_CTX), }; -EVP_MD *EVP_md2(void) +const EVP_MD *EVP_md2(void) { return(&md2_md); }