disabled broken getrandom() support

This commit is contained in:
Sandino Araico Sanchez 2018-04-20 20:29:49 -05:00
commit 0f2209eae8
3 changed files with 115 additions and 0 deletions

View file

@ -1,4 +1,5 @@
AUX libressl-2.2.4-clientcert.patch 1387 BLAKE2B aac223b0b8159c81f46d5b7005ef6ea419d39f5983b2aec751ef24e5582c5e69dce236f94372e6450d794d84bc66c589e528a0b5b846ebdf93bc049150228424 SHA512 411c50b5bf9bdeba022f6181d8395b571842625962d5d6f4467cde8b1e87156cea8b33416cfc1c537c0fb19fad7e7c7fb3a542045e84e5af0c80116259446554
AUX libressl-2.6.4-getrandom.patch 1583 BLAKE2B adee7f53d43f1c40f363a72e603f1f83d6aeee7b97424768c0470b27d069c14279b45d5ec5b2ead6c49fb94b19d8aadfae14fe50af7b719e6fe1c4e85c5af53c SHA512 3aa1df08ed3aa3d43e11c7d94a8cbe10a4644d295ce6d5537ccc8559e6b0a78b695113bfdf1b83109c9a438a690c9bbf08e0cd005b0f08c9b3ab5b0f5e46c872
DIST libressl-2.5.4.tar.gz 3286042 BLAKE2B 0e0220b4ad0bf13c4e705fd3fad851a9387b0ac938099c71557f0229d69c2973a729a5bedad758a78a5c0cd258ac9a20fa0ec2dc80c2fafb6c87a5f5b5b1fc36 SHA512 8ca86c14af0020c90bef4651892799864938dab9d898172269cb78bad5963314e064f2b4c46e6a04e0b85d1eddbd1840b734803c11ceec8fd6bb1290e0fe204c
DIST libressl-2.5.5.tar.gz 3283158 BLAKE2B d8a6c6f663d728daa165395302981f5777987b0d9522283bca278a9107e57067af19235b228555c9ed1c04009140d5de1c51b1419723ea368f4b585878310ed0 SHA512 3f576e74ddea17bd72e1bfbe0b57b94e1a2a9e6fa56cee50624cd8d18f0a8674273086225669e6ece56e6b859d2376e36e2c140d37acb52d4cd79374c4ba7096
DIST libressl-2.6.0.tar.gz 3297288 BLAKE2B 8906227a1d125e32afafb666e67c1364d764234d6a3c389c59f820cb5d778133811cc4be06de948fe6375e36ceddd061e1736e3b0fe3511e8807f5cb9fddc978 SHA512 e195c6a2c9680cfaaca31bb6d3392fc6f725efd2a2d18b9a24d457d035a581c88630e6a066a4a4e0903e71f3ae3c30a031eb4f58281e483fdf1d877227452e9a
@ -13,3 +14,4 @@ EBUILD libressl-2.6.1-r100.ebuild 1295 BLAKE2B 62afb0c600956c3094a7fe1d3da9d5835
EBUILD libressl-2.6.2-r100.ebuild 1295 BLAKE2B 62afb0c600956c3094a7fe1d3da9d583568ffbc768e5586dfe268b0547b9cca9b29815fb6027b05245214c48c236730b30ea43dc75afb411d469cbdabcd0bcef SHA512 805e6f0bc9170570dba7702a1e890986e42ccd045768eeba023fa499132ed427c0eee11ea9f8fd298f33cf319121e4e1a33c78663ca8233be74372a02f13bc91
EBUILD libressl-2.6.3-r100.ebuild 1356 BLAKE2B db26a717bdcce836279cb11c93bd4405ac9cf84086ce79d90fd4d8dd63b72a19713526da4a53cf32c38d62c4ad62309e9b74ee84077113da9899e4aaaf70d495 SHA512 eedfe387bf37713efe6b27e874daa673763fe479774d0263dcad52dd8ccc9b8a98f79c208d243b0707fbc6b3d24cee2213e9297825a42ea3522d2e07043fbf3c
EBUILD libressl-2.6.4-r100.ebuild 1356 BLAKE2B db26a717bdcce836279cb11c93bd4405ac9cf84086ce79d90fd4d8dd63b72a19713526da4a53cf32c38d62c4ad62309e9b74ee84077113da9899e4aaaf70d495 SHA512 eedfe387bf37713efe6b27e874daa673763fe479774d0263dcad52dd8ccc9b8a98f79c208d243b0707fbc6b3d24cee2213e9297825a42ea3522d2e07043fbf3c
EBUILD libressl-2.6.4-r101.ebuild 1377 BLAKE2B d9083965ee68b7cbcfda4e86a4c8f5abdc19878de4f0bc3a9625a4ce4ef71377cfd068c97b6304c5d12e4aa6dd27ffd5031a99b31510f883b778cc6f303a48d4 SHA512 b522a20ac79205d3ba1817a3478903da8f0bbab4015bb26cc1611f74a33f61c7cbc271fc28de1faa29dc45cbd542c7bc47e971d25c7c3a65ddbce1dc0a19d79b

View file

@ -0,0 +1,60 @@
diff -uri libressl-2.6.4.orig/crypto/compat/getentropy_linux.c libressl-2.6.4/crypto/compat/getentropy_linux.c
--- libressl-2.6.4.orig/crypto/compat/getentropy_linux.c 2017-12-12 03:48:10.000000000 -0600
+++ libressl-2.6.4/crypto/compat/getentropy_linux.c 2018-04-20 20:00:24.000000000 -0500
@@ -74,9 +74,6 @@
int getentropy(void *buf, size_t len);
static int gotdata(char *buf, size_t len);
-#ifdef SYS_getrandom
-static int getentropy_getrandom(void *buf, size_t len);
-#endif
static int getentropy_urandom(void *buf, size_t len);
#ifdef SYS__sysctl
static int getentropy_sysctl(void *buf, size_t len);
@@ -94,20 +91,6 @@
return (-1);
}
-#ifdef SYS_getrandom
- /*
- * Try descriptor-less getrandom(), in non-blocking mode.
- *
- * The design of Linux getrandom is broken. It has an
- * uninitialized phase coupled with blocking behaviour, which
- * is unacceptable from within a library at boot time without
- * possible recovery. See http://bugs.python.org/issue26839#msg267745
- */
- ret = getentropy_getrandom(buf, len);
- if (ret != -1)
- return (ret);
-#endif
-
/*
* Try to get entropy with /dev/urandom
*
@@ -193,25 +176,6 @@
return (0);
}
-#ifdef SYS_getrandom
-static int
-getentropy_getrandom(void *buf, size_t len)
-{
- int pre_errno = errno;
- int ret;
- if (len > 256)
- return (-1);
- do {
- ret = syscall(SYS_getrandom, buf, len, GRND_NONBLOCK);
- } while (ret == -1 && errno == EINTR);
-
- if (ret != len)
- return (-1);
- errno = pre_errno;
- return (0);
-}
-#endif
-
static int
getentropy_urandom(void *buf, size_t len)
{

View file

@ -0,0 +1,53 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit ltprune multilib-minimal
DESCRIPTION="Free version of the SSL/TLS protocol forked from OpenSSL"
HOMEPAGE="https://www.libressl.org/"
SRC_URI="https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${P}.tar.gz"
LICENSE="ISC openssl"
# Reflects ABI of libcrypto.so and libssl.so. Since these can differ,
# we'll try to use the max of either. However, if either change between
# versions, we have to change the subslot to trigger rebuild of consumers.
SLOT="0/44"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
IUSE="asm static-libs test"
REQUIRED_USE="test? ( static-libs )"
DEPEND="${RDEPEND}"
PDEPEND="app-misc/ca-certificates"
src_prepare() {
touch crypto/Makefile.in
sed -i \
-e '/^[ \t]*CFLAGS=/s#-g ##' \
-e '/^[ \t]*CFLAGS=/s#-g"#"#' \
-e '/^[ \t]*CFLAGS=/s#-O2 ##' \
-e '/^[ \t]*CFLAGS=/s#-O2"#"#' \
-e '/^[ \t]*USER_CFLAGS=/s#-O2 ##' \
-e '/^[ \t]*USER_CFLAGS=/s#-O2"#"#' \
configure || die "fixing CFLAGS failed"
eapply "${FILESDIR}/${PN}-2.6.4-getrandom.patch"
eapply_user
}
multilib_src_configure() {
ECONF_SOURCE="${S}" econf \
$(use_enable asm) \
$(use_enable static-libs static)
}
multilib_src_test() {
emake check
}
multilib_src_install_all() {
einstalldocs
prune_libtool_files
}