Remove use of deprecated functions in OpenSSL 4.1

This commit is contained in:
Cameron Gutman committed 2026-10-29 00:55:58 -05:00
1 parent ac296864ac
commit 3178022887
2 files changed
+25 -4

No files matched your search

+4 -3
View File
@@ -164,10 +164,11 @@ QSslKey
IdentityManager::getSslKey()
{
if (m_CachedSslKey.isNull()) {
// This seemingly useless const_cast is required for old OpenSSL headers
// where BIO_new_mem_buf's parameter is not declared const like those on
// the Steam Link hardware.
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
BIO* bio = BIO_new_mem_buf(const_cast<char*>(m_CachedPrivateKey.constData()), -1);
#else
BIO* bio = BIO_new_mem_buf(m_CachedPrivateKey.constData(), -1);
#endif
THROW_BAD_ALLOC_IF_NULL(bio);
EVP_PKEY* pk = PEM_read_bio_PrivateKey(bio, nullptr, nullptr, nullptr);