From b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9 Mon Sep 17 00:00:00 2001 From: beck <> Date: Wed, 15 May 2002 02:29:21 +0000 Subject: OpenSSL 0.9.7 stable 2002 05 08 merge --- src/lib/libcrypto/evp/m_sha1.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/lib/libcrypto/evp/m_sha1.c') diff --git a/src/lib/libcrypto/evp/m_sha1.c b/src/lib/libcrypto/evp/m_sha1.c index 57a1ab0cce..d6be3502f0 100644 --- a/src/lib/libcrypto/evp/m_sha1.c +++ b/src/lib/libcrypto/evp/m_sha1.c @@ -56,27 +56,39 @@ * [including the GNU Public Licence.] */ -#ifndef NO_SHA +#ifndef OPENSSL_NO_SHA #include #include "cryptlib.h" #include #include #include -static EVP_MD sha1_md= +static int init(EVP_MD_CTX *ctx) + { return SHA1_Init(ctx->md_data); } + +static int update(EVP_MD_CTX *ctx,const void *data,unsigned long 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(void) +const EVP_MD *EVP_sha1(void) { return(&sha1_md); } -- cgit v1.2.3-55-g6feb