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.
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 Kreen

cjcjameson/gpdb,Postgres-XL/Postgres-XL,CraigHarris/gpdb,ahachete/gpdb,snaga/postgres-xl,tangp3/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,techdragon/Postgres-XL,xuegang/gpdb,cjcjameson/gpdb,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,edespino/gpdb,0x0FFF/gpdb,royc1/gpdb,Chibin/gpdb,ovr/postgres-xl,postmind-net/postgres-xl,snaga/postgres-xl,jmcatamney/gpdb,foyzur/gpdb,Postgres-XL/Postgres-XL,tpostgres-projects/tPostgres,0x0FFF/gpdb,xinzweb/gpdb,zaksoup/gpdb,Chibin/gpdb,cjcjameson/gpdb,greenplum-db/gpdb,rvs/gpdb,kaknikhil/gpdb,adam8157/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,foyzur/gpdb,tpostgres-projects/tPostgres,CraigHarris/gpdb,foyzur/gpdb,zeroae/postgres-xl,randomtask1155/gpdb,cjcjameson/gpdb,rvs/gpdb,lpetrov-pivotal/gpdb,lisakowen/gpdb,randomtask1155/gpdb,postmind-net/postgres-xl,Quikling/gpdb,yazun/postgres-xl,jmcatamney/gpdb,techdragon/Postgres-XL,Quikling/gpdb,rubikloud/gpdb,rubikloud/gpdb,ashwinstar/gpdb,techdragon/Postgres-XL,tangp3/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,techdragon/Postgres-XL,rvs/gpdb,rubikloud/gpdb,kmjungersen/PostgresXL,ashwinstar/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,zaksoup/gpdb,lintzc/gpdb,zaksoup/gpdb,edespino/gpdb,0x0FFF/gpdb,arcivanov/postgres-xl,lisakowen/gpdb,snaga/postgres-xl,pavanvd/postgres-xl,tangp3/gpdb,xuegang/gpdb,kaknikhil/gpdb,Chibin/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,Quikling/gpdb,jmcatamney/gpdb,adam8157/gpdb,lisakowen/gpdb,adam8157/gpdb,xuegang/gpdb,0x0FFF/gpdb,yazun/postgres-xl,zeroae/postgres-xl,atris/gpdb,snaga/postgres-xl,cjcjameson/gpdb,Quikling/gpdb,randomtask1155/gpdb,royc1/gpdb,0x0FFF/gpdb,Chibin/gpdb,arcivanov/postgres-xl,rvs/gpdb,0x0FFF/gpdb,janebeckman/gpdb,atris/gpdb,zaksoup/gpdb,kaknikhil/gpdb,ahachete/gpdb,atris/gpdb,50wu/gpdb,kmjungersen/PostgresXL,royc1/gpdb,rvs/gpdb,chrishajas/gpdb,ashwinstar/gpdb,postmind-net/postgres-xl,CraigHarris/gpdb,lpetrov-pivotal/gpdb,foyzur/gpdb,50wu/gpdb,yazun/postgres-xl,chrishajas/gpdb,kaknikhil/gpdb,tpostgres-projects/tPostgres,pavanvd/postgres-xl,greenplum-db/gpdb,Chibin/gpdb,Chibin/gpdb,chrishajas/gpdb,janebeckman/gpdb,yazun/postgres-xl,ahachete/gpdb,ahachete/gpdb,zeroae/postgres-xl,tangp3/gpdb,greenplum-db/gpdb,xuegang/gpdb,royc1/gpdb,50wu/gpdb,Quikling/gpdb,foyzur/gpdb,tpostgres-projects/tPostgres,yuanzhao/gpdb,randomtask1155/gpdb,janebeckman/gpdb,lpetrov-pivotal/gpdb,ovr/postgres-xl,50wu/gpdb,Postgres-XL/Postgres-XL,edespino/gpdb,edespino/gpdb,ashwinstar/gpdb,pavanvd/postgres-xl,arcivanov/postgres-xl,50wu/gpdb,tpostgres-projects/tPostgres,janebeckman/gpdb,tangp3/gpdb,xuegang/gpdb,atris/gpdb,yuanzhao/gpdb,xinzweb/gpdb,chrishajas/gpdb,edespino/gpdb,randomtask1155/gpdb,arcivanov/postgres-xl,ovr/postgres-xl,xinzweb/gpdb,adam8157/gpdb,xuegang/gpdb,lpetrov-pivotal/gpdb,yazun/postgres-xl,chrishajas/gpdb,lintzc/gpdb,rvs/gpdb,lpetrov-pivotal/gpdb,randomtask1155/gpdb,jmcatamney/gpdb,kaknikhil/gpdb,ahachete/gpdb,ahachete/gpdb,lisakowen/gpdb,zeroae/postgres-xl,rvs/gpdb,Chibin/gpdb,zaksoup/gpdb,Chibin/gpdb,zeroae/postgres-xl,CraigHarris/gpdb,CraigHarris/gpdb,yuanzhao/gpdb,xinzweb/gpdb,janebeckman/gpdb,royc1/gpdb,lintzc/gpdb,lisakowen/gpdb,rubikloud/gpdb,atris/gpdb,adam8157/gpdb,jmcatamney/gpdb,Chibin/gpdb,janebeckman/gpdb,Chibin/gpdb,atris/gpdb,tangp3/gpdb,oberstet/postgres-xl,edespino/gpdb,royc1/gpdb,randomtask1155/gpdb,ahachete/gpdb,lintzc/gpdb,CraigHarris/gpdb,rubikloud/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,kmjungersen/PostgresXL,edespino/gpdb,kaknikhil/gpdb,foyzur/gpdb,lintzc/gpdb,royc1/gpdb,zaksoup/gpdb,pavanvd/postgres-xl,janebeckman/gpdb,zaksoup/gpdb,oberstet/postgres-xl,randomtask1155/gpdb,janebeckman/gpdb,xuegang/gpdb,kaknikhil/gpdb,rvs/gpdb,postmind-net/postgres-xl,kmjungersen/PostgresXL,foyzur/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,lpetrov-pivotal/gpdb,rvs/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,greenplum-db/gpdb,lintzc/gpdb,foyzur/gpdb,0x0FFF/gpdb,royc1/gpdb,lpetrov-pivotal/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,CraigHarris/gpdb,Postgres-XL/Postgres-XL,tangp3/gpdb,adam8157/gpdb,janebeckman/gpdb,chrishajas/gpdb,xinzweb/gpdb,lintzc/gpdb,greenplum-db/gpdb,0x0FFF/gpdb,oberstet/postgres-xl,xinzweb/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,chrishajas/gpdb,50wu/gpdb,rubikloud/gpdb,ahachete/gpdb,arcivanov/postgres-xl,lisakowen/gpdb,lintzc/gpdb,xuegang/gpdb,lintzc/gpdb,xinzweb/gpdb,yuanzhao/gpdb,rubikloud/gpdb,Quikling/gpdb,Quikling/gpdb,rvs/gpdb,janebeckman/gpdb,edespino/gpdb,postmind-net/postgres-xl,Quikling/gpdb,Quikling/gpdb,snaga/postgres-xl,edespino/gpdb,ovr/postgres-xl,CraigHarris/gpdb,atris/gpdb,50wu/gpdb,adam8157/gpdb,ovr/postgres-xl,tangp3/gpdb,yuanzhao/gpdb,arcivanov/postgres-xl,kmjungersen/PostgresXL,ashwinstar/gpdb,lisakowen/gpdb,oberstet/postgres-xl,chrishajas/gpdb,rubikloud/gpdb,edespino/gpdb,yuanzhao/gpdb,50wu/gpdb,techdragon/Postgres-XL,oberstet/postgres-xl,Postgres-XL/Postgres-XL,lpetrov-pivotal/gpdb,Quikling/gpdb,zaksoup/gpdb,xuegang/gpdb,atris/gpdb,kaknikhil/gpdb