645c54e10d
This is a prerequisite for LibreOffcie 7.5 update News: 1.2.37: Fixed two regressions from 1.2.36 release: issue #437 and issue #449. 1.2.36: Retired the XMLSec mailing list "xmlsec@aleksey.com" and the XMLSec Online Signature Verifier. Several other small fixes (more details). 1.3.25: Migration to OpenSSL 3.0 API (based on PR by @snargit). The OpenSSL before 1.1.0 and LibreSSL before 2.7.0 are now deprecated and will be removed in the future versions of XMLSec Library. Refactored all the integer casts to ensure cast-safety. Fixed all warnings and enabled "-Werror" and "-pedantic" flags on CI builds. Added configure flag to use size_t for xmlSecSize (currently disabled by default for backward compatibility). Several other small fixes (more details). Full Changelog: https://www.aleksey.com/xmlsec/ With hat: office
71 lines
2.0 KiB
C
71 lines
2.0 KiB
C
--- src/openssl/app.c.orig 2022-11-28 21:40:24 UTC
|
|
+++ src/openssl/app.c
|
|
@@ -46,6 +46,29 @@
|
|
|
|
#include "../cast_helpers.h"
|
|
|
|
+#if defined(XMLSEC_OPENSSL_API_110) && defined(LIBRESSL_VERSION_NUMBER)
|
|
+static UI_METHOD *
|
|
+ui_null_create(void)
|
|
+{
|
|
+ return (UI_create_method("OpenSSL NULL UI"));
|
|
+}
|
|
+static void
|
|
+ui_null_destroy(UI_METHOD *ui)
|
|
+{
|
|
+ UI_destroy_method(ui);
|
|
+}
|
|
+#else
|
|
+static const UI_METHOD *
|
|
+ui_null_create(void)
|
|
+{
|
|
+ return (UI_null());
|
|
+}
|
|
+static void
|
|
+ui_null_destroy(const UI_METHOD *ui)
|
|
+{
|
|
+}
|
|
+#endif
|
|
+
|
|
static int xmlSecOpenSSLDefaultPasswordCallback (char *buf,
|
|
int bufsiz,
|
|
int verify,
|
|
@@ -462,6 +485,11 @@ xmlSecOpenSSLAppEngineKeyLoad(const char *engineName,
|
|
EVP_PKEY* pKey = NULL;
|
|
int engineInit = 0;
|
|
int ret;
|
|
+#if defined(XMLSEC_OPENSSL_API_110) && defined(LIBRESSL_VERSION_NUMBER)
|
|
+ UI_METHOD *ui_null = ui_null_create();
|
|
+#else
|
|
+ const UI_METHOD *ui_null = ui_null_create();
|
|
+#endif
|
|
|
|
xmlSecAssert2(engineName != NULL, NULL);
|
|
xmlSecAssert2(engineKeyId != NULL, NULL);
|
|
@@ -487,7 +515,7 @@ xmlSecOpenSSLAppEngineKeyLoad(const char *engineName,
|
|
}
|
|
}
|
|
|
|
- if(ENGINE_ctrl_cmd(engine, "SET_USER_INTERFACE", 0, (void *)UI_null(), 0, 1) < 0) {
|
|
+ if(ENGINE_ctrl_cmd(engine, "SET_USER_INTERFACE", 0, (void *)ui_null, 0, 1) < 0) {
|
|
xmlSecOpenSSLError("ENGINE_ctrl_cmd_string(SET_USER_INTERFACE)", NULL);
|
|
goto done;
|
|
}
|
|
@@ -503,7 +531,7 @@ xmlSecOpenSSLAppEngineKeyLoad(const char *engineName,
|
|
|
|
/* load private key */
|
|
pKey = ENGINE_load_private_key(engine, engineKeyId,
|
|
- (UI_METHOD *)UI_null(),
|
|
+ (UI_METHOD *)ui_null,
|
|
NULL);
|
|
if(pKey == NULL) {
|
|
xmlSecOpenSSLError("ENGINE_load_private_key", NULL);
|
|
@@ -534,6 +562,7 @@ done:
|
|
data = NULL;
|
|
|
|
done:
|
|
+ ui_null_destroy(ui_null);
|
|
/* cleanup */
|
|
if(pKey != NULL) {
|
|
EVP_PKEY_free(pKey);
|