mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-27 07:59:41 +08:00
Add compatiblity with older SSL versions
This commit is contained in:
1 parent
41d1fa8b00
commit
978f351560
3 files changed
+31
-10
No files matched your search
@@ -183,8 +183,10 @@ char *strNcpy(char *dest, const char *src, int n)
|
||||
return dest;
|
||||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
extern EVP_MD *md4_hash;
|
||||
extern EVP_MD *md5_hash;
|
||||
#endif
|
||||
|
||||
|
||||
void md5_calc(unsigned char *output, unsigned char *input,
|
||||
@@ -192,7 +194,11 @@ void md5_calc(unsigned char *output, unsigned char *input,
|
||||
{
|
||||
EVP_MD_CTX *ctx = EVP_MD_CTX_new();
|
||||
unsigned int len = 0;
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
EVP_DigestInit_ex(ctx, md5_hash, NULL);
|
||||
#else
|
||||
EVP_DigestInit_ex(ctx, EVP_md5(), NULL);
|
||||
#endif
|
||||
EVP_DigestUpdate(ctx, input, inlen);
|
||||
EVP_DigestFinal_ex(ctx, output, &len);
|
||||
EVP_MD_CTX_free(ctx);
|
||||
|
||||
Reference in new issue
Block a user