Bug 217220 - net/qt5-network update to 5.7.1 fails
Summary: net/qt5-network update to 5.7.1 fails
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 (Team)
Depends on:
Blocks: 217333
  Show dependency treegraph
Reported: 2017-02-19 05:17 UTC by Walter Schwarzenfeld
Modified: 2017-03-07 03:07 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (kde)

possible_patch-qsslsocket__openssl__symbols__p_h (267 bytes, patch)
2017-02-19 20:51 UTC, Walter Schwarzenfeld
no flags Details | Diff
svn-diff_qt5-network (999 bytes, patch)
2017-02-22 01:34 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch-src_network_ssl_qsslsocket__openssl__symbols__p.h (789 bytes, patch)
2017-02-23 00:09 UTC, Walter Schwarzenfeld
no flags Details | Diff
svn-diff_qt5-network (15.91 KB, patch)
2017-02-24 22:51 UTC, Walter Schwarzenfeld
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Schwarzenfeld freebsd_triage 2017-02-19 05:17:32 UTC
Update to 5.7.1 fails with 
--- .obj/qsslsocket_openssl.o ---
ssl/qsslsocket_openssl.cpp:1593:13: error: use of undeclared identifier 'SSL_CTRL_GET_SERVER_TMP_KEY'
        if (q_SSL_get_server_tmp_key(ssl, &key))
ssl/qsslsocket_openssl_symbols_p.h:493:62: note: expanded from macro 'q_SSL_get_server_tmp_key'
#define q_SSL_get_server_tmp_key(ssl, key) q_SSL_ctrl((ssl), SSL_CTRL_GET_SERVER_TMP_KEY, 0, (char *)key)
1 error generated.
*** [.obj/qsslsocket_openssl.o] Error code 1

make[1]: stopped in /usr/ports/net/qt5-network/work/qtbase-opensource-src-5.7.1/src/network
1 error

make[1]: stopped in /usr/ports/net/qt5-network/work/qtbase-opensource-src-5.7.1/src/network
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

(I have libressl, but don't know if this is
related to libressl).
Comment 1 Walter Schwarzenfeld freebsd_triage 2017-02-19 05:23:42 UTC
This seems related to it (if I am righT)
Comment 2 Walter Schwarzenfeld freebsd_triage 2017-02-19 05:25:19 UTC
Sorry, the link is an old one.
Comment 3 Walter Schwarzenfeld freebsd_triage 2017-02-19 07:10:19 UTC
Compiles if I add
to   src/network/ssl/qsslcontext_openssl.cpp, src/network/ssl/qsslsocket_openssl.cpp and 

But that's surely not correct. This should be in a 
header-file (but which?).
Comment 4 Walter Schwarzenfeld freebsd_triage 2017-02-19 17:00:40 UTC
src/network/ssl/qsslsocket_openssl_symbols_p.h seems the 
right header-file.
Comment 5 Walter Schwarzenfeld freebsd_triage 2017-02-19 20:51:19 UTC
Created attachment 180153 [details]

If I am right and it is nothing more to do, 
there is a patch.
Comment 6 tjlegg 2017-02-20 00:01:02 UTC
See libressl commits:

Have compiled qt5 (5.7.1)-network in my poudriere with these additions to security/libressl-devel. Assume can patch security/libressl with same.
Comment 7 Walter Schwarzenfeld freebsd_triage 2017-02-20 00:42:26 UTC
s3_lib.c looks different in libressl (2.4.5) Don't find 
the place to insert the case statements. 
Adding libressl mantainer to CC.
Comment 8 tjlegg 2017-02-20 01:58:31 UTC
(In reply to w.schwarzenfeld from comment #7)

Looking at the 2.4.5 version of s3_lib.c, lots of stuff has changed.

I think the first set of case statements will slot in around line 2314 after the "case SSL_CTRL_SET_ECDH_AUTO:" statement

I think the second set of case statements will slot in around original line 2485 after the "case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS:" statement
Comment 9 Walter Schwarzenfeld freebsd_triage 2017-02-20 05:36:47 UTC
Thanks! But no, whatever I did I got error messages.
Seems there is need for more work.
Comment 10 Walter Schwarzenfeld freebsd_triage 2017-02-22 01:34:34 UTC
Created attachment 180210 [details]
Comment 11 Walter Schwarzenfeld freebsd_triage 2017-02-22 01:36:32 UTC
I attach the patch again. I was a little bit uncertain about the patch
for libressl-devel. But I think this is a complete other problem.
Comment 12 Walter Schwarzenfeld freebsd_triage 2017-02-22 01:39:14 UTC
Should be:
uncertain cause of the patch for libressl-devel
Comment 13 Walter Schwarzenfeld freebsd_triage 2017-02-22 02:39:20 UTC
Poudriere testbuilds with 103amd64 and 103i386 ok.
Comment 14 Walter Schwarzenfeld freebsd_triage 2017-02-23 00:09:08 UTC
Created attachment 180236 [details]

Change patch after r434635.
Comment 15 Walter Schwarzenfeld freebsd_triage 2017-02-23 00:12:57 UTC
It still fails after r434635 with the same error.
Comment 16 Igor Pavlov 2017-02-24 16:50:05 UTC
I have the same issue. Proposed patch helps.
Comment 17 Bernard Spil freebsd_committer 2017-02-24 20:54:09 UTC
Can you please have a look at https://github.com/gentoo/libressl/blob/87834014d5517cae68190498b9c77702372e887a/dev-qt/qtnetwork/files/qtnetwork-5.7.1-libressl.patch and see if that solves issues with both libressl and libressl-devel?
Comment 18 Walter Schwarzenfeld freebsd_triage 2017-02-24 21:31:17 UTC
No =>
--- .obj/qsslsocket_openssl.o ---
ssl/qsslsocket_openssl.cpp:1593:13: error: use of undeclared identifier 'SSL_CTRL_GET_SERVER_TMP_KEY'
        if (q_SSL_get_server_tmp_key(ssl, &key))
ssl/qsslsocket_openssl_symbols_p.h:495:62: note: expanded from macro 'q_SSL_get_server_tmp_key'
#define q_SSL_get_server_tmp_key(ssl, key) q_SSL_ctrl((ssl), SSL_CTRL_GET_SERVER_TMP_KEY, 0, (char *)key)
1 error generated.
*** [.obj/qsslsocket_openssl.o] Error code 1

make[1]: stopped in /ram/usr/ports/net/qt5-network/work/qtbase-opensource-src-5.7.1/src/network
1 error
Comment 19 Walter Schwarzenfeld freebsd_triage 2017-02-24 22:02:59 UTC
Sorry, I hat to remove all patches from the files directory.

Yes, this is working, thanks!
Comment 20 Walter Schwarzenfeld freebsd_triage 2017-02-24 22:51:44 UTC
Created attachment 180274 [details]
Comment 21 Walter Schwarzenfeld freebsd_triage 2017-02-24 22:53:41 UTC
Update the patch following the contents of the link. (Named the patch in the files directory simple patch-libressl).
Comment 22 commit-hook freebsd_committer 2017-03-07 02:45:54 UTC
A commit references this bug:

Author: rezny
Date: Tue Mar  7 02:45:47 UTC 2017
New revision: 435579
URL: https://svnweb.freebsd.org/changeset/ports/435579

  Fix to build with libressl as well as libressl-devel and simplify patch

  PR:		217220
  Reported by:	w.schwarzenfeld@utanet.at
  Approved by:	swills (mentor)
  Differential Revision:	https://reviews.freebsd.org/D9914

Comment 23 Matthew Rezny freebsd_committer 2017-03-07 03:07:00 UTC
This should now be fixed, I confirmed the build with openssl, libressl, and libressl-devel this time. Confirmation with openssl-devel is not possible at this time because due to the dependency on python27 which doesn't build with openssl-devel. 

Sorry I missed this the last time around. I had prepared a patch for Qt 5.6.2 to build with libressl-devel after its update to 2.5.1, and tested that with all three SSL libs. Qt 5.7.1 landed in ports at the same time, so the patch was revised and quickly retested, but not with libressl 2.4.5 so the issue setting temporal keys was missed. Henceforth I'll be sure to test building against all possible SSL libs.