diff options
author | gmile <iamexile@gmail.com> | 2018-01-27 13:52:32 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2018-02-05 19:41:07 +0000 |
commit | 506e2411b4c61842c6a4194fa1a88c631e9822eb (patch) | |
tree | f4a8e005e433877c0d7ae40fe0d9a321900cb4db /community/erlang | |
parent | f1a0dd6c946071ef55ded5acb7d54d758fabc3ca (diff) | |
download | aports-506e2411b4c61842c6a4194fa1a88c631e9822eb.tar.bz2 aports-506e2411b4c61842c6a4194fa1a88c631e9822eb.tar.xz |
community/erlang: upgrade to 20.2.2
Diffstat (limited to 'community/erlang')
-rw-r--r-- | community/erlang/0011-fix-libressl-build.patch | 108 | ||||
-rw-r--r-- | community/erlang/APKBUILD | 10 |
2 files changed, 114 insertions, 4 deletions
diff --git a/community/erlang/0011-fix-libressl-build.patch b/community/erlang/0011-fix-libressl-build.patch new file mode 100644 index 0000000000..be81be395f --- /dev/null +++ b/community/erlang/0011-fix-libressl-build.patch @@ -0,0 +1,108 @@ +From b5b6c7695c5377b5aa474d8620df7c3e9a1ba629 Mon Sep 17 00:00:00 2001 +From: Hans Nilsson <hans@erlang.org> +Date: Thu, 11 Jan 2018 15:29:23 +0100 +Subject: [PATCH] crypto: Disable RSA sslv23 padding for LibreSSL >= 2.6.1 + +Not supported in newer LibreSSL. +--- + lib/crypto/c_src/crypto.c | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c +index 6957d257747..9a3ea07c970 100644 +--- a/lib/crypto/c_src/crypto.c ++++ b/lib/crypto/c_src/crypto.c +@@ -179,6 +179,12 @@ + # define HAVE_ECB_IVEC_BUG + #endif + ++#define HAVE_RSA_SSLV23_PADDING ++#if defined(HAS_LIBRESSL) \ ++ && LIBRESSL_VERSION_NUMBER >= PACKED_OPENSSL_VERSION_PLAIN(2,6,1) ++# undef HAVE_RSA_SSLV23_PADDING ++#endif ++ + #if defined(HAVE_CMAC) + #include <openssl/cmac.h> + #endif +@@ -659,7 +665,9 @@ static ERL_NIF_TERM atom_rsa_oaep_md; + static ERL_NIF_TERM atom_rsa_pad; /* backwards compatibility */ + static ERL_NIF_TERM atom_rsa_padding; + static ERL_NIF_TERM atom_rsa_pkcs1_pss_padding; ++#ifdef HAVE_RSA_SSLV23_PADDING + static ERL_NIF_TERM atom_rsa_sslv23_padding; ++#endif + static ERL_NIF_TERM atom_rsa_x931_padding; + static ERL_NIF_TERM atom_rsa_pss_saltlen; + static ERL_NIF_TERM atom_sha224; +@@ -1064,7 +1072,9 @@ static int initialize(ErlNifEnv* env, ERL_NIF_TERM load_info) + atom_rsa_pad = enif_make_atom(env,"rsa_pad"); /* backwards compatibility */ + atom_rsa_padding = enif_make_atom(env,"rsa_padding"); + atom_rsa_pkcs1_pss_padding = enif_make_atom(env,"rsa_pkcs1_pss_padding"); ++#ifdef HAVE_RSA_SSLV23_PADDING + atom_rsa_sslv23_padding = enif_make_atom(env,"rsa_sslv23_padding"); ++#endif + atom_rsa_x931_padding = enif_make_atom(env,"rsa_x931_padding"); + atom_rsa_pss_saltlen = enif_make_atom(env,"rsa_pss_saltlen"); + atom_sha224 = enif_make_atom(env,"sha224"); +@@ -4449,8 +4459,10 @@ static int get_pkey_crypt_options(ErlNifEnv *env, ERL_NIF_TERM algorithm, ERL_NI + opt->rsa_padding = RSA_PKCS1_PADDING; + } else if (tpl_terms[1] == atom_rsa_pkcs1_oaep_padding) { + opt->rsa_padding = RSA_PKCS1_OAEP_PADDING; ++#ifdef HAVE_RSA_SSLV23_PADDING + } else if (tpl_terms[1] == atom_rsa_sslv23_padding) { + opt->rsa_padding = RSA_SSLV23_PADDING; ++#endif + } else if (tpl_terms[1] == atom_rsa_x931_padding) { + opt->rsa_padding = RSA_X931_PADDING; + } else if (tpl_terms[1] == atom_rsa_no_padding) { +@@ -4516,7 +4528,10 @@ static ERL_NIF_TERM pkey_crypt_nif(ErlNifEnv *env, int argc, const ERL_NIF_TERM + #endif + PKeyCryptOptions crypt_opt; + ErlNifBinary in_bin, out_bin, tmp_bin; +- size_t outlen, tmplen; ++ size_t outlen; ++#ifdef HAVE_RSA_SSLV23_PADDING ++ size_t tmplen; ++#endif + int is_private = (argv[4] == atom_true), + is_encrypt = (argv[5] == atom_true); + int algo_init = 0; +@@ -4596,6 +4611,7 @@ static ERL_NIF_TERM pkey_crypt_nif(ErlNifEnv *env, int argc, const ERL_NIF_TERM + if (crypt_opt.signature_md != NULL + && EVP_PKEY_CTX_set_signature_md(ctx, crypt_opt.signature_md) <= 0) + goto badarg; ++#ifdef HAVE_RSA_SSLV23_PADDING + if (crypt_opt.rsa_padding == RSA_SSLV23_PADDING) { + if (is_encrypt) { + RSA *rsa = EVP_PKEY_get1_RSA(pkey); +@@ -4607,9 +4623,11 @@ static ERL_NIF_TERM pkey_crypt_nif(ErlNifEnv *env, int argc, const ERL_NIF_TERM + in_bin = tmp_bin; + } + if (EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_NO_PADDING) <= 0) goto badarg; +- } else { ++ } else ++#endif ++ { + if (EVP_PKEY_CTX_set_rsa_padding(ctx, crypt_opt.rsa_padding) <= 0) goto badarg; +- } ++ } + #ifdef HAVE_RSA_OAEP_MD + if (crypt_opt.rsa_padding == RSA_PKCS1_OAEP_PADDING) { + if (crypt_opt.rsa_oaep_md != NULL +@@ -4728,6 +4746,7 @@ static ERL_NIF_TERM pkey_crypt_nif(ErlNifEnv *env, int argc, const ERL_NIF_TERM + #endif + + if ((i > 0) && argv[0] == atom_rsa && !is_encrypt) { ++#ifdef HAVE_RSA_SSLV23_PADDING + if (crypt_opt.rsa_padding == RSA_SSLV23_PADDING) { + RSA *rsa = EVP_PKEY_get1_RSA(pkey); + unsigned char *p; +@@ -4745,6 +4764,7 @@ static ERL_NIF_TERM pkey_crypt_nif(ErlNifEnv *env, int argc, const ERL_NIF_TERM + i = 1; + } + } ++#endif + } + + if (tmp_bin.data != NULL) { diff --git a/community/erlang/APKBUILD b/community/erlang/APKBUILD index 1ddc5700c7..8cf19c9447 100644 --- a/community/erlang/APKBUILD +++ b/community/erlang/APKBUILD @@ -3,7 +3,7 @@ # Maintainer: Marlus Saraiva <marlus.saraiva@gmail.com> pkgname=erlang -pkgver=20.1.7 +pkgver=20.2.2 _srcver=$pkgver pkgrel=2 pkgdesc="General-purpose programming language and runtime environment" @@ -63,7 +63,8 @@ subpackages="$pkgname-dev options="!check" source="https://github.com/erlang/otp/archive/OTP-$_srcver.tar.gz 0005-Do-not-install-nteventlog-and-related-doc-files-on-n.patch - 0010-fix-nteventlog-remove.patch" + 0010-fix-nteventlog-remove.patch + 0011-fix-libressl-build.patch" builddir="$srcdir/otp-OTP-$_srcver" @@ -192,6 +193,7 @@ dev() { } -sha512sums="ba39061ee9a6c8e5d482810579a0238c748ffb193b0354a62acf109696060dfb97d61c9a60a058df8b17a8d88f7f105b81e2427b1f9ace510d83d04fa284799b OTP-20.1.7.tar.gz +sha512sums="ee2efaef1951c070467e3f6b88e46b760336c69520fbadc6cd803de1473d868770f7b4bae7d9b8e3ced7a8c0c9c46416e9b3c47a7c9dd89aa861208b7a8aa932 OTP-20.2.2.tar.gz 5d377faccd73382bc86c5aa3182767bc5d1639220c78c2f624135f597f3c823a6871ff13f6f8a109baa8a9ae5d215233b40193e5cfe07af275aa53f327e956de 0005-Do-not-install-nteventlog-and-related-doc-files-on-n.patch -bb4346dabe17115bc310837c5f0aeb367a745d8ba2159495084e599d0419fc57648d144c811306914ac48d0e087d6150a356f38640ba070642b4578acc5fe573 0010-fix-nteventlog-remove.patch" +bb4346dabe17115bc310837c5f0aeb367a745d8ba2159495084e599d0419fc57648d144c811306914ac48d0e087d6150a356f38640ba070642b4578acc5fe573 0010-fix-nteventlog-remove.patch +7af01ed80312621844a249fbcaff84955c8d4d0a2a25382242e7dbeffddc835b9d359c0d47b7fc649ac47644f972e4271adf820527dba34cb1a5abed03422de9 0011-fix-libressl-build.patch" |