diff options
Diffstat (limited to 'src/lib/libcrypto/evp/m_dss1.c')
| -rw-r--r-- | src/lib/libcrypto/evp/m_dss1.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/lib/libcrypto/evp/m_dss1.c b/src/lib/libcrypto/evp/m_dss1.c index ff256b7b20..f5668ebda0 100644 --- a/src/lib/libcrypto/evp/m_dss1.c +++ b/src/lib/libcrypto/evp/m_dss1.c | |||
| @@ -56,26 +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 dss1_md= | 66 | static int init(EVP_MD_CTX *ctx) |
| 67 | { return SHA1_Init(ctx->md_data); } | ||
| 68 | |||
| 69 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
| 70 | { return SHA1_Update(ctx->md_data,data,count); } | ||
| 71 | |||
| 72 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
| 73 | { return SHA1_Final(md,ctx->md_data); } | ||
| 74 | |||
| 75 | static const EVP_MD dss1_md= | ||
| 66 | { | 76 | { |
| 67 | NID_dsa, | 77 | NID_dsa, |
| 68 | NID_dsaWithSHA1, | 78 | NID_dsaWithSHA1, |
| 69 | SHA_DIGEST_LENGTH, | 79 | SHA_DIGEST_LENGTH, |
| 70 | SHA1_Init, | 80 | 0, |
| 71 | SHA1_Update, | 81 | init, |
| 72 | SHA1_Final, | 82 | update, |
| 83 | final, | ||
| 84 | NULL, | ||
| 85 | NULL, | ||
| 73 | EVP_PKEY_DSA_method, | 86 | EVP_PKEY_DSA_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_dss1() | 91 | const EVP_MD *EVP_dss1(void) |
| 79 | { | 92 | { |
| 80 | return(&dss1_md); | 93 | return(&dss1_md); |
| 81 | } | 94 | } |
| 95 | #endif | ||
