11 ms·
Why does Libgcrypt use a nonstandard CSPRNG to begin with? This is a solved problem; why reinvent the wheel?
by sneak 10y ago
Why does Libgcrypt use a nonstandard CSPRNG to begin with? This is a solved problem; why reinvent the wheel?
- the_why_of_y 10y agoApparently the vulnerable mix_pool function was added in 1998 in this commit, citing a Peter Gutmann's Paper: "Software Generation of Practically Strong Random Numbers": https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=commitdiff;h=a6a8f1e706bd7e528262151bc04ebb9409c2eeed https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=commi... If you look at random.c before this commit, what it did previously is either return bytes read from /dev/urandom or /dev/random (which is fine) or some fall-back code that used the awful standard C rand(3). I'd guess that at the time there were some crappy UNIXes that didn't have a working /dev/random, so they wanted to make the fall-back less awful, and accidentally broke the "working" case at the same time? Hazards of writing portable code...