diff options
author | markus <> | 2002-09-05 12:51:52 +0000 |
---|---|---|
committer | markus <> | 2002-09-05 12:51:52 +0000 |
commit | 5514995a9d5ed91db089875adb509c7781357c0e (patch) | |
tree | 2484410a46ba6c05ef94c253da36fbceef990b64 /src/lib/libcrypto/evp/m_sha.c | |
parent | fd9566423b542798f5c8b06e68101a9ea5bb9885 (diff) | |
download | openbsd-5514995a9d5ed91db089875adb509c7781357c0e.tar.gz openbsd-5514995a9d5ed91db089875adb509c7781357c0e.tar.bz2 openbsd-5514995a9d5ed91db089875adb509c7781357c0e.zip |
import openssl-0.9.7-beta1
Diffstat (limited to 'src/lib/libcrypto/evp/m_sha.c')
-rw-r--r-- | src/lib/libcrypto/evp/m_sha.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/lib/libcrypto/evp/m_sha.c b/src/lib/libcrypto/evp/m_sha.c index af4e434a22..10697c7ed3 100644 --- a/src/lib/libcrypto/evp/m_sha.c +++ b/src/lib/libcrypto/evp/m_sha.c | |||
@@ -56,27 +56,40 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef OPENSSL_NO_SHA | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | #include "x509.h" | 64 | #include <openssl/x509.h> |
64 | 65 | ||
65 | static EVP_MD sha_md= | 66 | static int init(EVP_MD_CTX *ctx) |
67 | { return SHA_Init(ctx->md_data); } | ||
68 | |||
69 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
70 | { return SHA_Update(ctx->md_data,data,count); } | ||
71 | |||
72 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
73 | { return SHA_Final(md,ctx->md_data); } | ||
74 | |||
75 | static const EVP_MD sha_md= | ||
66 | { | 76 | { |
67 | NID_sha, | 77 | NID_sha, |
68 | NID_shaWithRSAEncryption, | 78 | NID_shaWithRSAEncryption, |
69 | SHA_DIGEST_LENGTH, | 79 | SHA_DIGEST_LENGTH, |
70 | SHA_Init, | 80 | 0, |
71 | SHA_Update, | 81 | init, |
72 | SHA_Final, | 82 | update, |
83 | final, | ||
84 | NULL, | ||
85 | NULL, | ||
73 | EVP_PKEY_RSA_method, | 86 | EVP_PKEY_RSA_method, |
74 | SHA_CBLOCK, | 87 | SHA_CBLOCK, |
75 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 88 | sizeof(EVP_MD *)+sizeof(SHA_CTX), |
76 | }; | 89 | }; |
77 | 90 | ||
78 | EVP_MD *EVP_sha() | 91 | const EVP_MD *EVP_sha(void) |
79 | { | 92 | { |
80 | return(&sha_md); | 93 | return(&sha_md); |
81 | } | 94 | } |
82 | 95 | #endif | |