Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 May 2022 20:25:03 GMT
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 29c7d4a9f835 - main - security/xmlsec1: fix build when using libressl
Message-ID:  <202205062025.246KP3Gk030033@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by hrs:

URL: https://cgit.FreeBSD.org/ports/commit/?id=29c7d4a9f83548fee47722fcc60ad33bbdfa9f87

commit 29c7d4a9f83548fee47722fcc60ad33bbdfa9f87
Author:     Hiroki Sato <hrs@FreeBSD.org>
AuthorDate: 2022-05-06 20:23:19 +0000
Commit:     Hiroki Sato <hrs@FreeBSD.org>
CommitDate: 2022-05-06 20:24:48 +0000

    security/xmlsec1: fix build when using libressl
    
    PR:     263826
---
 security/xmlsec1/files/patch-src-openssl-app.c | 70 ++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/security/xmlsec1/files/patch-src-openssl-app.c b/security/xmlsec1/files/patch-src-openssl-app.c
new file mode 100644
index 000000000000..c723cad64dad
--- /dev/null
+++ b/security/xmlsec1/files/patch-src-openssl-app.c
@@ -0,0 +1,70 @@
+--- src/openssl/app.c.orig	2022-05-03 23:36:17.000000000 +0900
++++ src/openssl/app.c	2022-05-07 05:18:46.065103000 +0900
+@@ -43,6 +43,29 @@
+ 
+ #include "openssl_compat.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      xmlSecOpenSSLAppLoadRANDFile            (const char *filename);
+ static int      xmlSecOpenSSLAppSaveRANDFile            (const char *filename);
+ static int      xmlSecOpenSSLDefaultPasswordCallback    (char *buf,
+@@ -415,6 +438,11 @@
+     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
+ 
+ #ifndef OPENSSL_NO_ENGINE
+     xmlSecAssert2(engineName != NULL, NULL);
+@@ -437,7 +465,7 @@
+         }
+     }
+ 
+-    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;
+     }
+@@ -453,7 +481,7 @@
+ 
+     /* 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);
+@@ -484,6 +512,7 @@
+     data = NULL;
+ 
+ done:
++    ui_null_destroy(ui_null);
+     /* cleanup */
+     if(pKey != NULL) {
+         EVP_PKEY_free(pKey);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202205062025.246KP3Gk030033>