X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fevp%2Fm_sha.c;h=a3343bb2eb8e87847089b0417429278f15bd28e3;hp=42309ebc4648cc1ac4d5f6a21e9eb07e06801e61;hb=27545970134d703ed96027aac9b67eced124eec3;hpb=135883505078a868349e0a3c24514099e3cb2dac diff --git a/crypto/evp/m_sha.c b/crypto/evp/m_sha.c index 42309ebc46..a3343bb2eb 100644 --- a/crypto/evp/m_sha.c +++ b/crypto/evp/m_sha.c @@ -56,21 +56,35 @@ * [including the GNU Public Licence.] */ -#ifndef OPENSSL_NO_SHA #include #include "cryptlib.h" + +#ifndef OPENSSL_NO_SHA + #include #include #include +static int init(EVP_MD_CTX *ctx) + { return SHA_Init(ctx->md_data); } + +static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) + { return SHA_Update(ctx->md_data,data,count); } + +static int final(EVP_MD_CTX *ctx,unsigned char *md) + { return SHA_Final(md,ctx->md_data); } + static const EVP_MD sha_md= { NID_sha, NID_shaWithRSAEncryption, SHA_DIGEST_LENGTH, - SHA_Init, - SHA_Update, - SHA_Final, + 0, + init, + update, + final, + NULL, + NULL, EVP_PKEY_RSA_method, SHA_CBLOCK, sizeof(EVP_MD *)+sizeof(SHA_CTX),