From 195e831c9fbb32934ae497f18de75d6cd1398b8c Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Thu, 20 Jan 2022 10:28:27 -0500
Subject: [PATCH] Remove support for old RC4 encrypted password storage as
 OpenSSL 3.x has removed support

---
 indra/newview/llsechandler_basic.cpp            | 7 +++++++
 indra/newview/tests/llsechandler_basic_test.cpp | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp
index 8f610415923..5528aa073d1 100644
--- a/indra/newview/llsechandler_basic.cpp
+++ b/indra/newview/llsechandler_basic.cpp
@@ -1356,6 +1356,7 @@ LLSecAPIBasicHandler::~LLSecAPIBasicHandler()
 	_writeProtectedData();
 }
 
+#if LEGACY_PASSWORD_STORAGE
 // compat_rc4 reads old rc4 encrypted files
 void compat_rc4(llifstream &protected_data_stream, std::string &decrypted_data)
 {
@@ -1394,6 +1395,7 @@ void compat_rc4(llifstream &protected_data_stream, std::string &decrypted_data)
 
 	EVP_CIPHER_CTX_free(ctx);
 }
+#endif
 
 void LLSecAPIBasicHandler::_readProtectedData(unsigned char *unique_id, U32 id_len)
 {
@@ -1452,6 +1454,7 @@ void LLSecAPIBasicHandler::_readProtectedData(unsigned char *unique_id, U32 id_l
 		if (parser->parse(parse_stream, mProtectedDataMap, 
 						  LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
 		{
+#if LEGACY_PASSWORD_STORAGE
 			// clear and reset to try compat
 			parser->reset();
 			decrypted_data.clear();
@@ -1466,6 +1469,10 @@ void LLSecAPIBasicHandler::_readProtectedData(unsigned char *unique_id, U32 id_l
 				// everything failed abort
 				LLTHROW(LLProtectedDataException("Config file cannot be decrypted."));
 			}
+#else
+            // everything failed abort
+            LLTHROW(LLProtectedDataException("Config file cannot be decrypted."));
+#endif
 		}
 	}
 }
diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp
index 23f85d21fe5..91a14d54472 100644
--- a/indra/newview/tests/llsechandler_basic_test.cpp
+++ b/indra/newview/tests/llsechandler_basic_test.cpp
@@ -734,6 +734,8 @@ namespace tut
 	template<> template<>
 	void sechandler_basic_test_object::test<3>()
 	{
+        skip("Broken with openssl 3.0");
+
 		std::string protected_data = "sUSh3wj77NG9oAMyt3XIhaej3KLZhLZWFZvI6rIGmwUUOmmelrRg0NI9rkOj8ZDpTPxpwToaBT5u"
 		"GQhakdaGLJznr9bHr4/6HIC1bouKj4n2rs4TL6j2WSjto114QdlNfLsE8cbbE+ghww58g8SeyLQO"
 		"nyzXoz+/PBz0HD5SMFDuObccoPW24gmqYySz8YoEWhSwO0pUtEEqOjVRsAJgF5wLAtJZDeuilGsq"
@@ -849,6 +851,8 @@ namespace tut
 	template<> template<>
 	void sechandler_basic_test_object::test<4>()
 	{
+        skip("Broken with openssl 3.0");
+        
 		LLPointer<LLSecAPIBasicHandler> handler = new LLSecAPIBasicHandler("sechandler_settings.tmp", "test_password.dat");
 		handler->init();
 
-- 
GitLab