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;
  }

---------------------------(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

Reply via email to