[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 12/23] linux-user: Call qcrypto_init if not u
From: |
Daniel P . Berrangé |
Subject: |
Re: [Qemu-devel] [PATCH v3 12/23] linux-user: Call qcrypto_init if not using -seed |
Date: |
Mon, 15 Apr 2019 11:28:38 +0100 |
User-agent: |
Mutt/1.11.3 (2019-02-01) |
On Mon, Apr 15, 2019 at 12:23:18PM +0200, Philippe Mathieu-Daudé wrote:
> On 4/13/19 8:44 AM, Richard Henderson wrote:
> > On 4/10/19 11:49 PM, Philippe Mathieu-Daudé wrote:
> >>> - if (seed_optarg != NULL) {
> >>> - qemu_guest_random_seed_main(seed_optarg, &error_fatal);
> >>> + {
> >> Since 7be41675f7c we use gnu99 C, so this extra block indentation can be
> >> removed.
> >>
> >>> + 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);
> >>> + }
> >>> }
> >
> > I could, but it also limits the scope, which is of more importance to
> > variables
> > who have their address taken. It means that their storage could (in
> > theory) be
> > shared with objects not overlapping in scope.
>
> Fine then.
>
> I think your '???' comment is appropriate but I'd rather let Daniel
> opinate. Except that comment, for the rest:
In linux-user context, afaik, the random APIs are the only stuff that
will be used, none of the hash or cipher stuff is needed.
>
> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|