Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/botan/files/, dev-libs/botan/
Date: Tue, 26 May 2020 20:18:59
Message-Id: 1590524286.39b70c6fefb87ece3dbc552591ffbda0bb8945ad.whissi@gentoo
1 commit: 39b70c6fefb87ece3dbc552591ffbda0bb8945ad
2 Author: Sam James (sam_c) <sam <AT> cmpct <DOT> info>
3 AuthorDate: Wed May 20 13:25:50 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue May 26 20:18:06 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39b70c6f
7
8 dev-libs/botan: Fix tests with USE=bindist
9
10 Include 2 upstream patches for fixing tests
11 in some configurations. Seems to only affect
12 Gentoo with USE=bindist because that's when
13 ECDSA is disabled.
14
15 Closes: https://bugs.gentoo.org/723320
16 Package-Manager: Portage-2.3.99, Repoman-2.3.22
17 Signed-off-by: Sam James (sam_c) <sam <AT> cmpct.info>
18 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
19
20 dev-libs/botan/botan-2.14.0-r1.ebuild | 4 +
21 .../files/botan-2.14.0-bindist-test-fix.patch | 91 ++++++++++++++++++++++
22 2 files changed, 95 insertions(+)
23
24 diff --git a/dev-libs/botan/botan-2.14.0-r1.ebuild b/dev-libs/botan/botan-2.14.0-r1.ebuild
25 index 242a808d5ed..61d86ec2499 100644
26 --- a/dev-libs/botan/botan-2.14.0-r1.ebuild
27 +++ b/dev-libs/botan/botan-2.14.0-r1.ebuild
28 @@ -37,6 +37,10 @@ BDEPEND="
29 doc? ( dev-python/sphinx )
30 "
31
32 +PATCHES=(
33 + "${FILESDIR}/${P}-bindist-test-fix.patch"
34 +)
35 +
36 src_configure() {
37 local disable_modules=()
38 use boost || disable_modules+=( "boost" )
39
40 diff --git a/dev-libs/botan/files/botan-2.14.0-bindist-test-fix.patch b/dev-libs/botan/files/botan-2.14.0-bindist-test-fix.patch
41 new file mode 100644
42 index 00000000000..35b17976dbd
43 --- /dev/null
44 +++ b/dev-libs/botan/files/botan-2.14.0-bindist-test-fix.patch
45 @@ -0,0 +1,91 @@
46 +https://github.com/randombit/botan/commit/df73ee690c5795be586cd4df3e33253113a0dcdf
47 +https://github.com/randombit/botan/commit/d9d6d7a593da135d2046aeb8a9e05e967d90f538
48 +
49 +diff --git a/src/tests/test_pkcs11_high_level.cpp b/src/tests/test_pkcs11_high_level.cpp
50 +index 47a5bf5e56..07dc86ef21 100644
51 +--- a/src/tests/test_pkcs11_high_level.cpp
52 ++++ b/src/tests/test_pkcs11_high_level.cpp
53 +@@ -909,6 +909,15 @@ BOTAN_REGISTER_TEST("pkcs11-rsa", PKCS11_RSA_Tests);
54 +
55 + /***************************** PKCS11 ECDSA *****************************/
56 +
57 ++#if defined(BOTAN_HAS_ECC_GROUP)
58 ++std::vector<uint8_t> encode_ec_point_in_octet_str(const Botan::PointGFp& point)
59 ++ {
60 ++ std::vector<uint8_t> enc;
61 ++ DER_Encoder(enc).encode(point.encode(PointGFp::UNCOMPRESSED), OCTET_STRING);
62 ++ return enc;
63 ++ }
64 ++#endif
65 ++
66 + #if defined(BOTAN_HAS_ECDSA)
67 +
68 + Test::Result test_ecdsa_privkey_import()
69 +@@ -976,13 +985,6 @@ Test::Result test_ecdsa_privkey_export()
70 + return result;
71 + }
72 +
73 +-std::vector<uint8_t> encode_ec_point_in_octet_str(const Botan::PointGFp& point)
74 +- {
75 +- std::vector<uint8_t> enc;
76 +- DER_Encoder(enc).encode(point.encode(PointGFp::UNCOMPRESSED), OCTET_STRING);
77 +- return enc;
78 +- }
79 +-
80 + Test::Result test_ecdsa_pubkey_import()
81 + {
82 + Test::Result result("PKCS11 import ECDSA public key");
83 +diff --git a/src/tests/test_pkcs11_high_level.cpp b/src/tests/test_pkcs11_high_level.cpp
84 +index 07dc86ef21..c77e8ea42e 100644
85 +--- a/src/tests/test_pkcs11_high_level.cpp
86 ++++ b/src/tests/test_pkcs11_high_level.cpp
87 +@@ -28,10 +28,14 @@
88 + #include <botan/der_enc.h>
89 + #endif
90 +
91 +-#if defined (BOTAN_HAS_PUBLIC_KEY_CRYPTO)
92 ++#if defined(BOTAN_HAS_PUBLIC_KEY_CRYPTO)
93 + #include <botan/pubkey.h>
94 + #endif
95 +
96 ++#if defined(BOTAN_HAS_ECC_GROUP)
97 ++ #include <botan/ec_group.h>
98 ++#endif
99 ++
100 + #if defined(BOTAN_HAS_RSA) && defined(BOTAN_HAS_PKCS11)
101 + #include <botan/rsa.h>
102 + #include <botan/p11_rsa.h>
103 +@@ -909,7 +913,7 @@ BOTAN_REGISTER_TEST("pkcs11-rsa", PKCS11_RSA_Tests);
104 +
105 + /***************************** PKCS11 ECDSA *****************************/
106 +
107 +-#if defined(BOTAN_HAS_ECC_GROUP)
108 ++#if defined(BOTAN_HAS_ECC_GROUP) && (defined(BOTAN_HAS_ECDSA) || defined(BOTAN_HAS_ECDH))
109 + std::vector<uint8_t> encode_ec_point_in_octet_str(const Botan::PointGFp& point)
110 + {
111 + std::vector<uint8_t> enc;
112 +diff --git a/src/tests/unit_x509.cpp b/src/tests/unit_x509.cpp
113 +index eaae358420..d9b7858898 100644
114 +--- a/src/tests/unit_x509.cpp
115 ++++ b/src/tests/unit_x509.cpp
116 +@@ -603,7 +603,7 @@ Test::Result test_verify_gost2012_cert()
117 + {
118 + Test::Result result("X509 GOST-2012 certificates");
119 +
120 +-#if defined(BOTAN_HAS_GOST_34_10_2012) && defined(BOTAN_HAS_STREEBOG)
121 ++#if defined(BOTAN_HAS_GOST_34_10_2012) && defined(BOTAN_HAS_STREEBOG) && defined(BOTAN_HAS_EMSA1)
122 + try
123 + {
124 + Botan::X509_Certificate root_cert(Test::data_file("x509/gost/gost_root.pem"));
125 +@@ -1600,6 +1600,11 @@ class X509_Cert_Unit_Tests final : public Test
126 + continue;
127 + #endif
128 +
129 ++#if !defined(BOTAN_HAS_EMSA1)
130 ++ if(algo != "RSA" && algo != "Ed25519")
131 ++ continue;
132 ++#endif
133 ++
134 + std::unique_ptr<Botan::Private_Key> key = make_a_private_key(algo);
135 +
136 + if(key == nullptr)