X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fevp%2Fm_sha1.c;h=7a791a6f71a548766b24400de957b548dd65dca1;hp=87135a9cf21d27204ff5cd397c4eb205c79febeb;hb=9e0aad9fd60635e240f7742fa1497eced6f1cd0b;hpb=58964a492275ca9a59a0cd9c8155cb2491b4b909 diff --git a/crypto/evp/m_sha1.c b/crypto/evp/m_sha1.c index 87135a9cf2..7a791a6f71 100644 --- a/crypto/evp/m_sha1.c +++ b/crypto/evp/m_sha1.c @@ -58,24 +58,41 @@ #include #include "cryptlib.h" -#include "evp.h" -#include "objects.h" -#include "x509.h" -static EVP_MD sha1_md= +#ifndef OPENSSL_NO_SHA + +#include +#include +#include +#include + +static int init(EVP_MD_CTX *ctx) + { return SHA1_Init(ctx->md_data); } + +static int update(EVP_MD_CTX *ctx,const void *data,size_t count) + { return SHA1_Update(ctx->md_data,data,count); } + +static int final(EVP_MD_CTX *ctx,unsigned char *md) + { return SHA1_Final(md,ctx->md_data); } + +static const EVP_MD sha1_md= { NID_sha1, NID_sha1WithRSAEncryption, SHA_DIGEST_LENGTH, - SHA1_Init, - SHA1_Update, - SHA1_Final, + 0, + init, + update, + final, + NULL, + NULL, EVP_PKEY_RSA_method, SHA_CBLOCK, sizeof(EVP_MD *)+sizeof(SHA_CTX), }; -EVP_MD *EVP_sha1() +const EVP_MD *EVP_sha1(void) { return(&sha1_md); } +#endif