[patch 1/9] Silence compiler warnings in openssl.c - Mailing list pgsql-patches

From Marko Kreen
Subject [patch 1/9] Silence compiler warnings in openssl.c
Date
Msg-id 20060711195802.031575000@localhost.localdomain
Whole thread Raw
In response to [patch 0/9] annual pgcrypto update  (Marko Kreen <markokr@gmail.com>)
List 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;
  }

--

pgsql-patches by date:

Previous
From: Marko Kreen
Date:
Subject: [patch 4/9] Fix use of CAST5 in regtests.
Next
From: Dhanaraj M
Date:
Subject: Re: Patch for - Change LIMIT/OFFSET to use int8