Bug 245116 - devel/qca: [patch] 2.3.0 fails to build with libressl
Summary: devel/qca: [patch] 2.3.0 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 Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-27 22:18 UTC by Felix Palmen
Modified: 2020-04-03 21:27 UTC (History)
1 user (show)

See Also:
tcberner: maintainer-feedback+


Attachments
Fix build with libressl (2.80 KB, patch)
2020-03-27 22:18 UTC, Felix Palmen
no flags Details | Diff
Fix build with libressl, patch from gentoo (2.26 KB, patch)
2020-03-28 10:56 UTC, Felix Palmen
no flags Details | Diff
Fix build with libressl (2.72 KB, patch)
2020-03-28 10:57 UTC, Felix Palmen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Palmen freebsd_committer freebsd_triage 2020-03-27 22:18:33 UTC
Created attachment 212772 [details]
Fix build with libressl

Currently fails to build with libressl giving the following compiler errors:

----
/wrkdirs/usr/ports/devel/qca/work/qca-2.3.0/plugins/qca-ossl/qca-ossl.cpp:1275:44: error: use of undeclared identifier 'EVP_PKEY_HKDF'
                EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, nullptr);
                                                         ^
/wrkdirs/usr/ports/devel/qca/work/qca-2.3.0/plugins/qca-ossl/qca-ossl.cpp:2826:11: error: use of undeclared identifier 'RSA_F_RSA_OSSL_PRIVATE_DECRYPT'
                        RSAerr(RSA_F_RSA_OSSL_PRIVATE_DECRYPT, RSA_R_UNKNOWN_PADDING_TYPE);
                               ^
2 errors generated.
----

Find attached my suggested fix.
Comment 1 Tobias C. Berner freebsd_committer freebsd_triage 2020-03-28 07:57:37 UTC
Moin moin 

Hm, I hoped libressl would be fine with the upgrade :)

What's the version of libressl you are using?


mfg Tobias
Comment 2 Felix Palmen freebsd_committer freebsd_triage 2020-03-28 08:00:09 UTC
3.0.2, the latest from ports (r529239)
Comment 3 Felix Palmen freebsd_committer freebsd_triage 2020-03-28 08:05:32 UTC
The code for the patch is taken from https://github.com/htcondor/htcondor/blob/master/src/condor_io/condor_auth_passwd.cpp but ignoring all return codes as the code using the new methods in qca doesn't check any return codes either -- probably not nice, but not hopefully not worse than original.
Comment 4 Tobias C. Berner freebsd_committer freebsd_triage 2020-03-28 10:09:11 UTC
(In reply to Felix Palmen from comment #3)
Moin moin 

Gentoo [1] also has libressl-support patches for qca-2.3 -- would you mind checking if these work for you?


mfg Tobias


[1] https://gitweb.gentoo.org/repo/proj/libressl.git/tree/app-crypt/qca
Comment 5 Felix Palmen freebsd_committer freebsd_triage 2020-03-28 10:19:07 UTC
At a first glance, gentoo's patch just disables hkdf support, so this is reduced functionality -- you still want to take that?
Comment 6 Felix Palmen freebsd_committer freebsd_triage 2020-03-28 10:56:18 UTC
Created attachment 212782 [details]
Fix build with libressl, patch from gentoo

I can confirm the Gentoo patch builds fine
Comment 7 Felix Palmen freebsd_committer freebsd_triage 2020-03-28 10:57:35 UTC
Created attachment 212783 [details]
Fix build with libressl

As an alternative, here's an update of my initial patch that avoids checks for LIBRESSL_VERSION_NUMBER and attempts to retain HKDF functionality
Comment 8 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-03 21:25:51 UTC
Committed. Thanks.
Comment 9 commit-hook freebsd_committer freebsd_triage 2020-04-03 21:27:00 UTC
A commit references this bug:

Author: tcberner
Date: Fri Apr  3 21:25:41 UTC 2020
New revision: 530522
URL: https://svnweb.freebsd.org/changeset/ports/530522

Log:
  devel/qca: add support for libressl

  PR:		245116
  Submitted by:	Felix Palmen <felix@palmen-it.de>

Changes:
  head/devel/qca/files/
  head/devel/qca/files/patch-plugins_qca-ossl_qca-ossl.cpp