Re: 4 pgcrypto regressions failures - 1 unsolved - Mailing list pgsql-hackers

From Tom Lane
Subject Re: 4 pgcrypto regressions failures - 1 unsolved
Date
Msg-id 8090.1121091012@sss.pgh.pa.us
Whole thread Raw
In response to Re: 4 pgcrypto regressions failures - 1 unsolved  (Marko Kreen <marko@l-t.ee>)
Responses Re: 4 pgcrypto regressions failures - 1 unsolved
List pgsql-hackers
Marko Kreen <marko@l-t.ee> writes:
> Result is - it's not so bad.  As I used rijndael.c to provide
> OpenSSL's own interface, I even got rid of all the ifdefs inside
> the code.

Looks good, but I'm still getting these compile warnings:

openssl.c: In function `ossl_des3_ecb_encrypt':
openssl.c:484: warning: passing arg 1 of `DES_ecb3_encrypt' from incompatible pointer type
openssl.c:484: warning: passing arg 2 of `DES_ecb3_encrypt' from incompatible pointer type
openssl.c: In function `ossl_des3_ecb_decrypt':
openssl.c:498: warning: passing arg 1 of `DES_ecb3_encrypt' from incompatible pointer type
openssl.c:498: warning: passing arg 2 of `DES_ecb3_encrypt' from incompatible pointer type

The following addition to the patch shuts up gcc with openssl 0.9.7a,
but I'm not sure if it will break anything with older openssl ---
comments?
        regards, tom lane


*** /home/postgres/pgsql/contrib/pgcrypto/openssl.c    Sun Jul 10 12:35:38 2005
--- new/openssl.c    Mon Jul 11 10:06:30 2005
***************
*** 446,452 ****     ossldata   *od = c->ptr;      for (i = 0; i < dlen / bs; i++)
!         DES_ecb3_encrypt(data + i * bs, res + i * bs,                          &od->u.des3.k1, &od->u.des3.k2,
&od->u.des3.k3,1);     return 0; }
 
--- 480,487 ----     ossldata   *od = c->ptr;      for (i = 0; i < dlen / bs; i++)
!         DES_ecb3_encrypt((const_DES_cblock *) (data + i * bs),
!                          (DES_cblock *) (res + i * bs),                          &od->u.des3.k1, &od->u.des3.k2,
&od->u.des3.k3,1);     return 0; }
 
***************
*** 460,466 ****     ossldata   *od = c->ptr;      for (i = 0; i < dlen / bs; i++)
!         DES_ecb3_encrypt(data + i * bs, res + i * bs,                          &od->u.des3.k1, &od->u.des3.k2,
&od->u.des3.k3,0);     return 0; }
 
--- 495,502 ----     ossldata   *od = c->ptr;      for (i = 0; i < dlen / bs; i++)
!         DES_ecb3_encrypt((const_DES_cblock *) (data + i * bs),
!                          (DES_cblock *) (res + i * bs),                          &od->u.des3.k1, &od->u.des3.k2,
&od->u.des3.k3,0);     return 0; }
 


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: suspicious pointer/integer coersion
Next
From: Tom Lane
Date:
Subject: Re: 4 pgcrypto regressions failures - 1 unsolved