diff options
author | Julien Massot <julien.massot@iot.bzh> | 2021-02-03 16:28:37 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2021-02-09 06:12:09 -1000 |
commit | 28707d202e56c9fe12492e3370fb56d920560642 (patch) | |
tree | 78d137a04ec21c2dbd7081c75780c0bc653b2629 /meta/recipes-support/rng-tools/rng-tools/0002-rngd_jitter-initialize-AES-key-before-setting-the-en.patch | |
parent | 887f0a606dd323de1098e8e8a0d65b8351b4006d (diff) | |
download | openembedded-core-contrib-28707d202e56c9fe12492e3370fb56d920560642.tar.gz openembedded-core-contrib-28707d202e56c9fe12492e3370fb56d920560642.tar.bz2 openembedded-core-contrib-28707d202e56c9fe12492e3370fb56d920560642.zip |
rng-tools: fix rngd_jitter initialization
rngd daemon may spam the console when using an older version
than 6.11.
Backport patches from https://github.com/nhorman/rng-tools/pull/99/commits
Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-support/rng-tools/rng-tools/0002-rngd_jitter-initialize-AES-key-before-setting-the-en.patch')
-rw-r--r-- | meta/recipes-support/rng-tools/rng-tools/0002-rngd_jitter-initialize-AES-key-before-setting-the-en.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-support/rng-tools/rng-tools/0002-rngd_jitter-initialize-AES-key-before-setting-the-en.patch b/meta/recipes-support/rng-tools/rng-tools/0002-rngd_jitter-initialize-AES-key-before-setting-the-en.patch new file mode 100644 index 0000000000..34f8227543 --- /dev/null +++ b/meta/recipes-support/rng-tools/rng-tools/0002-rngd_jitter-initialize-AES-key-before-setting-the-en.patch @@ -0,0 +1,38 @@ +From 330c2ba14510c8103b30d5021adb18f1534031a1 Mon Sep 17 00:00:00 2001 +From: Matthias Schiffer <matthias.schiffer@tq-group.com> +Date: Wed, 27 Jan 2021 16:18:09 +0100 +Subject: [PATCH] rngd_jitter: initialize AES key before setting the entropy + pipe to O_NONBLOCK + +Signed-off-by: Matthias Schiffer <matthias.schiffer@tq-group.com> +--- + rngd_jitter.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/rngd_jitter.c b/rngd_jitter.c +index 25b3543..48f344c 100644 +--- a/rngd_jitter.c ++++ b/rngd_jitter.c +@@ -463,10 +463,6 @@ int init_jitter_entropy_source(struct rng *ent_src) + pthread_mutex_unlock(&tdata[i].statemtx); + } + +- flags = fcntl(pipefds[0], F_GETFL, 0); +- flags |= O_NONBLOCK; +- fcntl(pipefds[0], F_SETFL, flags); +- + if (ent_src->rng_options[JITTER_OPT_USE_AES].int_val) { + #ifdef HAVE_LIBGCRYPT + /* +@@ -487,6 +483,11 @@ int init_jitter_entropy_source(struct rng *ent_src) + ent_src->rng_options[JITTER_OPT_USE_AES].int_val = 1; + } + xread_jitter(aes_buf, tdata[0].buf_sz, ent_src); ++ ++ flags = fcntl(pipefds[0], F_GETFL, 0); ++ flags |= O_NONBLOCK; ++ fcntl(pipefds[0], F_SETFL, flags); ++ + #else + message_entsrc(ent_src,LOG_CONS|LOG_INFO, "libgcrypt not available. Disabling AES in JITTER source\n"); + ent_src->rng_options[JITTER_OPT_USE_AES].int_val = 0; |