Skip to content

Commit

Permalink
Merge pull request #3961 from neheb/patch-1
Browse files Browse the repository at this point in the history
fix compilation without deprecated OpenSSL APIs
  • Loading branch information
ChristianBeer authored Dec 31, 2020
2 parents b6e54cb + 64d78ad commit f25e4d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/crypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <openssl/engine.h>
#include <openssl/err.h>
#include <openssl/rsa.h>
#include <openssl/bn.h>

#ifdef _USING_FCGI_
#include "boinc_fcgi.h"
Expand Down Expand Up @@ -713,8 +714,11 @@ char *check_validity(
int rbytes;
unsigned char md5_md[MD5_DIGEST_LENGTH], rbuf[2048];

// OpenSSL 1.1 does initialization internally. This is default.
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(HAVE_LIBRESSL)
SSL_load_error_strings();
SSL_library_init();
#endif

if (!is_file(origFile)) {
return NULL;
Expand Down Expand Up @@ -765,7 +769,10 @@ int cert_verify_file(
fflush(stdout);
return false;
}
// OpenSSL 1.1 does initialization internally. This is default.
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(HAVE_LIBRESSL)
SSL_library_init();
#endif
if (!is_file(origFile)) return false;
FILE* of = boinc_fopen(origFile, "r");
if (!of) return false;
Expand Down

0 comments on commit f25e4d7

Please sign in to comment.