commit: 06c71f2a4642274378b20698f7cf5cf8475d080c Author: orbea <orbea <AT> riseup <DOT> net> AuthorDate: Sun Dec 21 20:38:36 2025 +0000 Commit: orbea <orbea <AT> riseup <DOT> net> CommitDate: Sun Dec 21 20:38:36 2025 +0000 URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=06c71f2a
app-crypt/qca: update OpenBSD patch Signed-off-by: orbea <orbea <AT> riseup.net> app-crypt/qca/files/qca-2.3.10-libressl.patch | 113 ++++++++++++++++++++++++ app-crypt/qca/files/qca-2.3.4-libressl.patch | 121 -------------------------- app-crypt/qca/qca-2.3.10-r1.ebuild | 2 +- 3 files changed, 114 insertions(+), 122 deletions(-) diff --git a/app-crypt/qca/files/qca-2.3.10-libressl.patch b/app-crypt/qca/files/qca-2.3.10-libressl.patch new file mode 100644 index 0000000..adcf00a --- /dev/null +++ b/app-crypt/qca/files/qca-2.3.10-libressl.patch @@ -0,0 +1,113 @@ +https://github.com/openbsd/ports/blob/5305fd2e586be9252c54543ef1a527a2072cef13/security/qca-qt6/patches/patch-plugins_qca-ossl_qca-ossl_cpp + +Fix compilation with LibreSSL + +Index: plugins/qca-ossl/qca-ossl.cpp +--- a/plugins/qca-ossl/qca-ossl.cpp.orig ++++ b/plugins/qca-ossl/qca-ossl.cpp +@@ -45,6 +45,11 @@ + #include <openssl/provider.h> + #endif + ++#ifndef RSA_F_RSA_OSSL_PRIVATE_DECRYPT ++#define RSA_F_RSA_OSSL_PRIVATE_DECRYPT RSA_F_RSA_EAY_PRIVATE_DECRYPT ++#define SSL_CIPHER_standard_name SSL_CIPHER_get_name ++#endif ++ + #include <openssl/kdf.h> + + using namespace QCA; +@@ -311,7 +318,7 @@ static void try_get_name_item(X509_NAME *name, int nid + while ((loc = X509_NAME_get_index_by_NID(name, nid, loc)) != -1) { + X509_NAME_ENTRY *ne = X509_NAME_get_entry(name, loc); + ASN1_STRING *data = X509_NAME_ENTRY_get_data(ne); +- QByteArray cs((const char *)data->data, data->length); ++ QByteArray cs((const char *)ASN1_STRING_get0_data(data), ASN1_STRING_length(data)); + info->insert(t, QString::fromLatin1(cs)); + } + } +@@ -328,7 +335,7 @@ try_get_name_item_by_oid(X509_NAME *name, const QStrin + while ((loc = X509_NAME_get_index_by_OBJ(name, oid, loc)) != -1) { + X509_NAME_ENTRY *ne = X509_NAME_get_entry(name, loc); + ASN1_STRING *data = X509_NAME_ENTRY_get_data(ne); +- QByteArray cs((const char *)data->data, data->length); ++ QByteArray cs((const char *)ASN1_STRING_get0_data(data), ASN1_STRING_length(data)); + info->insert(t, QString::fromLatin1(cs)); + qDebug() << "oid: " << oidText << ", result: " << cs; + } +@@ -3335,15 +3342,15 @@ class X509Item (public) + QDateTime ASN1_UTCTIME_QDateTime(const ASN1_UTCTIME *tm, int *isGmt) + { + QDateTime qdt; +- char *v; ++ const char *v; + int gmt = 0; + int i; + int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0; + QDate qdate; + QTime qtime; + +- i = tm->length; +- v = (char *)tm->data; ++ i = ASN1_STRING_length(tm); ++ v = (const char *)ASN1_STRING_get0_data(tm); + + if (i < 10) + goto auq_err; +@@ -3716,9 +3723,9 @@ class MyCertContext : public CertContext (public) + + X509_get0_signature(&signature, nullptr, x); + if (signature) { +- p.sig = QByteArray(signature->length, 0); +- for (int i = 0; i < signature->length; i++) +- p.sig[i] = signature->data[i]; ++ p.sig = QByteArray(ASN1_STRING_length(signature), 0); ++ for (int i = 0; i < ASN1_STRING_length(signature); i++) ++ p.sig[i] = ASN1_STRING_get0_data(signature)[i]; + } + + switch (X509_get_signature_nid(x)) { +@@ -4214,9 +4221,9 @@ class MyCSRContext : public CSRContext (public) + + X509_REQ_get0_signature(x, &signature, nullptr); + if (signature) { +- p.sig = QByteArray(signature->length, 0); +- for (int i = 0; i < signature->length; i++) +- p.sig[i] = signature->data[i]; ++ p.sig = QByteArray(ASN1_STRING_length(signature), 0); ++ for (int i = 0; i < ASN1_STRING_length(signature); i++) ++ p.sig[i] = ASN1_STRING_get0_data(signature)[i]; + } + + switch (X509_REQ_get_signature_nid(x)) { +@@ -4412,9 +4419,9 @@ class MyCRLContext : public CRLContext (public) + + X509_CRL_get0_signature(x, &signature, nullptr); + if (signature) { +- p.sig = QByteArray(signature->length, 0); +- for (int i = 0; i < signature->length; i++) +- p.sig[i] = signature->data[i]; ++ p.sig = QByteArray(ASN1_STRING_length(signature), 0); ++ for (int i = 0; i < ASN1_STRING_length(signature); i++) ++ p.sig[i] = ASN1_STRING_get0_data(signature)[i]; + } + + switch (X509_CRL_get_signature_nid(x)) { +@@ -6460,7 +6467,7 @@ static QStringList all_hash_types() + list += QStringLiteral("md2"); + #endif + list += QStringLiteral("md4"); +-#ifdef OBJ_whirlpool ++#ifndef OPENSSL_NO_WHIRLPOOL + list += QStringLiteral("whirlpool"); + #endif + } +@@ -6921,7 +6928,7 @@ class opensslProvider : public Provider (public) + #endif + else if (type == QLatin1String("md4")) + return new opensslHashContext(EVP_md4(), this, type); +-#ifdef OBJ_whirlpool ++#ifndef OPENSSL_NO_WHIRLPOOL + else if (type == QLatin1String("whirlpool")) + return new opensslHashContext(EVP_whirlpool(), this, type); + #endif diff --git a/app-crypt/qca/files/qca-2.3.4-libressl.patch b/app-crypt/qca/files/qca-2.3.4-libressl.patch deleted file mode 100644 index 442c1dc..0000000 --- a/app-crypt/qca/files/qca-2.3.4-libressl.patch +++ /dev/null @@ -1,121 +0,0 @@ -From aa07e1eacdbfeefa5ff21c5d7e45ce9e02e91dbb Mon Sep 17 00:00:00 2001 -From: Stefan Strogin <[email protected]> -Date: Fri, 3 Jun 2022 21:11:45 -0700 -Subject: [PATCH] LibreSSL 3.0.x support - ---- - plugins/qca-ossl/qca-ossl.cpp | 25 ++++++++++++++++++++++++- - 1 file changed, 24 insertions(+), 1 deletion(-) - -diff --git a/plugins/qca-ossl/qca-ossl.cpp b/plugins/qca-ossl/qca-ossl.cpp -index b2c5d3d..79775cd 100644 ---- a/plugins/qca-ossl/qca-ossl.cpp -+++ b/plugins/qca-ossl/qca-ossl.cpp -@@ -45,7 +45,13 @@ - #include <openssl/provider.h> - #endif - -+#ifndef RSA_F_RSA_OSSL_PRIVATE_DECRYPT -+#define RSA_F_RSA_OSSL_PRIVATE_DECRYPT RSA_F_RSA_EAY_PRIVATE_DECRYPT -+#endif -+ -+#ifndef LIBRESSL_VERSION_NUMBER - #include <openssl/kdf.h> -+#endif - - using namespace QCA; - -@@ -1262,6 +1268,7 @@ public: - protected: - }; - -+#ifndef LIBRESSL_VERSION_NUMBER - class opensslHkdfContext : public HKDFContext - { - Q_OBJECT -@@ -1294,6 +1301,7 @@ public: - return out; - } - }; -+#endif // LIBRESSL_VERSION_NUMBER - - class opensslHMACContext : public MACContext - { -@@ -5004,7 +5012,11 @@ public: - case TLS::TLS_v1: - ctx = SSL_CTX_new(TLS_client_method()); - SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION); -+#ifdef TLS1_3_VERSION - SSL_CTX_set_max_proto_version(ctx, TLS1_3_VERSION); -+#else -+ SSL_CTX_set_max_proto_version(ctx, TLS1_2_VERSION); -+#endif - break; - case TLS::DTLS_v1: - default: -@@ -5025,7 +5037,11 @@ public: - QStringList cipherList; - for (int i = 0; i < sk_SSL_CIPHER_num(sk); ++i) { - const SSL_CIPHER *thisCipher = sk_SSL_CIPHER_value(sk, i); -+#ifndef LIBRESSL_VERSION_NUMBER - cipherList += QString::fromLatin1(SSL_CIPHER_standard_name(thisCipher)); -+#else -+ cipherList += QString::fromLatin1(SSL_CIPHER_get_name(thisCipher)); -+#endif - } - sk_SSL_CIPHER_free(sk); - -@@ -5397,8 +5413,11 @@ public: - qDebug("unexpected version response"); - sessInfo.version = TLS::TLS_v1; - } -- -+#ifndef LIBRESSL_VERSION_NUMBER - sessInfo.cipherSuite = QString::fromLatin1(SSL_CIPHER_standard_name(SSL_get_current_cipher(ssl))); -+#else -+ sessInfo.cipherSuite = QString::fromLatin1(SSL_CIPHER_get_name(SSL_get_current_cipher(ssl))); -+#endif - - sessInfo.cipherMaxBits = SSL_get_cipher_bits(ssl, &(sessInfo.cipherBits)); - -@@ -6460,7 +6479,7 @@ static QStringList all_hash_types() - list += QStringLiteral("md2"); - #endif - list += QStringLiteral("md4"); --#ifdef OBJ_whirlpool -+#if defined(OBJ_whirlpool) && !defined(OPENSSL_NO_WHIRLPOOL) - list += QStringLiteral("whirlpool"); - #endif - } -@@ -6705,7 +6724,9 @@ public: - } - list += QStringLiteral("pkcs12"); - list += QStringLiteral("pbkdf2(sha1)"); -+#ifndef LIBRESSL_VERSION_NUMBER - list += QStringLiteral("hkdf(sha256)"); -+#endif // LIBRESSL_VERSION_NUMBER - list += QStringLiteral("pkey"); - list += QStringLiteral("dlgroup"); - list += QStringLiteral("rsa"); -@@ -6755,8 +6776,10 @@ public: - #endif - else if (type == QLatin1String("pbkdf2(sha1)")) - return new opensslPbkdf2Context(this, type); -+#ifndef LIBRESSL_VERSION_NUMBER - else if (type == QLatin1String("hkdf(sha256)")) - return new opensslHkdfContext(this, type); -+#endif // LIBRESSL_VERSION_NUMBER - else if (type == QLatin1String("hmac(md5)")) - return new opensslHMACContext(EVP_md5(), this, type); - else if (type == QLatin1String("hmac(sha1)")) -@@ -6921,7 +6944,7 @@ public: - #endif - else if (type == QLatin1String("md4")) - return new opensslHashContext(EVP_md4(), this, type); --#ifdef OBJ_whirlpool -+#if defined(OBJ_whirlpool) && !defined(OPENSSL_NO_WHIRLPOOL) - else if (type == QLatin1String("whirlpool")) - return new opensslHashContext(EVP_whirlpool(), this, type); - #endif --- -2.35.1 diff --git a/app-crypt/qca/qca-2.3.10-r1.ebuild b/app-crypt/qca/qca-2.3.10-r1.ebuild index 59e28eb..62a35a3 100644 --- a/app-crypt/qca/qca-2.3.10-r1.ebuild +++ b/app-crypt/qca/qca-2.3.10-r1.ebuild @@ -42,7 +42,7 @@ BDEPEND=" " PATCHES=( - "${FILESDIR}/${PN}-2.3.4-libressl.patch" + "${FILESDIR}/${PN}-2.3.10-libressl.patch" "${FILESDIR}/${PN}-disable-pgp-test.patch" )
