mirror of
https://github.com/3proxy/3proxy.git
synced 2026-05-13 13:30:12 +08:00
Do not use OSSL_LIB_CTX
This commit is contained in:
parent
8c638fcaff
commit
41d1fa8b00
@ -96,6 +96,7 @@ unsigned char * mycrypt(const unsigned char *pw, const unsigned char *salt, unsi
|
||||
unsigned long l;
|
||||
|
||||
#if defined(WITH_SSL)
|
||||
#ifndef WITHMAIN
|
||||
if(salt[0] == '$' && salt[1] == '1' && salt[2] == '$' && (ep = (unsigned char *)strchr((char *)salt+3, '$'))) {
|
||||
EVP_MD_CTX *ctx, *ctx1;
|
||||
unsigned int len;
|
||||
@ -183,6 +184,7 @@ unsigned char * mycrypt(const unsigned char *pw, const unsigned char *salt, unsi
|
||||
EVP_MD_CTX_free(ctx1);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
if(salt[0] == '$' && salt[1] == '3' && salt[2] == '$' && (ep = (unsigned char *)strchr((char *)salt+3, '$'))) {
|
||||
sp = salt +3;
|
||||
@ -229,7 +231,6 @@ unsigned char * mycrypt(const unsigned char *pw, const unsigned char *salt, unsi
|
||||
|
||||
#ifdef WITHMAIN
|
||||
#ifdef WITH_SSL
|
||||
OSSL_LIB_CTX *library_ctx = NULL;
|
||||
#include <openssl/provider.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
@ -256,17 +257,12 @@ int main(int argc, char* argv[]){
|
||||
return 1;
|
||||
}
|
||||
#ifdef WITH_SSL
|
||||
library_ctx = OSSL_LIB_CTX_new();
|
||||
OSSL_PROVIDER_load(library_ctx, "legacy");
|
||||
OSSL_PROVIDER_load(library_ctx, "default");
|
||||
md4_hash = EVP_MD_fetch(library_ctx, "MD4", NULL);
|
||||
OSSL_PROVIDER_load(NULL, "legacy");
|
||||
OSSL_PROVIDER_load(NULL, "default");
|
||||
md4_hash = EVP_MD_fetch(NULL, "MD4", NULL);
|
||||
if (md4_hash == NULL) {
|
||||
fprintf(stderr, "Error fetching MD4\n");
|
||||
}
|
||||
md5_hash = EVP_MD_fetch(library_ctx, "MD5", NULL);
|
||||
if (md5_hash == NULL) {
|
||||
fprintf(stderr, "Error fetching MD5\n");
|
||||
}
|
||||
#endif
|
||||
if(argc == 2) {
|
||||
#ifdef WITH_SSL
|
||||
|
||||
10
src/ssllib.c
10
src/ssllib.c
@ -278,7 +278,6 @@ int ssl_file_init = 0;
|
||||
|
||||
int ssl_init_done = 0;
|
||||
|
||||
OSSL_LIB_CTX *library_ctx = NULL;
|
||||
extern EVP_MD *md4_hash;
|
||||
extern EVP_MD *md5_hash;
|
||||
|
||||
@ -293,14 +292,13 @@ void ssl_init()
|
||||
SSL_load_error_strings();
|
||||
_3proxy_mutex_init(&ssl_file_mutex);
|
||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||
library_ctx = OSSL_LIB_CTX_new();
|
||||
OSSL_PROVIDER_load(library_ctx, "legacy");
|
||||
OSSL_PROVIDER_load(library_ctx, "default");
|
||||
md4_hash = EVP_MD_fetch(library_ctx, "MD4", NULL);
|
||||
OSSL_PROVIDER_load(NULL, "legacy");
|
||||
OSSL_PROVIDER_load(NULL, "default");
|
||||
md4_hash = EVP_MD_fetch(NULL, "MD4", NULL);
|
||||
if (md4_hash == NULL) {
|
||||
fprintf(stderr, "Error fetching MD4\n");
|
||||
}
|
||||
md5_hash = EVP_MD_fetch(library_ctx, "MD5", NULL);
|
||||
md5_hash = EVP_MD_fetch(NULL, "MD5", NULL);
|
||||
if (md5_hash == NULL) {
|
||||
fprintf(stderr, "Error fetching MD5\n");
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user