Compare commits

..

No commits in common. "3a66c0a4c068fffcfc8ba63056fccc14318171d6" and "c893e866bd7d929013a4b86005da5ff534f42964" have entirely different histories.

2 changed files with 12 additions and 6 deletions

View File

@ -197,7 +197,6 @@ void hashadd(struct hashtable *ht, void* name, void* value, time_t expires){
if(!ht->ihashempty){ if(!ht->ihashempty){
hashgrow(ht); hashgrow(ht);
index = hashindex(ht, ht->tablesize, hash);
} }
if(ht->ihashempty){ if(ht->ihashempty){

View File

@ -20,6 +20,9 @@
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/err.h> #include <openssl/err.h>
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
#include <openssl/provider.h>
#endif
#include "proxy.h" #include "proxy.h"
#include "ssl.h" #include "ssl.h"
@ -105,18 +108,19 @@ SSL_CERT ssl_copy_cert(SSL_CERT cert, SSL_CONFIG *config)
EVP_PKEY *pk = NULL; EVP_PKEY *pk = NULL;
RSA *rsa = NULL; RSA *rsa = NULL;
unsigned char hash_sha256[32]; int hash_size = 20;
char hash_name_sha256[(16*2) + 1]; unsigned char hash_sha1[20];
char hash_name_sha1[(20*2) + 1];
char cache_name[256]; char cache_name[256];
err = X509_digest(src_cert, EVP_sha256(), hash_sha256, NULL); err = X509_digest(src_cert, EVP_sha1(), hash_sha1, NULL);
if(!err){ if(!err){
return NULL; return NULL;
} }
if(config->certcache){ if(config->certcache){
bin2hex(hash_sha256, 16, hash_name_sha256, sizeof(hash_name_sha256)); bin2hex(hash_sha1, 20, hash_name_sha1, sizeof(hash_name_sha1));
sprintf(cache_name, "%s%s.pem", config->certcache, hash_name_sha256); sprintf(cache_name, "%s%s.pem", config->certcache, hash_name_sha1);
/* check if certificate is already cached */ /* check if certificate is already cached */
fcache = BIO_new_file(cache_name, "rb"); fcache = BIO_new_file(cache_name, "rb");
if ( fcache != NULL ) { if ( fcache != NULL ) {
@ -286,5 +290,8 @@ void ssl_init()
SSL_load_error_strings(); SSL_load_error_strings();
_3proxy_mutex_init(&ssl_file_mutex); _3proxy_mutex_init(&ssl_file_mutex);
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
OSSL_PROVIDER_load(NULL, "default");
#endif
} }
} }