X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fevp%2Fm_sha.c;h=a3343bb2eb8e87847089b0417429278f15bd28e3;hp=af4e434a2258348a672f0384a2f6f03f774c54e4;hb=69104cdf34462d4973e6bdddaf0ffb9cba041fb8;hpb=78414a6a897db42c9bcf06aa21c705811ab33921 diff --git a/crypto/evp/m_sha.c b/crypto/evp/m_sha.c index af4e434a22..a3343bb2eb 100644 --- a/crypto/evp/m_sha.c +++ b/crypto/evp/m_sha.c @@ -58,25 +58,40 @@ #include #include "cryptlib.h" -#include "evp.h" -#include "objects.h" -#include "x509.h" -static EVP_MD sha_md= +#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), }; -EVP_MD *EVP_sha() +const EVP_MD *EVP_sha(void) { return(&sha_md); } - +#endif