Bug 228344 - net/qt5-network: fails update to 5.11.2 with libressl
Summary: net/qt5-network: fails update to 5.11.2 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: kde
URL: https://bugreports.qt.io/browse/QTBUG...
Keywords: needs-qa, patch
Depends on:
Blocks: 226843
  Show dependency treegraph
 
Reported: 2018-05-18 16:25 UTC by Walter Schwarzenfeld
Modified: 2018-12-09 20:17 UTC (History)
14 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments
svn-diff_:qt5-network (12.99 KB, patch)
2018-05-19 14:10 UTC, Walter Schwarzenfeld
no flags Details | Diff
svn-diff_qt5-network_v2 (13.13 KB, patch)
2018-05-19 15:59 UTC, Walter Schwarzenfeld
no flags Details | Diff
svn diff for net/qt5-network (2.66 KB, patch)
2018-05-20 12:53 UTC, Bernard Spil
no flags Details | Diff
changed patch (1.04 KB, patch)
2018-05-28 13:48 UTC, Eugene
no flags Details | Diff
patch-qsslsocket__openssl__symbols.cpp (699 bytes, text/plain)
2018-09-09 18:14 UTC, Walter Schwarzenfeld
no flags Details
svn-diff-qt5-network-5.11.1 (4.63 KB, patch)
2018-09-09 22:35 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch-libressl_v2 (11.86 KB, patch)
2018-10-21 17:26 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch-libressl_v3 (10.87 KB, patch)
2018-10-21 18:08 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch-libressl_v4 (10.88 KB, patch)
2018-10-23 10:46 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch-libressl_v5 (9.80 KB, patch)
2018-10-23 10:57 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch-libressl_v6 (9.87 KB, patch)
2018-10-24 20:32 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch-libressl_v7 (9.72 KB, patch)
2018-10-24 22:33 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch-libressl_v8_with_comments (9.94 KB, patch)
2018-10-24 22:43 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch-libressl_v8.1_with_comments (9.94 KB, patch)
2018-10-24 22:47 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch-libressl_v9 (10.03 KB, patch)
2018-10-25 08:47 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 2018-05-18 16:25:06 UTC
Fails with:
int q_OPENSSL_sk_num(OPENSSL_STACK *a);
                     ^~~~~~~~~~~~~
                     OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslcertificate.cpp:116:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:88:28: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *));
                           ^~~~~~~~~~~~~
                           OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslcertificate.cpp:116:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:89:1: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
OPENSSL_STACK *q_OPENSSL_sk_new_null();
^~~~~~~~~~~~~
OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslcertificate.cpp:116:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:90:24: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
void q_OPENSSL_sk_push(OPENSSL_STACK *st, void *data);
                       ^~~~~~~~~~~~~
                       OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslcertificate.cpp:116:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:91:24: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
void q_OPENSSL_sk_free(OPENSSL_STACK *a);
                       ^~~~~~~~~~~~~
                       OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslcertificate.cpp:116:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:92:27: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
void * q_OPENSSL_sk_value(OPENSSL_STACK *a, int b);
                          ^~~~~~~~~~~~~
                          OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslcertificate.cpp:116:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:95:45: error: unknown type name 'OPENSSL_INIT_SETTINGS'
int q_OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
                                            ^
ssl/qsslsocket_openssl11_symbols_p.h:107:50: error: unknown type name 'X509_STORE_CTX_verify_cb'
void q_X509_STORE_set_verify_cb(X509_STORE *ctx, X509_STORE_CTX_verify_cb verify_cb);
                                                 ^
ssl/qsslsocket_openssl11_symbols_p.h:124:48: error: unknown type name 'OPENSSL_INIT_SETTINGS'
int q_OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
                                               ^
9 errors generated.
*** [.obj/qsslcertificate.o] Error code 1

make[1]: stopped in /ram/usr/ports/net/qt5-network/work/qtbase-everywhere-src-5.10.1/src/network
--- .obj/qsslkey_p.o ---
In file included from ssl/qsslkey_p.cpp:60:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:87:22: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
int q_OPENSSL_sk_num(OPENSSL_STACK *a);
                     ^~~~~~~~~~~~~
                     OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslkey_p.cpp:60:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:88:28: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *));
                           ^~~~~~~~~~~~~
                           OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslkey_p.cpp:60:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:89:1: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
OPENSSL_STACK *q_OPENSSL_sk_new_null();
^~~~~~~~~~~~~
OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslkey_p.cpp:60:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:90:24: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
void q_OPENSSL_sk_push(OPENSSL_STACK *st, void *data);
                       ^~~~~~~~~~~~~
                       OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslkey_p.cpp:60:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:91:24: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
void q_OPENSSL_sk_free(OPENSSL_STACK *a);
                       ^~~~~~~~~~~~~
                       OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslkey_p.cpp:60:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:92:27: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
void * q_OPENSSL_sk_value(OPENSSL_STACK *a, int b);
                          ^~~~~~~~~~~~~
                          OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslkey_p.cpp:60:
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:
ssl/qsslsocket_openssl11_symbols_p.h:95:45: error: unknown type name 'OPENSSL_INIT_SETTINGS'
int q_OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
                                            ^
ssl/qsslsocket_openssl11_symbols_p.h:107:50: error: unknown type name 'X509_STORE_CTX_verify_cb'
void q_X509_STORE_set_verify_cb(X509_STORE *ctx, X509_STORE_CTX_verify_cb verify_cb);
                                                 ^
ssl/qsslsocket_openssl11_symbols_p.h:124:48: error: unknown type name 'OPENSSL_INIT_SETTINGS'
int q_OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
                                               ^
9 errors generated.
*** [.obj/qsslkey_p.o] Error code 1

make[1]: stopped in /ram/usr/ports/net/qt5-network/work/qtbase-everywhere-src-5.10.1/src/network
2 errors

make[1]: stopped in /ram/usr/ports/net/qt5-network/work/qtbase-everywhere-src-5.10.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
Comment 1 Tobias C. Berner freebsd_committer 2018-05-18 17:37:37 UTC
Hi there

This has been pointed out in the commit message:


https://svnweb.freebsd.org/ports?view=revision&revision=470288


Mfg Tobias
Comment 2 jakub_lach 2018-05-18 22:04:06 UTC
True, but still not what one could expect (since there is FreeBSD based system which uses LibreSSL by default).
Comment 3 Walter Schwarzenfeld freebsd_triage 2018-05-19 03:40:52 UTC
(In reply to Tobias C. Berner from comment #1)
Ok, but the whole qt5 toolkit is not useable without qt5-network,
Comment 4 Tobias C. Berner freebsd_committer 2018-05-19 04:59:14 UTC
(In reply to jakub_lach from comment #2)
So it should not be that hard to find some one to maintain it upstream :)
Comment 5 Walter Schwarzenfeld freebsd_triage 2018-05-19 14:10:02 UTC
Created attachment 193533 [details]
svn-diff_:qt5-network

If I am right, this simple patch  should work.
Comment 6 Tobias C. Berner freebsd_committer 2018-05-19 14:36:03 UTC
I would assume that 
+    libssl->setFileNameAndVersion(QLatin1String("/usr/local/lib/libssl"), -1);
and so on will break with ssl from base.
Comment 7 Walter Schwarzenfeld freebsd_triage 2018-05-19 14:47:56 UTC
Ok, we had wrap it in a conditional

something like that:

+-    libssl->setFileNameAndVersion(QLatin1String("ssl"), -1);
+-    libcrypto->setFileNameAndVersion(QLatin1String("crypto"), -1);
++  #if defined(LIBRESSL_VERSION_NUMBER)
++    libssl->setFileNameAndVersion(QLatin1String("/usr/local/lib/libssl"), -1);
++    libcrypto->setFileNameAndVersion(QLatin1String("/usr/local/lib/libcrypto"), -1)
++  #else
++   libssl->setFileNameAndVersion(QLatin1String("ssl"), -1);
++    libcrypto->setFileNameAndVersion(QLatin1String("crypto"), -1);
++  #endif

but I cannot test it with openssl.
Comment 8 jakub_lach 2018-05-19 15:34:58 UTC
(In reply to Tobias C. Berner from comment #4)

Right, from the look of it their network manager depends on it (sysutils/pc-networkmanager)?
Comment 9 Walter Schwarzenfeld freebsd_triage 2018-05-19 15:59:31 UTC
Created attachment 193536 [details]
svn-diff_qt5-network_v2

I hope this one is right. Please, could you test it.
Comment 10 Matthew Seaman freebsd_committer 2018-05-19 16:44:36 UTC
This patch allows qt5-network to build against libressl without errors.  However the at least one resulting package linked against qt5-network is not functioning correctly.  When quassel-core is linked against the patched qt5-network I get:

```
[lucid-nonsense]:/home/matthew:# service quasselcore restart
Stopping quasselcore.
Waiting for PIDS: 47489.
Starting quasselcore.
[lucid-nonsense]:/home/matthew:# qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_new_null
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_push
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_free
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_num
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_pop_free
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_value
qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_options
qt.network.ssl: QSslSocket: cannot resolve SSL_session_reused
qt.network.ssl: QSslSocket: cannot resolve X509_get_version
qt.network.ssl: QSslSocket: cannot resolve DSA_bits
qt.network.ssl: QSslSocket: cannot call unresolved function OPENSSL_sk_num
("QPSQL", "QPSQL7")

[lucid-nonsense]:/home/matthew:# service quasselcore status
quasselcore is running as pid 47549.
```

The quassel-core process starts, albeit with a certain amount of complaint.  Unfortunately it proves impossible to connect a quassel client to it, rendering it useless.
Comment 11 Walter Schwarzenfeld freebsd_triage 2018-05-19 17:22:09 UTC
I think the error is here 

qsslsocket_openssl_symbols.cpp

   880         return false;
    881
=>    882 #if QT_CONFIG(opensslv11)   => had to add this  --> || defined(LIBRESS_VERSION_NUMBER)
    883
    884     RESOLVEFUNC(OPENSSL_init_ssl)
    885     RESOLVEFUNC(OPENSSL_init_crypto)
    886     RESOLVEFUNC(ASN1_STRING_get0_data)
    887     RESOLVEFUNC(EVP_CIPHER_CTX_reset)
    888     RESOLVEFUNC(EVP_PKEY_base_id)
    889     RESOLVEFUNC(RSA_bits)
    890     RESOLVEFUNC(OPENSSL_sk_new_null)
    891     RESOLVEFUNC(OPENSSL_sk_push)
    892     RESOLVEFUNC(OPENSSL_sk_free)
    893     RESOLVEFUNC(OPENSSL_sk_num)
    894     RESOLVEFUNC(OPENSSL_sk_pop_free)


but I have to test it.
Comment 12 Walter Schwarzenfeld freebsd_triage 2018-05-19 17:58:58 UTC
No, does not work.
Comment 13 Bernard Spil freebsd_committer 2018-05-20 12:16:53 UTC
The OPENSSL_STACK issue can be resolved with a simple addition at the top of the openssl11.h file

As taken from: https://github.com/openssl/openssl/blob/master/include/openssl/stack.h#L17

> # LibreSSL 2.7 has stack_st but not OPENSSL_STACK
> #ifndef OPENSSL_STACK
> typedef struct stack_st OPENSSL_STACK; /* Use STACK_OF(...) instead */
> #endif

OPENSSL_INIT_SETTINGS is not defined in Libre but it is void in the signatures, so  this works

> #ifndef OPENSSL_INIT_SETTINGS
> #define OPENSSL_INIT_SETTINGS void
> #endif

Ended up with 
> 78 #if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x20700000L
> 79 // LibreSSL 2.7 has stack_st but not OPENSSL_STACK
> 80 typedef struct stack_st OPENSSL_STACK; /* Use STACK_OF(...) instead */
> 81 // From the signature in LibreSSL
> 82 #define OPENSSL_INIT_SETTINGS void
> 83 // https://github.com/openssl/openssl/blob/master/include/openssl/x509_vfy.h#L63
> 84 typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *);
> 85 #endif
in work/qtbase-everywhere-src-5.10.1/src/network/ssl/qsslsocket_openssl11_symbols_p.h

That leaves the BN_is_word and BN_abs_is_word to be solved.
Comment 14 Walter Schwarzenfeld freebsd_triage 2018-05-20 12:46:16 UTC
(In reply to Bernard Spil from comment #13)
Sorry, but I cannot find any "openssl11.h".
Comment 15 Bernard Spil freebsd_committer 2018-05-20 12:53:11 UTC
Created attachment 193559 [details]
svn diff for net/qt5-network

Can you please test and see if this is complete?
Comment 16 Bernard Spil freebsd_committer 2018-05-20 12:54:38 UTC
(In reply to Matthew Seaman from comment #10)
Then I must assume my patch is also incomplete, I haven't touched these functions in my patch :'(
Comment 17 Walter Schwarzenfeld freebsd_triage 2018-05-20 13:08:29 UTC
(In reply to Bernard Spil from comment #13)
Sorry, but I cannot find any "openssl11.h". (In reply to w.schwarzenfeld from comment #14)

This was a misunderstood (=> Ended up...).
Comment 18 Walter Schwarzenfeld freebsd_triage 2018-05-20 13:13:19 UTC
(In reply to Bernard Spil from comment #16)

Seens you also overlooked comment #6.
Comment 19 Walter Schwarzenfeld freebsd_triage 2018-05-20 13:24:56 UTC
Sorry, no this was a error in my patch. Ok.
Comment 20 Ralf van der Enden 2018-05-20 19:30:17 UTC
For what it's worth I tested Bernard Spil's patch with both libressl and openssl-base with qbittorrent, and works fine with either.
Comment 21 Bernard Spil freebsd_committer 2018-05-21 11:43:38 UTC
At least there's an unambiguous answer from upstream.

https://bugreports.qt.io/browse/QTBUG-68374
> Timur Pocheptsov added a comment - 1 hour ago
> We don't support LibreSSL.
> Closed, Invalid
Comment 22 Charlie Li 2018-05-24 16:10:05 UTC
Given upstream's terse response to not supporting libressl, plus our (and OpenBSD and a few others') want to continue supporting this combination, I think we will need to carry these patches ourselves.

In any case, these patches work as intended.
Comment 23 Tobias C. Berner freebsd_committer 2018-05-24 16:31:09 UTC
Hm, that is rather disappointing as responses go.
Comment 24 Kirill Ponomarev freebsd_committer 2018-05-24 20:43:08 UTC
If patches work for both OpenSSL and LibreSSL - please commit it.
Comment 25 Tobias C. Berner freebsd_committer 2018-05-24 20:45:48 UTC
So it's just that little diff that is needed for libressl?
Comment 26 Matthew Seaman freebsd_committer 2018-05-25 00:07:21 UTC
Unfortunately these latest patches don't work for me trying to build quassel-core linked against libressl.  Same outcomes as in my earlier comment (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228344#c10)
Comment 27 Eugene 2018-05-28 13:48:33 UTC
Created attachment 193786 [details]
changed patch
Comment 28 Eugene 2018-05-28 13:50:52 UTC
(In reply to Bernard Spil from comment #13)

Patch works, but you need to change existing patch files/patch-src_network_ssl_qsslsocket__openssl__symbols__p.h

-#if !defined(BN_is_word)
+#if !defined(BN_is_word) || defined(LIBRESSL_VERSION_NUMBER)
Comment 29 Walter Schwarzenfeld freebsd_triage 2018-05-28 14:06:35 UTC
no:

quasselcore &                                          [2] 1595
ngorx@newgorx:/usr/ports/net/qt5-network % qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_new_null
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_push
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_free
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_num
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_pop_free
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_value
qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_options
qt.network.ssl: QSslSocket: cannot resolve SSL_session_reused
qt.network.ssl: QSslSocket: cannot resolve X509_get_version
qt.network.ssl: QSslSocket: cannot resolve DSA_bits
qt.network.ssl: QSslSocket: cannot call unresolved function OPENSSL_sk_num
Comment 30 Tobias C. Berner freebsd_committer 2018-06-16 08:53:53 UTC
Ping
Comment 31 Walter Schwarzenfeld freebsd_triage 2018-06-16 09:14:30 UTC
Maybe, it did something wrong. The error messages did not appear anymore with this patch. Seems to work.
Comment 32 Tobias C. Berner freebsd_committer 2018-06-22 17:29:18 UTC
Hi all

We're working on qt5 5.11 at the moment here 
https://github.com/freebsd/freebsd-ports-kde/tree/qt5-5.11.1

If someone can fix up a patch for libressl we can have it included in the update.


mfg Tobias
Comment 33 Piotr Kubaj freebsd_committer 2018-08-15 10:43:21 UTC
(In reply to Tobias C. Berner from comment #32)
There is a patch that works at https://github.com/gentoo/libressl/blob/master/dev-qt/qtnetwork/files/qtnetwork-5.11.1-libressl.patch
Comment 34 Walter Schwarzenfeld freebsd_triage 2018-09-09 18:14:14 UTC
Created attachment 196989 [details]
patch-qsslsocket__openssl__symbols.cpp

Needs additional patch.
Comment 35 jakub_lach 2018-09-09 18:26:38 UTC
(In reply to w.schwarzenfeld from comment #34)

Could you provide a unified 5.11 patch against a ports tree, and mark the rest as a obsolete?
Comment 36 Walter Schwarzenfeld freebsd_triage 2018-09-09 22:35:01 UTC
Created attachment 196994 [details]
svn-diff-qt5-network-5.11.1
Comment 37 jakub_lach 2018-09-09 23:14:41 UTC
(In reply to w.schwarzenfeld from comment #36)

Thanks! A lot clearer now, compiles ok.
Comment 38 jakub_lach 2018-10-21 09:25:30 UTC
FWIW unfortunately, patch needs correction for 5.11.2
Comment 39 Walter Schwarzenfeld freebsd_triage 2018-10-21 13:56:10 UTC
(In reply to jakub_lach from comment #38)
Sorry, in the moment I am tired to play with "ssl". I use a package or set
CONFIGURE_ARGS= -no-gui -no-xcb -no-openssl
(I know this not really a solution).
Comment 40 jakub_lach 2018-10-21 14:53:36 UTC
That's understandable, I just hope this situation will be resolved somehow in ports, as qt5 unfortunately explicitly refused to support LibreSSL.
Comment 41 Walter Schwarzenfeld freebsd_triage 2018-10-21 17:26:48 UTC
Created attachment 198438 [details]
patch-libressl_v2

New try. Not sure if patch-src_networt_ssl_qsslcontext_openssl11.cpp is right.
Comment 42 Tobias C. Berner freebsd_committer 2018-10-21 17:39:11 UTC
(In reply to w.schwarzenfeld from comment #41)
And that exactly is the big problem with all these SSL patches :-)
Comment 43 Walter Schwarzenfeld freebsd_triage 2018-10-21 18:08:48 UTC
Created attachment 198440 [details]
patch-libressl_v3

No, was wrong.
Comment 44 Ralf van der Enden 2018-10-22 09:00:58 UTC
(In reply to w.schwarzenfeld from comment #43)

The v3 patch works fine for me in combination with qbittorrent. Thanks.
Comment 45 jakub_lach 2018-10-22 13:01:04 UTC
(In reply to w.schwarzenfeld from comment #43)
Thanks!
Comment 46 Tobias C. Berner freebsd_committer 2018-10-23 05:15:35 UTC
The patch replaces %%OPENSSLLIB%% with /usr/local/lib ... that seems like an unwanted change.
Comment 47 Walter Schwarzenfeld freebsd_triage 2018-10-23 10:46:58 UTC
Created attachment 198490 [details]
patch-libressl_v4

Path corrected.
Comment 48 Walter Schwarzenfeld freebsd_triage 2018-10-23 10:57:43 UTC
Created attachment 198491 [details]
patch-libressl_v5

Was an error in .
Comment 49 Tobias C. Berner freebsd_committer 2018-10-24 19:17:30 UTC
Please readd the comments that were deleted in the top of the patches, and also extend them to describe //why// the new hunks are added.
Comment 50 Walter Schwarzenfeld freebsd_triage 2018-10-24 19:38:05 UTC
I think 
#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)

is explanation enough.
Comment 51 Walter Schwarzenfeld freebsd_triage 2018-10-24 20:32:26 UTC
Created attachment 198600 [details]
patch-libressl_v6

Ok, put the deleted comments back.
Comment 52 Walter Schwarzenfeld freebsd_triage 2018-10-24 20:41:34 UTC
I have no clue what should I write in as comment.
Comment 53 jakub_lach 2018-10-24 21:45:31 UTC
(In reply to w.schwarzenfeld from comment #52)

patch(1) has some problems with recognizing v6
Comment 54 Walter Schwarzenfeld freebsd_triage 2018-10-24 22:33:35 UTC
Created attachment 198607 [details]
patch-libressl_v7

This should work.
Comment 55 Walter Schwarzenfeld freebsd_triage 2018-10-24 22:43:12 UTC
Created attachment 198610 [details]
patch-libressl_v8_with_comments

Is it that what was you mean with comments?
Comment 56 Walter Schwarzenfeld freebsd_triage 2018-10-24 22:47:24 UTC
Created attachment 198611 [details]
patch-libressl_v8.1_with_comments

Was a typo in.
Comment 57 Tobias C. Berner freebsd_committer 2018-10-25 04:05:15 UTC
(In reply to w.schwarzenfeld from comment #56)
Mostly... Still I would have liked a comment on why you define various things like

TLS1_2_VERSION


Mfg Tobias
Comment 58 Walter Schwarzenfeld freebsd_triage 2018-10-25 08:47:20 UTC
Created attachment 198618 [details]
patch-libressl_v9

Definitions for TLS_VERSIONS needed for  qsslcontext_openssl11.cpp (QSslContext::initSslContext)
Comment 59 Walter Schwarzenfeld freebsd_triage 2018-10-25 08:52:21 UTC
Bernard Spil used it in the same way inBug #230884, comment 1 for 5.11.1 (was never committed).
Comment 60 dave 2018-11-26 18:29:51 UTC
Just some feedback, this patch worked to allow net/qt5-network to build off of ports/HEAD. Thank you!
Comment 61 commit-hook freebsd_committer 2018-11-26 20:30:02 UTC
A commit references this bug:

Author: tcberner
Date: Mon Nov 26 20:29:02 UTC 2018
New revision: 485965
URL: https://svnweb.freebsd.org/changeset/ports/485965

Log:
  net/qt5-network: fix build with LibreSSL

  PR:		228344
  Submitted by:	Walter Schwarzenfeld <w.schwarzenfeld@utanet.at>

Changes:
  head/net/qt5-network/Makefile
  head/net/qt5-network/files/patch-qsslcontext_openssl.cpp
  head/net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols.cpp
  head/net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols__p.h