mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 14:40:56 +00:00
Fix build with OpenSSL versions prior to 1.1.0
This commit is contained in:
@@ -104,7 +104,11 @@ NvPairingManager::decrypt(const QByteArray& ciphertext, const QByteArray& key)
|
|||||||
QByteArray
|
QByteArray
|
||||||
NvPairingManager::getSignatureFromPemCert(const QByteArray& certificate)
|
NvPairingManager::getSignatureFromPemCert(const QByteArray& certificate)
|
||||||
{
|
{
|
||||||
|
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
|
||||||
|
BIO* bio = BIO_new_mem_buf(const_cast<char*>(certificate.data()), -1);
|
||||||
|
#else
|
||||||
BIO* bio = BIO_new_mem_buf(certificate.data(), -1);
|
BIO* bio = BIO_new_mem_buf(certificate.data(), -1);
|
||||||
|
#endif
|
||||||
THROW_BAD_ALLOC_IF_NULL(bio);
|
THROW_BAD_ALLOC_IF_NULL(bio);
|
||||||
|
|
||||||
X509* cert = PEM_read_bio_X509(bio, nullptr, nullptr, nullptr);
|
X509* cert = PEM_read_bio_X509(bio, nullptr, nullptr, nullptr);
|
||||||
@@ -130,7 +134,11 @@ NvPairingManager::getSignatureFromPemCert(const QByteArray& certificate)
|
|||||||
bool
|
bool
|
||||||
NvPairingManager::verifySignature(const QByteArray& data, const QByteArray& signature, const QByteArray& serverCertificate)
|
NvPairingManager::verifySignature(const QByteArray& data, const QByteArray& signature, const QByteArray& serverCertificate)
|
||||||
{
|
{
|
||||||
|
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
|
||||||
|
BIO* bio = BIO_new_mem_buf(const_cast<char*>(serverCertificate.data()), -1);
|
||||||
|
#else
|
||||||
BIO* bio = BIO_new_mem_buf(serverCertificate.data(), -1);
|
BIO* bio = BIO_new_mem_buf(serverCertificate.data(), -1);
|
||||||
|
#endif
|
||||||
THROW_BAD_ALLOC_IF_NULL(bio);
|
THROW_BAD_ALLOC_IF_NULL(bio);
|
||||||
|
|
||||||
X509* cert = PEM_read_bio_X509(bio, nullptr, nullptr, nullptr);
|
X509* cert = PEM_read_bio_X509(bio, nullptr, nullptr, nullptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user