diff options
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 31 | ||||
-rw-r--r-- | netcpp-openssl110.patch | 90 |
3 files changed, 112 insertions, 16 deletions
@@ -1,9 +1,7 @@ -# Generated by mksrcinfo v8 -# Mon Feb 13 13:57:02 UTC 2017 pkgbase = megasync pkgdesc = Sync your files to your Mega account. Official app pkgver = 3.0.1.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/meganz/megasync arch = i686 arch = x86_64 @@ -19,9 +17,12 @@ pkgbase = megasync depends = hicolor-icon-theme depends = qt5-base depends = libuv + depends = openssl optdepends = sni-qt: fix systray issue on KDE and LXQt source = git+https://github.com/meganz/MEGAsync.git#tag=v3.0.1.0_Linux + source = netcpp-openssl110.patch md5sums = SKIP + md5sums = a0b970b4c763216cba959237f430ad76 pkgname = megasync @@ -2,24 +2,29 @@ # Maintainer: Hexchain Tong <i at hexchain dot org> pkgname=megasync pkgver=3.0.1.0 -pkgrel=1 +pkgrel=2 pkgdesc="Sync your files to your Mega account. Official app" arch=('i686' 'x86_64') url="https://github.com/meganz/megasync" license=('custom:MEGA LIMITED CODE REVIEW LICENCE') -depends=('curl' 'c-ares' 'crypto++' 'libsodium' 'hicolor-icon-theme' 'qt5-base' 'libuv') +depends=('curl' 'c-ares' 'crypto++' 'libsodium' 'hicolor-icon-theme' 'qt5-base' 'libuv' 'openssl') makedepends=('git' 'qt5-tools' 'swig' 'doxygen') optdepends=('sni-qt: fix systray issue on KDE and LXQt') -source=("git+https://github.com/meganz/MEGAsync.git#tag=v${pkgver}_Linux") -md5sums=('SKIP') +source=("git+https://github.com/meganz/MEGAsync.git#tag=v${pkgver}_Linux" + 'netcpp-openssl110.patch') +md5sums=('SKIP' + 'a0b970b4c763216cba959237f430ad76') prepare(){ - cd "$srcdir/MEGAsync" + cd "${srcdir}/MEGAsync" git submodule update --init --recursive + + cd "${srcdir}/MEGAsync/src/MEGASync/mega/src/posix" + patch < "${srcdir}/netcpp-openssl110.patch" } build(){ - cd "$srcdir/MEGAsync/src/MEGASync/mega" + cd "${srcdir}/MEGAsync/src/MEGASync/mega" ./autogen.sh ./configure \ --prefix=/usr \ @@ -38,26 +43,26 @@ build(){ --without-freeimage \ --without-termcap - cd "$srcdir/MEGAsync/src" + cd "${srcdir}/MEGAsync/src" qmake-qt5 CONFIG+="release" MEGA.pro lrelease-qt5 MEGASync/MEGASync.pro make } package (){ - cd "$srcdir/MEGAsync" - install -Dm 644 LICENCE.md "$pkgdir/usr/share/licenses/megasync/LICENCE.md" - install -Dm 644 installer/terms.txt "$pkgdir/usr/share/licenses/megasync/terms.txt" + cd "${srcdir}/MEGAsync" + install -Dm 644 LICENCE.md "${pkgdir}/usr/share/licenses/megasync/LICENCE.md" + install -Dm 644 installer/terms.txt "${pkgdir}/usr/share/licenses/megasync/terms.txt" cd src/MEGASync - install -Dm 755 megasync "$pkgdir/usr/bin/megasync" + install -Dm 755 megasync "${pkgdir}/usr/bin/megasync" cd platform/linux/data - install -Dm 644 megasync.desktop "$pkgdir/usr/share/applications/megasync.desktop" + install -Dm 644 megasync.desktop "${pkgdir}/usr/share/applications/megasync.desktop" cd icons/hicolor for size in 16x16 32x32 48x48 128x128 256x256 do - install -Dm 644 "$size/apps/mega.png" "$pkgdir/usr/share/icons/hicolor/$size/apps/mega.png" + install -Dm 644 "${size}/apps/mega.png" "${pkgdir}/usr/share/icons/hicolor/${size}/apps/mega.png" done } diff --git a/netcpp-openssl110.patch b/netcpp-openssl110.patch new file mode 100644 index 000000000000..69359515d915 --- /dev/null +++ b/netcpp-openssl110.patch @@ -0,0 +1,90 @@ +--- net.cpp.old 2017-04-25 12:21:37.489622598 +0200 ++++ net.cpp 2017-04-25 12:24:13.356284078 +0200 +@@ -2213,6 +2258,46 @@ + return CURLE_OK; + } + ++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) ++ #define X509_STORE_CTX_get0_cert(ctx) (ctx->cert) ++ #define X509_STORE_CTX_get0_untrusted(ctx) (ctx->untrusted) ++ #define EVP_PKEY_get0_DSA(_pkey_) ((_pkey_)->pkey.dsa) ++ #define EVP_PKEY_get0_RSA(_pkey_) ((_pkey_)->pkey.rsa) ++#endif ++ ++const BIGNUM *RSA_get0_n(const RSA *rsa) ++{ ++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) ++ return rsa->n; ++#else ++ const BIGNUM *result; ++ RSA_get0_key(rsa, &result, NULL, NULL); ++ return result; ++#endif ++} ++ ++const BIGNUM *RSA_get0_e(const RSA *rsa) ++{ ++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) ++ return rsa->e; ++#else ++ const BIGNUM *result; ++ RSA_get0_key(rsa, NULL, &result, NULL); ++ return result; ++#endif ++} ++ ++const BIGNUM *RSA_get0_d(const RSA *rsa) ++{ ++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) ++ return rsa->d; ++#else ++ const BIGNUM *result; ++ RSA_get0_key(rsa, NULL, NULL, &result); ++ return result; ++#endif ++} ++ + // SSL public key pinning + int CurlHttpIO::cert_verify_callback(X509_STORE_CTX* ctx, void* req) + { +@@ -2228,17 +2313,17 @@ + return 1; + } + +- if ((evp = X509_PUBKEY_get(X509_get_X509_PUBKEY(ctx->cert)))) ++ if ((evp = X509_PUBKEY_get(X509_get_X509_PUBKEY(X509_STORE_CTX_get0_cert(ctx))))) + { +- if (BN_num_bytes(evp->pkey.rsa->n) == sizeof APISSLMODULUS1 - 1 +- && BN_num_bytes(evp->pkey.rsa->e) == sizeof APISSLEXPONENT - 1) ++ if (BN_num_bytes(RSA_get0_n(EVP_PKEY_get0_RSA(evp))) == sizeof APISSLMODULUS1 - 1 ++ && BN_num_bytes(RSA_get0_e(EVP_PKEY_get0_RSA(evp))) == sizeof APISSLEXPONENT - 1) + { +- BN_bn2bin(evp->pkey.rsa->n, buf); ++ BN_bn2bin(RSA_get0_n(EVP_PKEY_get0_RSA(evp)), buf); + + if (!memcmp(request->posturl.data(), MegaClient::APIURL.data(), MegaClient::APIURL.size()) && + (!memcmp(buf, APISSLMODULUS1, sizeof APISSLMODULUS1 - 1) || !memcmp(buf, APISSLMODULUS2, sizeof APISSLMODULUS2 - 1))) + { +- BN_bn2bin(evp->pkey.rsa->e, buf); ++ BN_bn2bin(RSA_get0_e(EVP_PKEY_get0_RSA(evp)), buf); + + if (!memcmp(buf, APISSLEXPONENT, sizeof APISSLEXPONENT - 1)) + { +@@ -2253,7 +2338,7 @@ + } + else + { +- LOG_warn << "Public key size mismatch " << BN_num_bytes(evp->pkey.rsa->n) << " " << BN_num_bytes(evp->pkey.rsa->e); ++ LOG_warn << "Public key size mismatch " << BN_num_bytes(RSA_get0_n(EVP_PKEY_get0_RSA(evp))) << " " << BN_num_bytes(RSA_get0_e(EVP_PKEY_get0_RSA(evp))); + } + + EVP_PKEY_free(evp); +@@ -2275,7 +2360,7 @@ + LOG_err << "Invalid public key. Possible MITM attack!!"; + request->sslcheckfailed = true; + request->sslfakeissuer.resize(256); +- int len = X509_NAME_get_text_by_NID (X509_get_issuer_name (ctx->cert), ++ int len = X509_NAME_get_text_by_NID (X509_get_issuer_name (X509_STORE_CTX_get0_cert(ctx)), + NID_commonName, + (char *)request->sslfakeissuer.data(), + request->sslfakeissuer.size()); |