bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [address@hidden: Help with entropy?]


From: Thomas Schwinge
Subject: Re: [address@hidden: Help with entropy?]
Date: Sun, 24 Jun 2007 17:07:14 +0200
User-agent: Mutt/1.5.11

Hello!

On Thu, Jun 21, 2007 at 12:43:51PM -0400, Michael Casadevall wrote:
> Thanks for going through it.

Sure.  :-)


> On Jun 20, 2007, at 5:31 PM, Thomas Schwinge wrote:
> >From: Michael Casadevall <sonicmctails@gmail.com>
> >| Index: i386/i386at/conf.c
> >
> >| + extern int       entropyopen(), entropyclose(), entropyread(),  
> >entropygetstat();
> >
> >Just include <device/entropy.h> instead.
> 
> Most of the other entries in that file use the extern, hence why I  
> did, but I'll change that now.

Fine, but in some cases we don't have to continue doing things the way
they've been done a dozen years ago.


> >| entropy.h
> >
> >| #define ENTROPYBUFSIZE sizeof(unsigned long)*128
> >
> >Should this really be defined in here?  I'd put it into  
> >`entropy.c', as
> >the buffer size is internal business and is of no interest to the  
> >user of
> >the entropy device interface.
> >
> >| /* typedef struct {
> >|   unsigned long ticks;
> >|   int data;
> >| } entropy_data; */
> >
> >Likewise.
> 
> Fair enough. I thought about putting it as configurable setting  
> through autoconf.

I don't think it's worth it.  It should have a sane default and (perhaps,
if someone later feels like it) be configurable at run-time.

On a second thought, depending on how you export the gathered entropy
through the `entropy' device, might it be useful to know the layout of
the `entroy_data' structure for a user?


> >| entropy.c
> >
> >| /*
> >|  * Mach Kernel - Entropy Generating Device
> >|  * Copyright (C) 2007 Free Software Foundation.
> >
> >Did you originally copy this file from `device/kmsg.c'?  If yes,  
> >then you
> >should retain the original copyright lines.
> >
> No code was directly copied from kmsg.c. I had it open though and  
> used it as a template to figure out what I was doing. kmsg.c does  
> have the copyright assigned to the FSF, I can easily add the  
> additional copyright notices

As you used the file as a templase, I'd say that you should also plug in
that file's copyright conditions.


> remove all the twisting code, can we get this merged into mach?

Sure.  That's what we're talking about here.


> >You're allowing for more then one user of the `entropy' device.  Is  
> >this
> >intentional?  As soon as we have real translators sitting on
> >`/dev/{,u}random' / `/dev/entropy' it isn't anymore, I think.
> 
> For whatever reason, someone might attach a second random translator.  
> Better be safe then sorry because this code could blow up wonderfully  
> if multiple users tried to use it at the same time.

Okay.  We can still change this as soon as we see how this is really
going to be used in the Hurd userland.


So, please post an updated patch.


Regards,
 Thomas

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]