Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/mbedtls/, net-libs/mbedtls/files/
Date: Tue, 21 Jan 2020 21:47:42
Message-Id: 1579643220.cb3d192572eb8381fdd0bae045034ee56917a8af.blueness@gentoo
1 commit: cb3d192572eb8381fdd0bae045034ee56917a8af
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 21 21:47:00 2020 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 21 21:47:00 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb3d1925
7
8 net-libs/mbedtls: fix bug #705038
9
10 Package-Manager: Portage-2.3.79, Repoman-2.3.16
11 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
12
13 .../files/mbedtls-dont-overwrite-headers.patch | 48 ++++++++++++++++++++++
14 ...dtls-2.18.1.ebuild => mbedtls-2.18.1-r1.ebuild} | 6 ++-
15 ...dtls-2.19.1.ebuild => mbedtls-2.19.1-r1.ebuild} | 6 ++-
16 3 files changed, 58 insertions(+), 2 deletions(-)
17
18 diff --git a/net-libs/mbedtls/files/mbedtls-dont-overwrite-headers.patch b/net-libs/mbedtls/files/mbedtls-dont-overwrite-headers.patch
19 new file mode 100644
20 index 00000000000..4e39308ac5a
21 --- /dev/null
22 +++ b/net-libs/mbedtls/files/mbedtls-dont-overwrite-headers.patch
23 @@ -0,0 +1,48 @@
24 +From de35f31091b7e6cb20ebc8d8c0afc3b20bc57098 Mon Sep 17 00:00:00 2001
25 +From: Mihai Moldovan <ionic@×××××.de>
26 +Date: Thu, 16 Jan 2020 08:59:39 +0100
27 +Subject: [PATCH] Avoid overwriting tls headers in submodule mode
28 +
29 +When crypto is embedded as a submodule and the cmake build system is
30 +used, it would previously overwrite some header files installed by tls.
31 +Most of them are harmless (since they should be identical), but config.h
32 +is a special case.
33 +
34 +tls's and crypto's config.h files differ widely in scope and overwriting
35 +the more general, bigger config.h file from tls with crypto's smaller
36 +one will make a lot of features unavailable in programs using tls.
37 +
38 +Let's just avoid overwriting any tls header in submodule mode.
39 +
40 +Note that this will not fix the potential issue that crypto might be
41 +using a different configuration than tls in the submodule case.
42 +
43 +Fixes ARMmbed/mbedtls#2965
44 +---
45 + include/CMakeLists.txt | 13 +++++++++++++
46 + 1 file changed, 13 insertions(+)
47 +
48 +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
49 +index 02f924df4..92229a221 100644
50 +--- a/include/CMakeLists.txt
51 ++++ b/include/CMakeLists.txt
52 +@@ -5,6 +5,19 @@ if(INSTALL_MBEDTLS_HEADERS)
53 + file(GLOB headers "mbedtls/*.h")
54 + file(GLOB psa_headers "psa/*.h")
55 +
56 ++ if(USE_CRYPTO_SUBMODULE)
57 ++ # Don't overwrite mbedtls's header files!
58 ++ # config.h is supposed to be automatically checked for compatibility
59 ++ # in automatic builds, while the other files should not just be
60 ++ # compatible, but also identical in theory.
61 ++ # Practically, we don't check that in crypto but just assume that the
62 ++ # submodule configuration is sane and trust tls's headers.
63 ++ list(REMOVE_ITEM headers "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls/compat-1.3.h"
64 ++ "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls/config.h"
65 ++ "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls/error.h"
66 ++ "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls/version.h")
67 ++ endif(USE_CRYPTO_SUBMODULE)
68 ++
69 + install(FILES ${headers}
70 + DESTINATION include/mbedtls
71 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
72
73 diff --git a/net-libs/mbedtls/mbedtls-2.18.1.ebuild b/net-libs/mbedtls/mbedtls-2.18.1-r1.ebuild
74 similarity index 96%
75 rename from net-libs/mbedtls/mbedtls-2.18.1.ebuild
76 rename to net-libs/mbedtls/mbedtls-2.18.1-r1.ebuild
77 index b94b7770c95..b11f2794a35 100644
78 --- a/net-libs/mbedtls/mbedtls-2.18.1.ebuild
79 +++ b/net-libs/mbedtls/mbedtls-2.18.1-r1.ebuild
80 @@ -1,4 +1,4 @@
81 -# Copyright 1999-2019 Gentoo Authors
82 +# Copyright 1999-2020 Gentoo Authors
83 # Distributed under the terms of the GNU General Public License v2
84
85 EAPI=7
86 @@ -36,6 +36,10 @@ enable_mbedtls_option() {
87 include/mbedtls/config.h || die
88 }
89
90 +PATCHES=(
91 + "${FILESDIR}"/${PN}-dont-overwrite-headers.patch
92 +)
93 +
94 src_prepare() {
95 use cpu_flags_x86_sse2 && enable_mbedtls_option MBEDTLS_HAVE_SSE2
96 use zlib && enable_mbedtls_option MBEDTLS_ZLIB_SUPPORT
97
98 diff --git a/net-libs/mbedtls/mbedtls-2.19.1.ebuild b/net-libs/mbedtls/mbedtls-2.19.1-r1.ebuild
99 similarity index 96%
100 rename from net-libs/mbedtls/mbedtls-2.19.1.ebuild
101 rename to net-libs/mbedtls/mbedtls-2.19.1-r1.ebuild
102 index e7b65760fa8..1a73d20f220 100644
103 --- a/net-libs/mbedtls/mbedtls-2.19.1.ebuild
104 +++ b/net-libs/mbedtls/mbedtls-2.19.1-r1.ebuild
105 @@ -1,4 +1,4 @@
106 -# Copyright 1999-2019 Gentoo Authors
107 +# Copyright 1999-2020 Gentoo Authors
108 # Distributed under the terms of the GNU General Public License v2
109
110 EAPI=7
111 @@ -36,6 +36,10 @@ enable_mbedtls_option() {
112 include/mbedtls/config.h || die
113 }
114
115 +PATCHES=(
116 + "${FILESDIR}"/${PN}-dont-overwrite-headers.patch
117 +)
118 +
119 src_prepare() {
120 use cpu_flags_x86_sse2 && enable_mbedtls_option MBEDTLS_HAVE_SSE2
121 use zlib && enable_mbedtls_option MBEDTLS_ZLIB_SUPPORT