Big thanks to Solar Designer who pointed out a bug in bcrypt
Bruce Momjian <bruce@momjian.us>
Big thanks to Solar Designer who pointed out a bug in bcrypt salt generation code. He also urged using better random source and making possible to choose using bcrypt and xdes rounds more easily. So, here's patch: * For all salt generation, use Solar Designer's own code. This is mostly due fact that his code is more fit for get_random_bytes() style interface. * New function: gen_salt(type, rounds). This lets specify iteration count for algorithm. * random.c: px_get_random_bytes() function. Supported randomness soure: /dev/urandom, OpenSSL PRNG, libc random() Default: /dev/urandom. * Draft description of C API for pgcrypto functions. New files: API, crypt-gensalt.c, random.c Marko Kreen
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pgcrypto/API | added | +163 −0 |
| contrib/pgcrypto/crypt-blowfish.c | modified | +0 −25 |
| contrib/pgcrypto/crypt-gensalt.c | added | +181 −0 |
| contrib/pgcrypto/Makefile | modified | +25 −2 |
| contrib/pgcrypto/openssl.c | modified | +1 −2 |
| contrib/pgcrypto/pgcrypto.c | modified | +37 −2 |
| contrib/pgcrypto/pgcrypto.h | modified | +2 −1 |
| contrib/pgcrypto/pgcrypto.sql.in | modified | +6 −0 |
| contrib/pgcrypto/px-crypt.c | modified | +38 −94 |
| contrib/pgcrypto/px-crypt.h | modified | +16 −7 |
| contrib/pgcrypto/px.h | modified | +3 −1 |
| contrib/pgcrypto/random.c | added | +127 −0 |
| contrib/pgcrypto/README.pgcrypto | modified | +28 −0 |