Re: [PATCHES] pgcrypto: fix for broken solaris openssl, v03

2007-09-29 Thread Zdenek Kotala
Marko Kreen wrote: solaris openssl refuses to handle keys longer than 128bits. * aes will crash on longer keys * blowfish will silently cut the key which can result data corruption to fix it: - test errors from AES functions - bf errors cannot be tested, do test encryption - change aes

Re: [PATCHES] pgcrypto: fix for broken solaris openssl, v03

2007-09-29 Thread Zdenek Kotala
Tom Lane wrote: Marko Kreen [EMAIL PROTECTED] writes: solaris openssl refuses to handle keys longer than 128bits. ... So something like the current patch should be still applied as a near-term fix. Applied to HEAD and 8.2. I wasn't sure if there was interest in patching further back, or if

Re: [PATCHES] pgcrypto: fix for broken solaris openssl, v03

2007-09-29 Thread Tom Lane
Zdenek Kotala [EMAIL PROTECTED] writes: Tom Lane wrote: Applied to HEAD and 8.2. I wasn't sure if there was interest in patching further back, or if the patch was meant to work further back. Let me know if you're not happy. PostgreSQL 8.1 is shipped with Solaris. We are interesting it to

Re: [PATCHES] pgcrypto: fix for broken solaris openssl, v03

2007-09-29 Thread Zdenek Kotala
Tom Lane wrote: Zdenek Kotala [EMAIL PROTECTED] writes: Tom Lane wrote: Applied to HEAD and 8.2. I wasn't sure if there was interest in patching further back, or if the patch was meant to work further back. Let me know if you're not happy. PostgreSQL 8.1 is shipped with Solaris. We are

[PATCHES] pgcrypto: fix for broken solaris openssl, v03

2007-09-28 Thread Marko Kreen
solaris openssl refuses to handle keys longer than 128bits. * aes will crash on longer keys * blowfish will silently cut the key which can result data corruption to fix it: - test errors from AES functions - bf errors cannot be tested, do test encryption - change aes compat macros to static

Re: [PATCHES] pgcrypto: fix for broken solaris openssl, v03

2007-09-28 Thread Tom Lane
Marko Kreen [EMAIL PROTECTED] writes: solaris openssl refuses to handle keys longer than 128bits. ... So something like the current patch should be still applied as a near-term fix. Applied to HEAD and 8.2. I wasn't sure if there was interest in patching further back, or if the patch was

Re: [PATCHES] pgcrypto (v02)

2007-08-07 Thread Zdenek Kotala
There is updated version of patch. See comments bellow: Marko Kreen wrote: On 7/27/07, Zdenek Kotala [EMAIL PROTECTED] wrote: I attach pgcrypto patch which fix two problems on system without strong crypto support (e.g. default Solaris 10 installation): 1) postgres crashes when AES cipher uses

Re: [PATCHES] pgcrypto

2007-07-30 Thread Marko Kreen
On 7/27/07, Zdenek Kotala [EMAIL PROTECTED] wrote: I attach pgcrypto patch which fix two problems on system without strong crypto support (e.g. default Solaris 10 installation): 1) postgres crashes when AES cipher uses long key 2) Blowfish silently cut longer keys. It could bring problem when

Re: [PATCHES] pgcrypto merge cleanup

2006-07-19 Thread Neil Conway
On Tue, 2006-07-18 at 16:06 +0300, Marko Kreen wrote: - Few README fixes - Keep imath Id string, put $PostgreSQL$ separately. Applied, thanks. -Neil ---(end of broadcast)--- TIP 6: explain analyze is your friend

[PATCHES] pgcrypto merge cleanup

2006-07-18 Thread Marko Kreen
- Few README fixes - Keep imath Id string, put $PostgreSQL$ separately. -- marko Index: contrib/pgcrypto/README.pgcrypto === RCS file: /opt/cvs/pgsql/contrib/pgcrypto/README.pgcrypto,v retrieving revision 1.15 diff -u -c -r1.15

Re: [PATCHES] pgcrypto: fix memory leak in openssl.c

2006-02-20 Thread Marko Kreen
On 2/18/06, Marko Kreen [EMAIL PROTECTED] wrote: 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+. Ugh, seems I read the old code

Re: [PATCHES] pgcrypto: fix memory leak in openssl.c

2006-02-20 Thread Tom Lane
Marko Kreen [EMAIL PROTECTED] writes: On 2/18/06, Marko Kreen [EMAIL PROTECTED] wrote: 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

Re: [PATCHES] pgcrypto: fix memory leak in openssl.c

2006-02-20 Thread Marko Kreen
On 2/20/06, Tom Lane [EMAIL PROTECTED] wrote: Marko Kreen [EMAIL PROTECTED] writes: On 2/18/06, Marko Kreen [EMAIL PROTECTED] wrote: 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

Re: [PATCHES] pgcrypto: fix memory leak in openssl.c

2006-02-18 Thread Neil Conway
On Sat, 2006-02-18 at 02:23 +0200, Marko Kreen wrote: Attached are one patch for 7.3, 7.4, 8.0 branches and another for 8.1 and HEAD. Thanks, patches applied to the appropriate branches. -Neil ---(end of broadcast)--- TIP 6: explain analyze is

[PATCHES] pgcrypto: fix memory leak in openssl.c

2006-02-17 Thread 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

Re: [PATCHES] pgcrypto: bug in gen_salt (md5/xdes)

2006-01-03 Thread Tom Lane
Marko Kreen [EMAIL PROTECTED] writes: There is a signedness bug in Openwall gen_salt code that pgcrypto uses. This makes the salt space for md5 and xdes algorithms a lot smaller. Salts for blowfish and standard des are unaffected. Attached is upstream fix for it. This applies all the way

[PATCHES] pgcrypto: bug in gen_salt (md5/xdes)

2006-01-02 Thread Marko Kreen
There is a signedness bug in Openwall gen_salt code that pgcrypto uses. This makes the salt space for md5 and xdes algorithms a lot smaller. Salts for blowfish and standard des are unaffected. Attached is upstream fix for it. This applies all the way from 7.2 to 8.1 and HEAD. Please apply

Re: [PATCHES] pgcrypto doc polish

2005-11-02 Thread Tom Lane
Marko Kreen marko@l-t.ee writes: Few small things: [ snip ] Applied, thanks. I also fixed a few small grammatical problems in the text. regards, tom lane ---(end of broadcast)--- TIP 1: if posting/reading through Usenet,

[PATCHES] pgcrypto doc polish

2005-11-01 Thread Marko Kreen
Few small things: - Mention pgcrypto.sql - Mention asciidoc. To hint that occasional weird formatting is not random. - Clarify few senctences. - Remove anything related to MySQL password(). It was interesting to look at, but it should not be mentioned in serious conversation. Also, they

[PATCHES] pgcrypto BYTE_ORDER fix for stable branches

2005-07-13 Thread Marko Kreen
Recently was uncovered that pgcrypto does not include right header file to get BYTE_ORDER define on Cygwin and MINGW, and the missing define does not result in build failures, but random combinations of little and big-endian code sections. This patch adds missing sys/param.h include for md5.c,

[PATCHES] pgcrypto warnings for Sun's cc

2005-07-12 Thread Kris Jurka
This patch removes a couple of warnings Sun's cc reports in contrib/pgcrypto. cc -Xa -v -g -KPIC -I. -I../../src/include -I/usr/local/include -c -o sha2.o sha2.c sha2.c, line 173: warning: storage class after type is obsolescent sha2.c, line 193: warning: storage class after type is

Re: [PATCHES] pgcrypto warnings for Sun's cc

2005-07-12 Thread Tom Lane
Kris Jurka [EMAIL PROTECTED] writes: This patch removes a couple of warnings Sun's cc reports in contrib/pgcrypto. Applied, thanks. regards, tom lane ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ?

Re: [PATCHES] pgcrypto: OpenSSL/DES cleanup

2005-07-10 Thread Bruce Momjian
Patch applied. Thanks. --- Marko Kreen wrote: As Kris Jurka found out, pgcrypto does not work with OpenSSL 0.9.6x. The DES functions use the older 'des_' API, but the newer 3DES functions use the 0.9.7x-only 'DES_'

Re: [PATCHES] pgcrypto volatility and strictness changes

2005-07-07 Thread Neil Conway
Michael Fuhr wrote: This patch updates the DDL for contrib/pgcrypto to create all functions as STRICT, and all functions except gen_salt() as IMMUTABLE. gen_salt() is VOLATILE. Barring any objections, I'll apply this tomorrow. -Neil ---(end of

[PATCHES] pgcrypto: OpenSSL/DES cleanup

2005-07-07 Thread Marko Kreen
As Kris Jurka found out, pgcrypto does not work with OpenSSL 0.9.6x. The DES functions use the older 'des_' API, but the newer 3DES functions use the 0.9.7x-only 'DES_' API. I think I just used /usr/include/openssl/des.h for reference when implementing them, and had upgraded OpenSSL in the

Re: [PATCHES] pgcrypto: OpenSSL/DES cleanup

2005-07-07 Thread Michael Fuhr
On Thu, Jul 07, 2005 at 12:25:53PM +0300, Marko Kreen wrote: Tested with OpenSSL 0.9.6c and 0.9.7e. I just applied this patch to my system running HEAD and OpenSSL 0.9.8; all regression tests passed. BTW, OpenSSL 0.9.8 has been released:

Re: [PATCHES] pgcrypto volatility and strictness changes

2005-07-07 Thread Neil Conway
Michael Fuhr wrote: This patch updates the DDL for contrib/pgcrypto to create all functions as STRICT, and all functions except gen_salt() as IMMUTABLE. gen_salt() is VOLATILE. Applied, thanks. -Neil ---(end of broadcast)--- TIP 9: In versions

[PATCHES] pgcrypto volatility and strictness changes

2005-07-05 Thread Michael Fuhr
This patch updates the DDL for contrib/pgcrypto to create all functions as STRICT, and all functions except gen_salt() as IMMUTABLE. gen_salt() is VOLATILE. Although the functions are now STRICT, I left their PG_ARGISNULL() checks in place as a protective measure for users who install the new

Re: [PATCHES] pgcrypto: openssl digest fix

2005-03-13 Thread Neil Conway
Marko Kreen wrote: Ah, ofcourse. The patch seems rather large to be applying to 7.3 and 7.2 -- but it's your contrib/ module, so I'll assume you're pretty confident this doesn't cause any regressions... I'll apply the patch to 7.3 and 7.2 stable branches tomorrow. -Neil

Re: [PATCHES] pgcrypto: openssl digest fix

2005-03-13 Thread Marko Kreen
On Sun, Mar 13, 2005 at 09:43:02PM +1100, Neil Conway wrote: Marko Kreen wrote: Ah, ofcourse. The patch seems rather large to be applying to 7.3 and 7.2 -- but it's your contrib/ module, so I'll assume you're pretty confident this doesn't cause any regressions... The patch itself is

Re: [PATCHES] pgcrypto: openssl digest fix

2005-03-12 Thread Marko Kreen
On Sat, Mar 12, 2005 at 05:59:24PM +1100, Neil Conway wrote: Marko Kreen wrote: Please apply this also to stable branches (8.0 / 7.4). Should it be backpatched to 7.3 and 7.2 as well? It would be nice. I didn't know there are releases of those planned as well. Now looking into it, 7.3 and

[PATCHES] pgcrypto: openssl digest fix

2005-03-11 Thread Marko Kreen
Some builds (depends on crypto engine support?) of OpenSSL 0.9.7x have EVP_DigestFinal function which which clears all of EVP_MD_CTX. This makes pgcrypto crash in functions which re-use one digest context several times: hmac() and crypt() with md5 algorithm. Following patch fixes it by carring

Re: [PATCHES] pgcrypto: openssl digest fix

2005-03-11 Thread Neil Conway
Marko Kreen wrote: Some builds (depends on crypto engine support?) of OpenSSL 0.9.7x have EVP_DigestFinal function which which clears all of EVP_MD_CTX. This makes pgcrypto crash in functions which re-use one digest context several times: hmac() and crypt() with md5 algorithm. Following patch

Re: [PATCHES] pgcrypto: Makefile check

2004-11-22 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes: This patch makes the pgcrypto Makefile check that a recognized random source has been defined. If no such source is defined, pgcrypto will compile successfully but will be unusable. Oh? +$(error Unrecognized random source: $(random)) Doesn't look like a

Re: [PATCHES] pgcrypto: Makefile check

2004-11-22 Thread Neil Conway
Perhaps I wasn't clear: the *present* behavior of pgcrypto is to compile successfully but ... be unusable if an invalid random source is defined. This is prone to error. That patch changes this behavior to refuse to compile if an invalid random source has been defined. On Mon, 2004-11-22 at 10:46

Re: [PATCHES] pgcrypto: Makefile check

2004-11-22 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes: Perhaps I wasn't clear: the *present* behavior of pgcrypto is to compile successfully but ... be unusable if an invalid random source is defined. This is prone to error. That patch changes this behavior to refuse to compile if an invalid random source has

Re: [PATCHES] pgcrypto: Makefile check

2004-11-22 Thread Neil Conway
On Mon, 2004-11-22 at 19:10 -0500, Tom Lane wrote: Please do; I dislike makefiles that won't make clean ... Attached is a revised patch. Will apply in a few hours barring any objections. -Neil # # patch contrib/pgcrypto/random.c # from [2815b119334369b864e6b39fe21832b299fd235c] #to

[PATCHES] pgcrypto: Makefile check

2004-11-21 Thread Neil Conway
This patch makes the pgcrypto Makefile check that a recognized random source has been defined. If no such source is defined, pgcrypto will compile successfully but will be unusable. (An alternative place to do the check would be in random.c; comments on which location is preferrable are welcome.)

Re: [PATCHES] pgcrypto: make const array static

2004-10-04 Thread Neil Conway
On Mon, 2004-10-04 at 15:23, Neil Conway wrote: This one-line patches merges a micro-opt from upstream (OpenBSD) sources: we can make a read-only local array static and reduce the size of the generated object file slightly. Patch applied. -Neil ---(end of

[PATCHES] pgcrypto: make const array static

2004-10-03 Thread Neil Conway
This one-line patches merges a micro-opt from upstream (OpenBSD) sources: we can make a read-only local array static and reduce the size of the generated object file slightly. Barring any objections, I intend to apply this patch today or tomorrow. -Neil Index: contrib/pgcrypto/blf.c