packages/multimedia/crtmpserver/patches/100-openssl-deprecated.patch
Rosen Penev 80826d8b7b crtmpserver: Fix compilation without deprecated OpenSSL APIs
Switched to codeload to simplify the Makefile.

Removed the website as it is no longer valid.

Renamed .diff file to .patch

Added uclibc++ support. Fixed 060-add-missing-includes.patch , which was
totally wrong to begin with. C headers are generally not used with C++
programs.

Minor cleanups.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2018-12-26 18:01:10 -08:00

46 lines
1.4 KiB
Diff

--- a/sources/common/src/utils/misc/crypto.cpp
+++ b/sources/common/src/utils/misc/crypto.cpp
@@ -350,6 +350,7 @@ string unhex(string source) {
return result;
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
void CleanupSSL() {
ERR_remove_state(0);
ENGINE_cleanup();
@@ -358,3 +359,4 @@ void CleanupSSL() {
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
}
+#endif
--- a/sources/crtmpserver/src/crtmpserver.cpp
+++ b/sources/crtmpserver/src/crtmpserver.cpp
@@ -298,8 +298,10 @@ void Cleanup() {
delete gRs.pConfigFile;
gRs.pConfigFile = NULL;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
WARN("Doing final OpenSSL cleanup");
CleanupSSL();
+#endif
WARN("Shutting down the logger leaving you in the dark. Bye bye... :(");
Logger::Free(true);
--- a/sources/thelib/src/protocols/ssl/basesslprotocol.cpp
+++ b/sources/thelib/src/protocols/ssl/basesslprotocol.cpp
@@ -43,6 +43,7 @@ BaseSSLProtocol::~BaseSSLProtocol() {
bool BaseSSLProtocol::Initialize(Variant &parameters) {
//1. Initialize the SSL library
if (!_libraryInitialized) {
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
//3. This is the first time we use the library. So we have to
//initialize it first
SSL_library_init();
@@ -55,6 +56,7 @@ bool BaseSSLProtocol::Initialize(Variant &parameters) {
OpenSSL_add_all_algorithms();
OpenSSL_add_all_ciphers();
OpenSSL_add_all_digests();
+#endif
//initialize the random numbers generator
InitRandGenerator();