]> granicus.if.org Git - postgresql/commit
Patch from Marko Kreen:
authorNeil Conway <neilc@samurai.com>
Sat, 18 Feb 2006 20:48:56 +0000 (20:48 +0000)
committerNeil Conway <neilc@samurai.com>
Sat, 18 Feb 2006 20:48:56 +0000 (20:48 +0000)
commit74f615766c6edca877a8be4cc2a657a2617f90e1
tree1cfec465b22204e861e39bdf480b6ae71fa3b095
parentf5ab0a259780d63f8de7b1734ac246afce9f369d
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