[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 12/23] linux-user: Call qcrypto_init if not using
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v3 12/23] linux-user: Call qcrypto_init if not using -seed |
Date: |
Thu, 14 Mar 2019 20:26:18 -0700 |
Cc: Laurent Vivier <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
linux-user/main.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index cf7095bdaf..8478306eef 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -38,6 +38,7 @@
#include "trace/control.h"
#include "target_elf.h"
#include "cpu_loop-common.h"
+#include "crypto/init.h"
char *exec_path;
@@ -686,8 +687,18 @@ int main(int argc, char **argv, char **envp)
if (seed_optarg == NULL) {
seed_optarg = getenv("QEMU_RAND_SEED");
}
- if (seed_optarg != NULL) {
- qemu_guest_random_seed_main(seed_optarg, &error_fatal);
+ {
+ Error *err = NULL;
+ if (seed_optarg != NULL) {
+ qemu_guest_random_seed_main(seed_optarg, &err);
+ } else {
+ /* ??? Assumes qcrypto is only used by qemu_guest_getrandom. */
+ qcrypto_init(&err);
+ }
+ if (err) {
+ error_reportf_err(err, "cannot initialize crypto: ");
+ exit(1);
+ }
}
target_environ = envlist_to_environ(envlist, NULL);
--
2.17.2
- Re: [Qemu-devel] [PATCH v3 07/23] ui/vnc: Split out authentication_failure, (continued)
- [Qemu-devel] [PATCH v3 15/23] linux-user: Remove srand call, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 10/23] cpus: Initialize pseudo-random seeds for all guest cpus, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 06/23] crypto: Change the qcrypto_random_bytes buffer type to void*, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 17/23] hw/misc/nrf51_rng: Use qemu_guest_getrandom_nofail, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 09/23] util: Add qemu_guest_getrandom and associated routines, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 12/23] linux-user: Call qcrypto_init if not using -seed,
Richard Henderson <=
- [Qemu-devel] [PATCH v3 05/23] crypto: Use getrandom for qcrypto_random_bytes, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 03/23] crypto: Do not fail for EINTR during qcrypto_random_bytes, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 01/23] crypto: Merge crypto-obj-y into libqemuutil.a, Richard Henderson, 2019/03/14
- Re: [Qemu-devel] [PATCH v3 00/23] Add qemu_getrandom and ARMv8.5-RNG etc, Daniel P . Berrangé, 2019/03/15