diff options
Diffstat (limited to 'src/lib/libcrypto/evp/m_md2.c')
-rw-r--r-- | src/lib/libcrypto/evp/m_md2.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/lib/libcrypto/evp/m_md2.c b/src/lib/libcrypto/evp/m_md2.c index 3281e91809..50914c83b3 100644 --- a/src/lib/libcrypto/evp/m_md2.c +++ b/src/lib/libcrypto/evp/m_md2.c | |||
@@ -56,27 +56,40 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_MD2 | 59 | #ifndef OPENSSL_NO_MD2 |
60 | #include <stdio.h> | 60 | #include <stdio.h> |
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
65 | #include <openssl/md2.h> | ||
65 | 66 | ||
66 | static EVP_MD md2_md= | 67 | static int init(EVP_MD_CTX *ctx) |
68 | { return MD2_Init(ctx->md_data); } | ||
69 | |||
70 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
71 | { return MD2_Update(ctx->md_data,data,count); } | ||
72 | |||
73 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
74 | { return MD2_Final(md,ctx->md_data); } | ||
75 | |||
76 | static const EVP_MD md2_md= | ||
67 | { | 77 | { |
68 | NID_md2, | 78 | NID_md2, |
69 | NID_md2WithRSAEncryption, | 79 | NID_md2WithRSAEncryption, |
70 | MD2_DIGEST_LENGTH, | 80 | MD2_DIGEST_LENGTH, |
71 | MD2_Init, | 81 | 0, |
72 | MD2_Update, | 82 | init, |
73 | MD2_Final, | 83 | update, |
84 | final, | ||
85 | NULL, | ||
86 | NULL, | ||
74 | EVP_PKEY_RSA_method, | 87 | EVP_PKEY_RSA_method, |
75 | MD2_BLOCK, | 88 | MD2_BLOCK, |
76 | sizeof(EVP_MD *)+sizeof(MD2_CTX), | 89 | sizeof(EVP_MD *)+sizeof(MD2_CTX), |
77 | }; | 90 | }; |
78 | 91 | ||
79 | EVP_MD *EVP_md2(void) | 92 | const EVP_MD *EVP_md2(void) |
80 | { | 93 | { |
81 | return(&md2_md); | 94 | return(&md2_md); |
82 | } | 95 | } |