Bug 248590 - devel/qca: Fails to build with libressl
Summary: devel/qca: Fails to build with libressl
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-kde (group)
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2020-08-11 10:23 UTC by tjlegg
Modified: 2021-02-10 11:00 UTC (History)
4 users (show)

See Also:
tcberner: maintainer-feedback+
koobs: maintainer-feedback? (brnrd)
koobs: merge-quarterly?


Attachments
This is the gentoo patch applied after make extract and then recreated using make makepatch (2.81 KB, patch)
2020-09-09 04:57 UTC, tjlegg
no flags Details | Diff
Patch from openbsd/gentoo (6.01 KB, patch)
2020-10-25 22:18 UTC, Loïc Bartoletti
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tjlegg 2020-08-11 10:23:10 UTC
devel/qca fails to build with libressl. Patch exists with gentoo that could be merged with existing patch.

qca-qt5
/wrkdirs/usr/ports/devel/qca/work/qca-2.3.1/plugins/qca-ossl/qca-ossl.cpp:5028:39: error: use of undeclared identifier 'TLS1_3_VERSION'
                        SSL_CTX_set_max_proto_version(ctx, TLS1_3_VERSION);
                                                           ^
/wrkdirs/usr/ports/devel/qca/work/qca-2.3.1/plugins/qca-ossl/qca-ossl.cpp:5049:38: error: use of undeclared identifier 'SSL_CIPHER_standard_name'; did you mean 'SSL_CIPHER_get_name'?
                        cipherList += QString::fromLatin1(SSL_CIPHER_standard_name(thisCipher));
                                                          ^~~~~~~~~~~~~~~~~~~~~~~~
                                                          SSL_CIPHER_get_name
/usr/local/include/openssl/ssl.h:1296:14: note: 'SSL_CIPHER_get_name' declared here
const char *    SSL_CIPHER_get_name(const SSL_CIPHER *c);
                ^
/wrkdirs/usr/ports/devel/qca/work/qca-2.3.1/plugins/qca-ossl/qca-ossl.cpp:5442:46: error: use of undeclared identifier 'SSL_CIPHER_standard_name'; did you mean 'SSL_CIPHER_get_name'?
                sessInfo.cipherSuite = QString::fromLatin1(SSL_CIPHER_standard_name(SSL_get_current_cipher(ssl)));
                                                           ^~~~~~~~~~~~~~~~~~~~~~~~
                                                           SSL_CIPHER_get_name
/usr/local/include/openssl/ssl.h:1296:14: note: 'SSL_CIPHER_get_name' declared here
const char *    SSL_CIPHER_get_name(const SSL_CIPHER *c);
                ^
/wrkdirs/usr/ports/devel/qca/work/qca-2.3.1/plugins/qca-ossl/qca-ossl.cpp:6736:4: warning: 'qsrand' is deprecated: use QRandomGenerator instead [-Wdeprecated-declarations]
                        qsrand(time(nullptr));
                        ^
/usr/local/include/qt5/QtCore/qglobal.h:1276:15: note: 'qsrand' has been explicitly marked deprecated here
Q_CORE_EXPORT QT_DEPRECATED_VERSION_X_5_15("use QRandomGenerator instead") void qsrand(uint seed);
              ^
/usr/local/include/qt5/QtCore/qglobal.h:372:45: note: expanded from macro 'QT_DEPRECATED_VERSION_X_5_15'
# define QT_DEPRECATED_VERSION_X_5_15(text) QT_DEPRECATED_X(text)
                                            ^
/usr/local/include/qt5/QtCore/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
#  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                ^
/usr/local/include/qt5/QtCore/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
#    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                      ^
/wrkdirs/usr/ports/devel/qca/work/qca-2.3.1/plugins/qca-ossl/qca-ossl.cpp:6739:9: warning: 'qrand' is deprecated: use QRandomGenerator instead [-Wdeprecated-declarations]
                                n = qrand();
                                    ^
/usr/local/include/qt5/QtCore/qglobal.h:1277:15: note: 'qrand' has been explicitly marked deprecated here
Q_CORE_EXPORT QT_DEPRECATED_VERSION_X_5_15("use QRandomGenerator instead") int qrand();
              ^
/usr/local/include/qt5/QtCore/qglobal.h:372:45: note: expanded from macro 'QT_DEPRECATED_VERSION_X_5_15'
# define QT_DEPRECATED_VERSION_X_5_15(text) QT_DEPRECATED_X(text)
                                            ^
/usr/local/include/qt5/QtCore/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
#  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                ^
/usr/local/include/qt5/QtCore/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
#    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                      ^
2 warnings and 3 errors generated.
ninja: build stopped: subcommand failed.
*** Error code 1
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2020-08-11 10:25:20 UTC
@Reporter Do you have links to the Gentoo issue or patch?
Comment 2 tjlegg 2020-08-12 01:28:33 UTC
(In reply to Kubilay Kocak from comment #1)
These are the patches for qca for libressl compatability from gentoo.

https://gitweb.gentoo.org/repo/proj/libressl.git/tree/app-crypt/qca/files

(taken from the qca 2.3.0 libressl bug thread https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245116)

The merge would be around the final Freebsd patch for qca 2.3.0 which added back in HKDF functionality.
Comment 3 Tobias C. Berner freebsd_committer freebsd_triage 2020-08-24 05:30:03 UTC
Moin moin

(In reply to tjlegg from comment #2)
Could you provide an updated patch, that makes it work with libressl?

mfg Tobias
Comment 4 tjlegg 2020-09-09 04:57:01 UTC
Created attachment 217830 [details]
This is the gentoo patch applied after make extract and then recreated using make makepatch
Comment 5 Loïc Bartoletti freebsd_committer freebsd_triage 2020-10-25 22:18:04 UTC
Created attachment 219086 [details]
Patch from openbsd/gentoo

Hello,

I tested the patch and qca build fine. However, I had to modify curl so that it could compile with libressl in poudriere. Please, can you confirm?
Comment 6 Adriaan de Groot freebsd_committer freebsd_triage 2021-02-10 00:06:37 UTC
I'm going to combine this with the QCA 2.3.2 release which was announced this week, and then gently nudge OpenBSD to get this upstreamed.
Comment 7 Adriaan de Groot freebsd_committer freebsd_triage 2021-02-10 10:46:31 UTC
Upstream MR https://invent.kde.org/libraries/qca/-/issues/7
Comment 8 commit-hook freebsd_committer freebsd_triage 2021-02-10 10:47:09 UTC
A commit references this bug:

Author: adridg
Date: Wed Feb 10 10:46:36 UTC 2021
New revision: 564849
URL: https://svnweb.freebsd.org/changeset/ports/564849

Log:
  Update devel/qca to latest upstream release

  QCA is the Qt Cryptographic Architecture - straightforward cross-
  platform crypto API.  This release has:
   * Add macOS framework major version
   * qca-gcrypt: Add support for HKDF
   * Minimum Qt updated to 5.9
   * Fixed compilation with gcc 11

  While updating, I have added the patch for LibreSSL compatibility (and
  tried to upsteam it). The patch comes via Gentoo and OpenBSD and has
  been adjusted by lbartoletti@ and tjlegg@gmail.com and myself,
  so I'm filling in something generic-ish in "Obtained from" since it
  is collaborative. The PR: entry is for this patch, not for the update
  to the recent release.

  PR:		248590
  Reported by:	portscout, tjlegg@gmail.com
  Obtained from:	Gentoo/OpenBSD

Changes:
  head/devel/qca/Makefile
  head/devel/qca/distinfo
  head/devel/qca/files/patch-plugins_qca-ossl_qca-ossl.cpp
Comment 9 Adriaan de Groot freebsd_committer freebsd_triage 2021-02-10 11:00:04 UTC
I should mention I didn't touch curl, like lbartoletti@ did in the patch: I built curl without the TLS-SRTP option instead. It's worth a separate PR for the curl folks to figure out if that IGNORE block still applies with current libressl.