[patch 1/9] Silence compiler warnings in openssl.c

From: Marko Kreen <markokr(at)gmail(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: [patch 1/9] Silence compiler warnings in openssl.c
Date: 2006-07-11 19:57:34
Message-ID: 20060711195802.031575000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Function DES_ecb3_encrypt has unstable signature in OpenSSL.

Different versions of OpenSSL have different argument types
and it is not possible to pick right types by OpenSSL version.

Following patch silents compiler by forcing argument to (void *).

Index: pgsql/contrib/pgcrypto/openssl.c
===================================================================
*** pgsql.orig/contrib/pgcrypto/openssl.c
--- pgsql/contrib/pgcrypto/openssl.c
*************** ossl_des3_ecb_encrypt(PX_Cipher * c, con
*** 526,532 ****
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;
}
--- 526,532 ----
ossldata *od = c->ptr;

for (i = 0; i < dlen / bs; i++)
! DES_ecb3_encrypt((void *)(data + i * bs), (void *)(res + i * bs),
&od->u.des3.k1, &od->u.des3.k2, &od->u.des3.k3, 1);
return 0;
}
*************** ossl_des3_ecb_decrypt(PX_Cipher * c, con
*** 540,546 ****
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;
}
--- 540,546 ----
ossldata *od = c->ptr;

for (i = 0; i < dlen / bs; i++)
! DES_ecb3_encrypt((void *)(data + i * bs), (void *)(res + i * bs),
&od->u.des3.k1, &od->u.des3.k2, &od->u.des3.k3, 0);
return 0;
}

--

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Kreen 2006-07-11 19:57:35 [patch 2/9] Fortuna tweaks
Previous Message Marko Kreen 2006-07-11 19:57:33 [patch 0/9] annual pgcrypto update

Browse pgsql-patches by date

  From Date Subject
Next Message Marko Kreen 2006-07-11 19:57:35 [patch 2/9] Fortuna tweaks
Previous Message Marko Kreen 2006-07-11 19:57:33 [patch 0/9] annual pgcrypto update