[Freeipa-devel] [PATCH] Use SystemRandom for better random passwords

Simo Sorce ssorce at redhat.com
Mon Aug 11 22:36:49 UTC 2008


On Mon, 2008-08-11 at 16:20 -0400, Rob Crittenden wrote:
> Simo Sorce wrote:
> > On Fri, 2008-08-08 at 15:42 -0400, Simo Sorce wrote:
> >> On Fri, 2008-08-08 at 14:47 -0400, Rob Crittenden wrote:
> >>> Simo Sorce wrote:
> >>>> While reviewing some code I realized we could do a better job at
> >>>> generating random password (and this was already implemented for one of
> >>>> our functions).
> >>>> The current code is *not* flawed, but using better methods is always a
> >>>> good thing.
> >>> ack but looks like you can remove the 'generator = 
> >>> random.SystemRandom()' as well.
> >> arghh no, thanks for point this out because the bug is that the last
> >> line should look like:
> >>
> >> +            password += generator.choice(password_chars)
> >>
> >> and NOT
> >>
> >> +            password += r.choice(password_chars)
> >>
> >> bloody copy&paste errors :-)
> > 
> > New patch fixing this.
> > 
> > Simo.
> 
> ack

Pushed to master

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York




More information about the Freeipa-devel mailing list