diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2019-02-27 20:07:04 +0100 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2019-02-27 20:07:04 +0100 |
commit | 05ef2e7b732a8571f2d4ef84659b7f972a8cd90e (patch) | |
tree | 361abf9f66052d99eaf79856e33b750bda1de718 /dev-libs | |
parent | sys-kernel/gentoo-sources: Clean-up of 4.4.X series (diff) | |
download | gentoo-05ef2e7b732a8571f2d4ef84659b7f972a8cd90e.tar.gz gentoo-05ef2e7b732a8571f2d4ef84659b7f972a8cd90e.tar.bz2 gentoo-05ef2e7b732a8571f2d4ef84659b7f972a8cd90e.zip |
dev-libs/openssl: fix USE=bindist
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'dev-libs')
-rw-r--r-- | dev-libs/openssl/files/openssl-1.1.1b-ec-curves-patch.patch | 207 | ||||
-rw-r--r-- | dev-libs/openssl/openssl-1.1.1b-r1.ebuild (renamed from dev-libs/openssl/openssl-1.1.1b.ebuild) | 8 |
2 files changed, 214 insertions, 1 deletions
diff --git a/dev-libs/openssl/files/openssl-1.1.1b-ec-curves-patch.patch b/dev-libs/openssl/files/openssl-1.1.1b-ec-curves-patch.patch new file mode 100644 index 000000000000..c1f53c838230 --- /dev/null +++ b/dev-libs/openssl/files/openssl-1.1.1b-ec-curves-patch.patch @@ -0,0 +1,207 @@ +Based on openssl-1.1.1-ec-curves.patch. + +Updated for OpenSSL change b6d41ff73392df5af9c931c902ae4cd75c5b61ea. + +--- a/apps/speed.c ++++ b/apps/speed.c +@@ -489,82 +489,28 @@ static const OPT_PAIR rsa_choices[] = { + static double rsa_results[RSA_NUM][2]; /* 2 ops: sign then verify */ + #endif /* OPENSSL_NO_RSA */ + +-#define R_EC_P160 0 +-#define R_EC_P192 1 +-#define R_EC_P224 2 +-#define R_EC_P256 3 +-#define R_EC_P384 4 +-#define R_EC_P521 5 +-#define R_EC_K163 6 +-#define R_EC_K233 7 +-#define R_EC_K283 8 +-#define R_EC_K409 9 +-#define R_EC_K571 10 +-#define R_EC_B163 11 +-#define R_EC_B233 12 +-#define R_EC_B283 13 +-#define R_EC_B409 14 +-#define R_EC_B571 15 +-#define R_EC_BRP256R1 16 +-#define R_EC_BRP256T1 17 +-#define R_EC_BRP384R1 18 +-#define R_EC_BRP384T1 19 +-#define R_EC_BRP512R1 20 +-#define R_EC_BRP512T1 21 +-#define R_EC_X25519 22 +-#define R_EC_X448 23 ++#define R_EC_P224 0 ++#define R_EC_P256 1 ++#define R_EC_P384 2 ++#define R_EC_P521 3 ++#define R_EC_X25519 4 ++#define R_EC_X448 5 + #ifndef OPENSSL_NO_EC + static OPT_PAIR ecdsa_choices[] = { +- {"ecdsap160", R_EC_P160}, +- {"ecdsap192", R_EC_P192}, + {"ecdsap224", R_EC_P224}, + {"ecdsap256", R_EC_P256}, + {"ecdsap384", R_EC_P384}, + {"ecdsap521", R_EC_P521}, +- {"ecdsak163", R_EC_K163}, +- {"ecdsak233", R_EC_K233}, +- {"ecdsak283", R_EC_K283}, +- {"ecdsak409", R_EC_K409}, +- {"ecdsak571", R_EC_K571}, +- {"ecdsab163", R_EC_B163}, +- {"ecdsab233", R_EC_B233}, +- {"ecdsab283", R_EC_B283}, +- {"ecdsab409", R_EC_B409}, +- {"ecdsab571", R_EC_B571}, +- {"ecdsabrp256r1", R_EC_BRP256R1}, +- {"ecdsabrp256t1", R_EC_BRP256T1}, +- {"ecdsabrp384r1", R_EC_BRP384R1}, +- {"ecdsabrp384t1", R_EC_BRP384T1}, +- {"ecdsabrp512r1", R_EC_BRP512R1}, +- {"ecdsabrp512t1", R_EC_BRP512T1} + }; + # define ECDSA_NUM OSSL_NELEM(ecdsa_choices) + + static double ecdsa_results[ECDSA_NUM][2]; /* 2 ops: sign then verify */ + + static const OPT_PAIR ecdh_choices[] = { +- {"ecdhp160", R_EC_P160}, +- {"ecdhp192", R_EC_P192}, + {"ecdhp224", R_EC_P224}, + {"ecdhp256", R_EC_P256}, + {"ecdhp384", R_EC_P384}, + {"ecdhp521", R_EC_P521}, +- {"ecdhk163", R_EC_K163}, +- {"ecdhk233", R_EC_K233}, +- {"ecdhk283", R_EC_K283}, +- {"ecdhk409", R_EC_K409}, +- {"ecdhk571", R_EC_K571}, +- {"ecdhb163", R_EC_B163}, +- {"ecdhb233", R_EC_B233}, +- {"ecdhb283", R_EC_B283}, +- {"ecdhb409", R_EC_B409}, +- {"ecdhb571", R_EC_B571}, +- {"ecdhbrp256r1", R_EC_BRP256R1}, +- {"ecdhbrp256t1", R_EC_BRP256T1}, +- {"ecdhbrp384r1", R_EC_BRP384R1}, +- {"ecdhbrp384t1", R_EC_BRP384T1}, +- {"ecdhbrp512r1", R_EC_BRP512R1}, +- {"ecdhbrp512t1", R_EC_BRP512T1}, + {"ecdhx25519", R_EC_X25519}, + {"ecdhx448", R_EC_X448} + }; +@@ -1495,29 +1441,10 @@ int speed_main(int argc, char **argv) + unsigned int bits; + } test_curves[] = { + /* Prime Curves */ +- {"secp160r1", NID_secp160r1, 160}, +- {"nistp192", NID_X9_62_prime192v1, 192}, + {"nistp224", NID_secp224r1, 224}, + {"nistp256", NID_X9_62_prime256v1, 256}, + {"nistp384", NID_secp384r1, 384}, + {"nistp521", NID_secp521r1, 521}, +- /* Binary Curves */ +- {"nistk163", NID_sect163k1, 163}, +- {"nistk233", NID_sect233k1, 233}, +- {"nistk283", NID_sect283k1, 283}, +- {"nistk409", NID_sect409k1, 409}, +- {"nistk571", NID_sect571k1, 571}, +- {"nistb163", NID_sect163r2, 163}, +- {"nistb233", NID_sect233r1, 233}, +- {"nistb283", NID_sect283r1, 283}, +- {"nistb409", NID_sect409r1, 409}, +- {"nistb571", NID_sect571r1, 571}, +- {"brainpoolP256r1", NID_brainpoolP256r1, 256}, +- {"brainpoolP256t1", NID_brainpoolP256t1, 256}, +- {"brainpoolP384r1", NID_brainpoolP384r1, 384}, +- {"brainpoolP384t1", NID_brainpoolP384t1, 384}, +- {"brainpoolP512r1", NID_brainpoolP512r1, 512}, +- {"brainpoolP512t1", NID_brainpoolP512t1, 512}, + /* Other and ECDH only ones */ + {"X25519", NID_X25519, 253}, + {"X448", NID_X448, 448} +@@ -2017,9 +1944,9 @@ int speed_main(int argc, char **argv) + # endif + + # ifndef OPENSSL_NO_EC +- ecdsa_c[R_EC_P160][0] = count / 1000; +- ecdsa_c[R_EC_P160][1] = count / 1000 / 2; +- for (i = R_EC_P192; i <= R_EC_P521; i++) { ++ ecdsa_c[R_EC_P224][0] = count / 1000; ++ ecdsa_c[R_EC_P224][1] = count / 1000 / 2; ++ for (i = R_EC_P256; i <= R_EC_P521; i++) { + ecdsa_c[i][0] = ecdsa_c[i - 1][0] / 2; + ecdsa_c[i][1] = ecdsa_c[i - 1][1] / 2; + if (ecdsa_doit[i] <= 1 && ecdsa_c[i][0] == 0) +@@ -2031,6 +1958,7 @@ int speed_main(int argc, char **argv) + } + } + } ++#if 0 + ecdsa_c[R_EC_K163][0] = count / 1000; + ecdsa_c[R_EC_K163][1] = count / 1000 / 2; + for (i = R_EC_K233; i <= R_EC_K571; i++) { +@@ -2059,9 +1987,9 @@ int speed_main(int argc, char **argv) + } + } + } +- +- ecdh_c[R_EC_P160][0] = count / 1000; +- for (i = R_EC_P192; i <= R_EC_P521; i++) { ++#endif ++ ecdh_c[R_EC_P224][0] = count / 1000; ++ for (i = R_EC_P256; i <= R_EC_P521; i++) { + ecdh_c[i][0] = ecdh_c[i - 1][0] / 2; + if (ecdh_doit[i] <= 1 && ecdh_c[i][0] == 0) + ecdh_doit[i] = 0; +@@ -2071,6 +1999,7 @@ int speed_main(int argc, char **argv) + } + } + } ++#if 0 + ecdh_c[R_EC_K163][0] = count / 1000; + for (i = R_EC_K233; i <= R_EC_K571; i++) { + ecdh_c[i][0] = ecdh_c[i - 1][0] / 2; +@@ -2116,6 +2045,7 @@ int speed_main(int argc, char **argv) + } + } + } ++#endif + /* default iteration count for the last two EC Curves */ + ecdh_c[R_EC_X25519][0] = count / 1800; + ecdh_c[R_EC_X448][0] = count / 7200; +--- a/crypto/ec/ecp_smpl.c ++++ b/crypto/ec/ecp_smpl.c +@@ -145,6 +145,11 @@ int ec_GFp_simple_group_set_curve(EC_GROUP *group, + return 0; + } + ++ if (BN_num_bits(p) < 224) { ++ ECerr(EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE, EC_R_UNSUPPORTED_FIELD); ++ return 0; ++ } ++ + if (ctx == NULL) { + ctx = new_ctx = BN_CTX_new(); + if (ctx == NULL) +--- a/test/ecdsatest.c ++++ b/test/ecdsatest.c +@@ -176,6 +176,7 @@ static int x9_62_tests(void) + if (!change_rand()) + goto x962_err; + ++#if 0 + if (!TEST_true(x9_62_test_internal(NID_X9_62_prime192v1, + "3342403536405981729393488334694600415596881826869351677613", + "5735822328888155254683894997897571951568553642892029982342"))) +@@ -186,6 +187,7 @@ static int x9_62_tests(void) + "3238135532097973577080787768312505059318910517550078427819" + "78505179448783"))) + goto x962_err; ++#endif + + # ifndef OPENSSL_NO_EC2M + if (!TEST_true(x9_62_test_internal(NID_X9_62_c2tnb191v1, diff --git a/dev-libs/openssl/openssl-1.1.1b.ebuild b/dev-libs/openssl/openssl-1.1.1b-r1.ebuild index ad888b7d6a65..5e05c9dcab04 100644 --- a/dev-libs/openssl/openssl-1.1.1b.ebuild +++ b/dev-libs/openssl/openssl-1.1.1b-r1.ebuild @@ -64,12 +64,18 @@ src_prepare() { for i in "${FEDORA_SOURCE[@]}" ; do cp -f "${DISTDIR}"/"${P}_${i}" "${WORKDIR}"/"${i}" || die done + # .spec %prep bash "${WORKDIR}"/"${SOURCE1}" || die cp -f "${WORKDIR}"/"${SOURCE12}" "${S}"/crypto/ec/ || die cp -f "${WORKDIR}"/"${SOURCE13}" "${S}"/test/ || die for i in "${FEDORA_PATCH[@]}" ; do - eapply "${DISTDIR}"/"${i}" + if [[ "${i}" == "${PATCH37}" ]] ; then + # apply our own for OpenSSL 1.1.1b adjusted version of this patch + eapply "${FILESDIR}"/openssl-1.1.1b-ec-curves-patch.patch + else + eapply "${DISTDIR}"/"${i}" + fi done # Also see the configure parts below: # enable-ec \ |