diff options
Diffstat (limited to 'src/lib/libcrypto/evp/m_md5.c')
| -rw-r--r-- | src/lib/libcrypto/evp/m_md5.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/lib/libcrypto/evp/m_md5.c b/src/lib/libcrypto/evp/m_md5.c index d65db9aa1d..b00a03e048 100644 --- a/src/lib/libcrypto/evp/m_md5.c +++ b/src/lib/libcrypto/evp/m_md5.c | |||
| @@ -56,26 +56,41 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef OPENSSL_NO_MD5 | ||
| 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> |
| 65 | #include <openssl/md5.h> | ||
| 64 | 66 | ||
| 65 | static EVP_MD md5_md= | 67 | static int init(EVP_MD_CTX *ctx) |
| 68 | { return MD5_Init(ctx->md_data); } | ||
| 69 | |||
| 70 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
| 71 | { return MD5_Update(ctx->md_data,data,count); } | ||
| 72 | |||
| 73 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
| 74 | { return MD5_Final(md,ctx->md_data); } | ||
| 75 | |||
| 76 | static const EVP_MD md5_md= | ||
| 66 | { | 77 | { |
| 67 | NID_md5, | 78 | NID_md5, |
| 68 | NID_md5WithRSAEncryption, | 79 | NID_md5WithRSAEncryption, |
| 69 | MD5_DIGEST_LENGTH, | 80 | MD5_DIGEST_LENGTH, |
| 70 | MD5_Init, | 81 | 0, |
| 71 | MD5_Update, | 82 | init, |
| 72 | MD5_Final, | 83 | update, |
| 84 | final, | ||
| 85 | NULL, | ||
| 86 | NULL, | ||
| 73 | EVP_PKEY_RSA_method, | 87 | EVP_PKEY_RSA_method, |
| 74 | MD5_CBLOCK, | 88 | MD5_CBLOCK, |
| 75 | sizeof(EVP_MD *)+sizeof(MD5_CTX), | 89 | sizeof(EVP_MD *)+sizeof(MD5_CTX), |
| 76 | }; | 90 | }; |
| 77 | 91 | ||
| 78 | EVP_MD *EVP_md5() | 92 | const EVP_MD *EVP_md5(void) |
| 79 | { | 93 | { |
| 80 | return(&md5_md); | 94 | return(&md5_md); |
| 81 | } | 95 | } |
| 96 | #endif | ||
