#1601 Fixed compatibility with OpenSSL 1.0.x.

This commit is contained in:
XMRig 2020-03-22 05:58:59 +07:00
parent 1b875fdabb
commit 50eb7ba2fd
No known key found for this signature in database
GPG key ID: 446A53638BE94409
2 changed files with 15 additions and 1 deletions

View file

@ -34,6 +34,20 @@
#include <openssl/err.h>
// https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes#Compatibility_Layer
#if OPENSSL_VERSION_NUMBER < 0x10100000L
int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g)
{
assert(q == nullptr);
dh->p = p;
dh->g = g;
return 1;
}
#endif
namespace xmrig {

View file

@ -110,7 +110,7 @@ bool xmrig::TlsGen::generate_x509(const char *commonName)
X509_gmtime_adj(X509_get_notAfter(m_x509), 315360000L);
auto name = X509_get_subject_name(m_x509);
X509_NAME_add_entry_by_NID(name, NID_commonName, MBSTRING_ASC, reinterpret_cast<const uint8_t *>(commonName), -1, -1, 0);
X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, reinterpret_cast<const uint8_t *>(commonName), -1, -1, 0);
X509_set_issuer_name(m_x509, name);