diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2002-05-15 02:29:22 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2002-05-15 02:29:22 +0000 |
commit | 4df88d25cb3419048d1bcf9740d37d4c459aef22 (patch) | |
tree | 97858aa44644bc9b64d1775a8bbccfb5baca24d3 /lib/libcrypto/evp/m_sha.c | |
parent | 998d0d156e423800e9a2fa1a482c0726f14201c2 (diff) |
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'lib/libcrypto/evp/m_sha.c')
-rw-r--r-- | lib/libcrypto/evp/m_sha.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/libcrypto/evp/m_sha.c b/lib/libcrypto/evp/m_sha.c index 6d35b71b850..10697c7ed38 100644 --- a/lib/libcrypto/evp/m_sha.c +++ b/lib/libcrypto/evp/m_sha.c @@ -56,27 +56,39 @@ * [including the GNU Public Licence.] */ -#ifndef NO_SHA +#ifndef OPENSSL_NO_SHA #include <stdio.h> #include "cryptlib.h" #include <openssl/evp.h> #include <openssl/objects.h> #include <openssl/x509.h> -static EVP_MD sha_md= +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(void) +const EVP_MD *EVP_sha(void) { return(&sha_md); } |