File xca-OpenSSL3-enable-legacy-provider.patch of Package xca.37307

From 9b749d799bfdc2db6ecde3e163477a3a3724cc41 Mon Sep 17 00:00:00 2001
From: Christian Hohnstaedt <christian@hohnstaedt.de>
Date: Wed, 27 Sep 2023 15:56:59 +0200
Subject: [PATCH] Close #460: Impossible to import PKCS#12 (RC40_CBC)

Unconditionally load the "legacy" provider to be able to
import legacy files like "pbeWithSHA1And40BitRC2-CBC"
encrypted PKCS#12
---
 lib/main.cpp |   11 +++++++++++
 1 file changed, 11 insertions(+)

--- lib/main.cpp
+++ lib/main.cpp
@@ -26,6 +26,10 @@
 #include <windows.h>
 #endif
 
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+#include <openssl/provider.h>
+#endif
+
 QLocale XCA_application::lang = QLocale::system();
 QFont XCA_application::tableFont;
 QList<QLocale> XCA_application::langAvail;
@@ -307,6 +311,13 @@ int main( int argc, char *argv[] )
 	qInstallMessageHandler(myMessageOutput);
 #endif
 
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+	if (OSSL_PROVIDER_try_load(0, "legacy", 1))
+		qDebug() << "Legacy provider loaded";
+	else
+		qWarning() << "Legacy provider NOT loaded";
+#endif
+
 	XCA_application a(argc, argv);
 
 	initOIDs();
openSUSE Build Service is sponsored by