Thread: pgcrypto: OpenSSL/DES cleanup

pgcrypto: OpenSSL/DES cleanup

From
Marko Kreen
Date:
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
meantime.

Following patch converts DES also to newer API and provides
compatibility functions for OpenSSL < 0.9.7.

I chose this route because:

- openssl.c uses few DES functions.
- compatibility for old 'des_' API is going away at some point
  of time from OpenSSL.
- as seen from macros, new API is saner
- Thus pgcrypto supports any OpenSSL version from 0.9.5 to 1.0

Tested with OpenSSL 0.9.6c and 0.9.7e.

--
marko

PS. It's nice to see that the 'autoconfiguration' already pays
back.


Attachment

Re: pgcrypto: OpenSSL/DES cleanup

From
Michael Fuhr
Date:
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:

http://www.mail-archive.com/openssl-announce@openssl.org/msg00063.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Re: pgcrypto: OpenSSL/DES cleanup

From
Bruce Momjian
Date:
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_' API.
>
> I think I just used /usr/include/openssl/des.h for reference
> when implementing them, and had upgraded OpenSSL in the
> meantime.
>
> Following patch converts DES also to newer API and provides
> compatibility functions for OpenSSL < 0.9.7.
>
> I chose this route because:
>
> - openssl.c uses few DES functions.
> - compatibility for old 'des_' API is going away at some point
>   of time from OpenSSL.
> - as seen from macros, new API is saner
> - Thus pgcrypto supports any OpenSSL version from 0.9.5 to 1.0
>
> Tested with OpenSSL 0.9.6c and 0.9.7e.
>
> --
> marko
>
> PS. It's nice to see that the 'autoconfiguration' already pays
> back.
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073