|
Message-ID: <20130128173348.GA6181@port70.net> Date: Mon, 28 Jan 2013 18:33:48 +0100 From: Szabolcs Nagy <nsz@...t70.net> To: musl@...ts.openwall.com Subject: Re: [PATCH] Add support for mkostemp, mkstemps and mkostemps * Szabolcs Nagy <nsz@...t70.net> [2013-01-28 10:37:55 +0100]: > * Anthony G. Basile <basile@...nsource.dyc.edu> [2013-01-28 00:06:23 -0500]: > > + unsigned long r; > > can be unsigned char r; > > > + r = ts.tv_nsec + (uintptr_t)&ts / 16 + (uintptr_t)template; > > + for (i=1; i<=6; i++, r>>=4) > > + template[l-i] = 'A'+(r&15); > > it seems to use only 4bit entropy based on clock (and fixed addresses) > these comments were wrong, i did not notice r>>=4 > > + int l = strlen(template)-len; > > int vs size_t problem > this is a bug > i'd do __randname(template, length-suffix) > i think __randname(char *p) api suggestion of john spencer is good (where p points to the XXXXXX part)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.