200 lines
6.2 KiB
Diff
200 lines
6.2 KiB
Diff
diff '--color=auto' -ruN openssl-1.1.1l/crypto/rand/rand_unix.c patch-1.1.1l/crypto/rand/rand_unix.c
|
|
--- openssl-1.1.1l/crypto/rand/rand_unix.c 2021-08-24 09:38:47.000000000 -0400
|
|
+++ patch-1.1.1l/crypto/rand/rand_unix.c 2021-09-12 02:26:35.765347423 -0400
|
|
@@ -372,36 +372,36 @@
|
|
* Note: Sometimes getentropy() can be provided but not implemented
|
|
* internally. So we need to check errno for ENOSYS
|
|
*/
|
|
-# if defined(__GNUC__) && __GNUC__>=2 && defined(__ELF__) && !defined(__hpux)
|
|
- extern int getentropy(void *buffer, size_t length) __attribute__((weak));
|
|
+/* # if defined(__GNUC__) && __GNUC__>=2 && defined(__ELF__) && !defined(__hpux) */
|
|
+/* extern int getentropy(void *buffer, size_t length) __attribute__((weak)); */
|
|
|
|
- if (getentropy != NULL) {
|
|
+/* if (getentropy != NULL) { */
|
|
if (getentropy(buf, buflen) == 0)
|
|
return (ssize_t)buflen;
|
|
if (errno != ENOSYS)
|
|
return -1;
|
|
- }
|
|
-# elif defined(__APPLE__)
|
|
- if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
|
|
- return (ssize_t)buflen;
|
|
-
|
|
- return -1;
|
|
-# else
|
|
- union {
|
|
- void *p;
|
|
- int (*f)(void *buffer, size_t length);
|
|
- } p_getentropy;
|
|
-
|
|
- /*
|
|
- * We could cache the result of the lookup, but we normally don't
|
|
- * call this function often.
|
|
- */
|
|
- ERR_set_mark();
|
|
- p_getentropy.p = DSO_global_lookup("getentropy");
|
|
- ERR_pop_to_mark();
|
|
- if (p_getentropy.p != NULL)
|
|
- return p_getentropy.f(buf, buflen) == 0 ? (ssize_t)buflen : -1;
|
|
-# endif
|
|
+/* } */
|
|
+/* # elif defined(__APPLE__) */
|
|
+/* if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess) */
|
|
+/* return (ssize_t)buflen; */
|
|
+
|
|
+/* return -1; */
|
|
+/* # else */
|
|
+/* union { */
|
|
+/* void *p; */
|
|
+/* int (*f)(void *buffer, size_t length); */
|
|
+/* } p_getentropy; */
|
|
+
|
|
+/* /\* */
|
|
+/* * We could cache the result of the lookup, but we normally don't */
|
|
+/* * call this function often. */
|
|
+/* *\/ */
|
|
+/* ERR_set_mark(); */
|
|
+/* p_getentropy.p = DSO_global_lookup("getentropy"); */
|
|
+/* ERR_pop_to_mark(); */
|
|
+/* if (p_getentropy.p != NULL) */
|
|
+/* return p_getentropy.f(buf, buflen) == 0 ? (ssize_t)buflen : -1; */
|
|
+/* # endif */
|
|
|
|
/* Linux supports this since version 3.17 */
|
|
# if defined(__linux) && defined(__NR_getrandom)
|
|
@@ -635,12 +635,12 @@
|
|
*/
|
|
size_t rand_pool_acquire_entropy(RAND_POOL *pool)
|
|
{
|
|
-# if defined(OPENSSL_RAND_SEED_NONE)
|
|
- return rand_pool_entropy_available(pool);
|
|
-# else
|
|
+/* # if defined(OPENSSL_RAND_SEED_NONE) */
|
|
+/* return rand_pool_entropy_available(pool); */
|
|
+/* # else */
|
|
size_t entropy_available;
|
|
|
|
-# if defined(OPENSSL_RAND_SEED_GETRANDOM)
|
|
+/* # if defined(OPENSSL_RAND_SEED_GETRANDOM) */
|
|
{
|
|
size_t bytes_needed;
|
|
unsigned char *buffer;
|
|
@@ -664,7 +664,7 @@
|
|
entropy_available = rand_pool_entropy_available(pool);
|
|
if (entropy_available > 0)
|
|
return entropy_available;
|
|
-# endif
|
|
+/* # endif */
|
|
|
|
# if defined(OPENSSL_RAND_SEED_LIBRANDOM)
|
|
{
|
|
@@ -752,7 +752,7 @@
|
|
# endif
|
|
|
|
return rand_pool_entropy_available(pool);
|
|
-# endif
|
|
+/* # endif */
|
|
}
|
|
# endif
|
|
#endif
|
|
diff '--color=auto' -ruN openssl-1.1.1l/test/drbgtest.c patch-1.1.1l/test/drbgtest.c
|
|
--- openssl-1.1.1l/test/drbgtest.c 2021-08-24 09:38:47.000000000 -0400
|
|
+++ patch-1.1.1l/test/drbgtest.c 2021-09-12 02:07:38.062332301 -0400
|
|
@@ -22,8 +22,21 @@
|
|
# include <windows.h>
|
|
#endif
|
|
|
|
+#ifndef HAVE_FORK
|
|
+# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_VXWORKS)
|
|
+# define HAVE_FORK 0
|
|
+# else
|
|
+# define HAVE_FORK 1
|
|
+# endif
|
|
+#endif
|
|
+
|
|
+#if HAVE_FORK
|
|
+# undef NO_FORK
|
|
+#else
|
|
+# define NO_FORK
|
|
+#endif
|
|
|
|
-#if defined(OPENSSL_SYS_UNIX)
|
|
+#if defined(OPENSSL_SYS_UNIX) && !defined(NO_FORK)
|
|
# include <sys/types.h>
|
|
# include <sys/wait.h>
|
|
# include <unistd.h>
|
|
@@ -676,7 +689,7 @@
|
|
}
|
|
|
|
|
|
-#if defined(OPENSSL_SYS_UNIX)
|
|
+#if defined(OPENSSL_SYS_UNIX) && !defined(NO_FORK)
|
|
/*
|
|
* Test whether master, public and private DRBG are reseeded after
|
|
* forking the process.
|
|
@@ -795,7 +808,7 @@
|
|
goto error;
|
|
reset_drbg_hook_ctx();
|
|
|
|
-#if defined(OPENSSL_SYS_UNIX)
|
|
+#if defined(OPENSSL_SYS_UNIX) && !defined(NO_FORK)
|
|
if (!TEST_true(test_drbg_reseed_after_fork(master, public, private)))
|
|
goto error;
|
|
#endif
|
|
diff '--color=auto' -ruN openssl-1.1.1l/test/run_tests.pl patch-1.1.1l/test/run_tests.pl
|
|
--- openssl-1.1.1l/test/run_tests.pl 2021-08-24 09:38:47.000000000 -0400
|
|
+++ patch-1.1.1l/test/run_tests.pl 2021-09-12 02:03:57.603451471 -0400
|
|
@@ -28,7 +28,7 @@
|
|
my $recipesdir = catdir($srctop, "test", "recipes");
|
|
my $libdir = rel2abs(catdir($srctop, "util", "perl"));
|
|
|
|
-$ENV{OPENSSL_CONF} = catdir($srctop, "apps", "openssl.cnf");
|
|
+$ENV{OPENSSL_CONF} = rel2abs(catdir($srctop, "apps", "openssl.cnf"));
|
|
|
|
my %tapargs =
|
|
( verbosity => $ENV{VERBOSE} || $ENV{V} || $ENV{HARNESS_VERBOSE} ? 1 : 0,
|
|
diff '--color=auto' -ruN openssl-1.1.1l/util/perl/OpenSSL/Test.pm patch-1.1.1l/util/perl/OpenSSL/Test.pm
|
|
--- openssl-1.1.1l/util/perl/OpenSSL/Test.pm 2021-08-24 09:38:47.000000000 -0400
|
|
+++ patch-1.1.1l/util/perl/OpenSSL/Test.pm 2021-09-12 02:01:14.155136681 -0400
|
|
@@ -65,7 +65,7 @@
|
|
rel2abs/;
|
|
use File::Path 2.00 qw/rmtree mkpath/;
|
|
use File::Basename;
|
|
-use Cwd qw/getcwd abs_path/;
|
|
+use Cwd qw/abs_path/;
|
|
|
|
my $level = 0;
|
|
|
|
@@ -904,26 +904,26 @@
|
|
BAIL_OUT("Must run setup() first") if (! $test_name);
|
|
|
|
my $f = pop;
|
|
- return abs2rel(catfile($directories{SRCTOP},@_,$f),getcwd);
|
|
+ return catfile($directories{SRCTOP},@_,$f);
|
|
}
|
|
|
|
sub __srctop_dir {
|
|
BAIL_OUT("Must run setup() first") if (! $test_name);
|
|
|
|
- return abs2rel(catdir($directories{SRCTOP},@_), getcwd);
|
|
+ return catdir($directories{SRCTOP},@_);
|
|
}
|
|
|
|
sub __bldtop_file {
|
|
BAIL_OUT("Must run setup() first") if (! $test_name);
|
|
|
|
my $f = pop;
|
|
- return abs2rel(catfile($directories{BLDTOP},@_,$f), getcwd);
|
|
+ return catfile($directories{BLDTOP},@_,$f);
|
|
}
|
|
|
|
sub __bldtop_dir {
|
|
BAIL_OUT("Must run setup() first") if (! $test_name);
|
|
|
|
- return abs2rel(catdir($directories{BLDTOP},@_), getcwd);
|
|
+ return catdir($directories{BLDTOP},@_);
|
|
}
|
|
|
|
# __exeext is a function that returns the platform dependent file extension
|