From 635e8294364e08c813392966a61a4f39e8ac03a9 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Wed, 22 Sep 2021 16:00:31 -0400 Subject: ffs 11.14 rc1 --- freefilesync/debian/patches/ffs_icon_loader.patch | 20 +++++ freefilesync/debian/patches/ffs_openssl.patch | 103 ++++++++++++++++++++++ freefilesync/debian/patches/series | 2 + 3 files changed, 125 insertions(+) create mode 100644 freefilesync/debian/patches/ffs_icon_loader.patch create mode 100644 freefilesync/debian/patches/ffs_openssl.patch (limited to 'freefilesync/debian/patches') diff --git a/freefilesync/debian/patches/ffs_icon_loader.patch b/freefilesync/debian/patches/ffs_icon_loader.patch new file mode 100644 index 0000000..2575ec5 --- /dev/null +++ b/freefilesync/debian/patches/ffs_icon_loader.patch @@ -0,0 +1,20 @@ +Summary: Solve libglib2.0 problem in sketchy manner +Date: 2021-09-22 +Version: 11.14 +Author: bgstack15 +Message: +Warning! I have absolutely no idea what I am doing. Check https://freefilesync.org/forum/viewtopic.php?t=8780 for future developments. +In Devuan Ceres, starting in 2021-08 with libglib2.0-0=2.68.3-2 the file icon_loader.cpp fails to compile. By removing the static_cast, this file can compile. The built application throws all sorts of GLib-GObject-CRITICIAL messages but the application operates. +Downgrade to "deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/20210801T144205Z/ unstable main non-free contrib" in /etc/apt/sources.list and install the exact libglib version necessary to compile without this patch. +$ sudo apt-get -V install libglib2.0-0=2.66.8-1 libglib2.0-bin=2.66.8-1 libglib2.0-data=2.66.8-1 libglib2.0-dev=2.66.8-1 libglib2.0-dev-bin=2.66.8-1 libglib2.0-0:i386=2.66.8-1 +--- 11.13-0/FreeFileSync/Source/base/icon_loader.cpp 2021-09-22 07:35:40.991208133 -0400 ++++ 11.14-0/FreeFileSync/Source/base/icon_loader.cpp 2021-09-22 14:40:10.981215352 -0400 +@@ -216,7 +216,7 @@ + //the remaining icon types won't block! + assert(GDK_IS_PIXBUF(gicon) || G_IS_THEMED_ICON(gicon) || G_IS_EMBLEMED_ICON(gicon)); + +- return FileIconHolder(static_cast(::g_object_ref(gicon)) /*pass ownership*/, maxSize); ++ return FileIconHolder(gicon /*pass ownership*/, maxSize); + + } + diff --git a/freefilesync/debian/patches/ffs_openssl.patch b/freefilesync/debian/patches/ffs_openssl.patch new file mode 100644 index 0000000..47fd5cc --- /dev/null +++ b/freefilesync/debian/patches/ffs_openssl.patch @@ -0,0 +1,103 @@ +Summary: Revert 11.14 openssl 3.0.0 usage +Author: bgstack15 +Date: 2021-09-22 +Version: 11.14 +Message: Zenju updated FreeFileSync 11.14 to use openssl 3.0.0 but my distros are not ready for that. By reverting to the 11.13 logic, the application can compile against openssl 1.1.1l as before. +diff -aur 11.13/zen/open_ssl.cpp 11.14/zen/open_ssl.cpp +--- 11.13/zen/open_ssl.cpp ++++ 11.14/zen/open_ssl.cpp +@@ -179,9 +179,9 @@ std::shared_ptr streamToKey(const std::string& keyStream, RsaStreamTyp + + //================================================================================ + +-using EvpToBioFunc = int (*)(BIO* bio, const EVP_PKEY* evp); ++using EvpToBioFunc = int (*)(BIO* bio, EVP_PKEY* evp); + +-std::string evpKeyToStream(const EVP_PKEY* evp, EvpToBioFunc evpToBio, const char* functionName) //throw SysError ++std::string evpKeyToStream(EVP_PKEY* evp, EvpToBioFunc evpToBio, const char* functionName) //throw SysError + { + BIO* bio = ::BIO_new(BIO_s_mem()); + if (!bio) +@@ -205,16 +205,16 @@ std::string evpKeyToStream(const EVP_PKEY* evp, EvpToBioFunc evpToBio, const cha + } + + +-using RsaToBioFunc = int (*)(BIO* bp, const RSA* x); ++using RsaToBioFunc = int (*)(BIO* bp, RSA* x); + +-std::string evpKeyToStream(const EVP_PKEY* evp, RsaToBioFunc rsaToBio, const char* functionName) //throw SysError ++std::string evpKeyToStream(EVP_PKEY* evp, RsaToBioFunc rsaToBio, const char* functionName) //throw SysError + { + BIO* bio = ::BIO_new(BIO_s_mem()); + if (!bio) + throw SysError(formatLastOpenSSLError("BIO_new")); + ZEN_ON_SCOPE_EXIT(::BIO_free_all(bio)); + +- const RSA* rsa = ::EVP_PKEY_get0_RSA(evp); //unowned reference! ++ RSA* rsa = ::EVP_PKEY_get0_RSA(evp); //unowned reference! + if (!rsa) + throw SysError(formatLastOpenSSLError("EVP_PKEY_get0_RSA")); + +@@ -236,33 +236,33 @@ std::string evpKeyToStream(const EVP_PKEY* evp, RsaToBioFunc rsaToBio, const cha + + + //fix OpenSSL API inconsistencies: +-int PEM_write_bio_PrivateKey2(BIO* bio, const EVP_PKEY* key) ++int PEM_write_bio_PrivateKey2(BIO* bio, EVP_PKEY* key) + { + return ::PEM_write_bio_PrivateKey(bio, //BIO* bp +- key, //const EVP_PKEY* x ++ key, //EVP_PKEY* x + nullptr, //const EVP_CIPHER* enc +- nullptr, //const unsigned char* kstr ++ nullptr, //unsigned char* kstr + 0, //int klen + nullptr, //pem_password_cb* cb + nullptr); //void* u + } + +-int PEM_write_bio_RSAPrivateKey2(BIO* bio, const RSA* rsa) ++int PEM_write_bio_RSAPrivateKey2(BIO* bio, RSA* rsa) + { + return ::PEM_write_bio_RSAPrivateKey(bio, //BIO* bp +- rsa, //const RSA* x ++ rsa, //RSA* x + nullptr, //const EVP_CIPHER* enc +- nullptr, //const unsigned char* kstr ++ nullptr, //unsigned char* kstr + 0, //int klen + nullptr, //pem_password_cb* cb + nullptr); //void* u + } + +-int PEM_write_bio_RSAPublicKey2(BIO* bio, const RSA* rsa) { return ::PEM_write_bio_RSAPublicKey(bio, rsa); } ++int PEM_write_bio_RSAPublicKey2(BIO* bio, RSA* rsa) { return ::PEM_write_bio_RSAPublicKey(bio, rsa); } + + //-------------------------------------------------------------------------------- + +-std::string keyToStream(const EVP_PKEY* evp, RsaStreamType streamType, bool publicKey) //throw SysError ++std::string keyToStream(EVP_PKEY* evp, RsaStreamType streamType, bool publicKey) //throw SysError + { + switch (streamType) + { +@@ -571,15 +571,15 @@ public: + if (sslError == SSL_ERROR_ZERO_RETURN) + return 0; //EOF + close_notify alert + +-#if OPENSSL_VERSION_NUMBER >= 0x30000000L /*OpenSSL 3.0.0*/ || \ +- OPENSSL_VERSION_NUMBER == 0x1010105fL /*OpenSSL 1.1.1e*/ ++#if OPENSSL_VERSION_NUMBER == 0x1010105fL //OpenSSL 1.1.1e + const auto ec = ::ERR_peek_last_error(); + if (sslError == SSL_ERROR_SSL && ERR_GET_REASON(ec) == SSL_R_UNEXPECTED_EOF_WHILE_READING) //EOF: only expected for HTTP/1.0 +-#else //obsolete handling: https://github.com/openssl/openssl/issues/10880#issuecomment-575746226 ++ return 0; ++#else //obsolete handling, at least in OpenSSL 1.1.1e (but valid again with OpenSSL 1.1.1f!) ++ //https://github.com/openssl/openssl/issues/10880#issuecomment-575746226 + if ((sslError == SSL_ERROR_SYSCALL && ::ERR_peek_last_error() == 0)) //EOF: only expected for HTTP/1.0 +-#endif + return 0; +- ++#endif + throw SysError(formatLastOpenSSLError("SSL_read_ex") + L' ' + getSslErrorLiteral(sslError)); + } + assert(bytesReceived > 0); //SSL_read_ex() considers EOF an error! diff --git a/freefilesync/debian/patches/series b/freefilesync/debian/patches/series index 7a709ef..92dd680 100644 --- a/freefilesync/debian/patches/series +++ b/freefilesync/debian/patches/series @@ -10,3 +10,5 @@ revert_zenju_aggressive_upstreamisms.patch ffs_gcc.patch ffs_traditional_view.patch ffs_desktop_notifications.patch +ffs_openssl.patch +ffs_icon_loader.patch -- cgit