]> granicus.if.org Git - postgresql/commit
Patch from Marko Kreen:
authorNeil Conway <neilc@samurai.com>
Sat, 18 Feb 2006 20:48:53 +0000 (20:48 +0000)
committerNeil Conway <neilc@samurai.com>
Sat, 18 Feb 2006 20:48:53 +0000 (20:48 +0000)
commit3bd549ba0a33a4cd71431e6b65aec3447a0e61c3
tree51493c0a31156371b3b39d0b2a3517c3419b51bb
parent4fc6585cb92cb0e783296f0ca7a5d67ab277c343
Patch from Marko Kreen:

pgcrypto crypt()/md5 and hmac() leak memory when compiled against
OpenSSL as openssl.c digest ->reset will do two DigestInit calls
against a context.  This happened to work with OpenSSL 0.9.6
but not with 0.9.7+.

Reason for the messy code was that I tried to avoid creating
wrapper structure to transport algorithm info and tried to use
OpenSSL context for it.  The fix is to create wrapper structure.

It also uses newer digest API to avoid memory allocations
on reset with newer OpenSSLs.

Thanks to Daniel Blaisdell for reporting it.
contrib/pgcrypto/openssl.c