]> granicus.if.org Git - postgresql/commit
Patch from Marko Kreen:
authorNeil Conway <neilc@samurai.com>
Sat, 18 Feb 2006 20:49:02 +0000 (20:49 +0000)
committerNeil Conway <neilc@samurai.com>
Sat, 18 Feb 2006 20:49:02 +0000 (20:49 +0000)
commit0c853662bdd73ad7ffdcf9e87208b97679826119
tree999b784aa566c3df82bbe2243c6c8fc83619fff4
parenteb46ad568d176e36cdf7146bbb992841c4ca7496
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