X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fevp%2Fm_md2.c;h=5ce849f161dde283fa899d4a4a02f3538e486d94;hb=c84029dbdc57edfb9c6cd94f3a730749adb0236a;hp=17c476c74099884aca6dfb500e067547e7769b61;hpb=cf1b7d96647d55e533f779e476e3d4371f40445a;p=oweals%2Fopenssl.git diff --git a/crypto/evp/m_md2.c b/crypto/evp/m_md2.c index 17c476c740..5ce849f161 100644 --- a/crypto/evp/m_md2.c +++ b/crypto/evp/m_md2.c @@ -56,27 +56,45 @@ * [including the GNU Public Licence.] */ -#ifndef OPENSSL_NO_MD2 #include #include "cryptlib.h" + +#ifndef OPENSSL_NO_MD2 + #include #include #include +#include +#ifndef OPENSSL_NO_RSA +#include +#endif + +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); }