Re: [HACKERS] [PATCHES] [patch 0/9] annual pgcrypto update

2006-07-15 Thread Tom Lane
"Marko Kreen" <[EMAIL PROTECTED]> writes:
> iMath's protability checks failed.  Attached patch drops them
> and expects postgres.h to give correct types.

> Also enable asserts to fail earlier.

Applied, thanks.  Looks like this should fix current buildfarm
failure on "bear".

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] [PATCHES] [patch 0/9] annual pgcrypto update

2006-07-15 Thread Marko Kreen

On 7/14/06, Tom Lane <[EMAIL PROTECTED]> wrote:

I wrote:
> Applied, thanks.  What I now see is that pgp-pubkey-decrypt passes on
> a 32-bit machine but dumps core on a 64-bit machine, with SIGSEGV here:

Addendum: seems it only fails without openssl.


iMath's protability checks failed.  Attached patch drops them
and expects postgres.h to give correct types.

Also enable asserts to fail earlier.

--
marko
Index: contrib/pgcrypto/imath.c
===
RCS file: /opt/cvs/pgsql/contrib/pgcrypto/imath.c,v
retrieving revision 1.1
diff -u -c -r1.1 imath.c
*** contrib/pgcrypto/imath.c	13 Jul 2006 04:15:24 -	1.1
--- contrib/pgcrypto/imath.c	15 Jul 2006 01:12:52 -
***
*** 33,39 
  #include "imath.h"
  
  #undef assert
! #define assert(TEST)
  #define TRACEABLE_CLAMP 0
  #define TRACEABLE_FREE 0
  
--- 33,39 
  #include "imath.h"
  
  #undef assert
! #define assert(TEST) Assert(TEST)
  #define TRACEABLE_CLAMP 0
  #define TRACEABLE_FREE 0
  
Index: contrib/pgcrypto/imath.h
===
RCS file: /opt/cvs/pgsql/contrib/pgcrypto/imath.h,v
retrieving revision 1.1
diff -u -c -r1.1 imath.h
*** contrib/pgcrypto/imath.h	13 Jul 2006 04:15:24 -	1.1
--- contrib/pgcrypto/imath.h	15 Jul 2006 01:15:02 -
***
*** 39,49 
  typedef unsigned int   mp_size;
  typedef intmp_result;
  #ifdef USE_LONG_LONG
! typedef unsigned int   mp_digit;
! typedef unsigned long long mp_word;
  #else
! typedef unsigned short mp_digit;
! typedef unsigned int   mp_word;
  #endif
  
  typedef struct mpz {
--- 39,53 
  typedef unsigned int   mp_size;
  typedef intmp_result;
  #ifdef USE_LONG_LONG
! typedef uint32 mp_digit;
! typedef uint64 mp_word;
! #define MP_DIGIT_MAX   0xULL
! #define MP_WORD_MAX0xULL
  #else
! typedef uint16 mp_digit;
! typedef uint32 mp_word;
! #define MP_DIGIT_MAX   0xUL
! #define MP_WORD_MAX0xUL
  #endif
  
  typedef struct mpz {
***
*** 70,90 
  #define MP_DIGIT_BIT(sizeof(mp_digit) * CHAR_BIT)
  #define MP_WORD_BIT (sizeof(mp_word) * CHAR_BIT)
  
- #ifdef USE_LONG_LONG
- #  ifndef ULONG_LONG_MAX
- #ifdef ULLONG_MAX
- #  define ULONG_LONG_MAX   ULLONG_MAX
- #else
- #  error "Maximum value of unsigned long long not defined!"
- #endif
- #  endif
- #  define MP_DIGIT_MAX   (ULONG_MAX * 1ULL)
- #  define MP_WORD_MAXULONG_LONG_MAX
- #else
- #  define MP_DIGIT_MAX(USHRT_MAX * 1UL)
- #  define MP_WORD_MAX (UINT_MAX * 1UL)
- #endif
- 
  #define MP_MIN_RADIX2
  #define MP_MAX_RADIX36
  
--- 74,79 

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] [PATCHES] [patch 0/9] annual pgcrypto update

2006-07-14 Thread Tom Lane
I wrote:
> Applied, thanks.  What I now see is that pgp-pubkey-decrypt passes on
> a 32-bit machine but dumps core on a 64-bit machine, with SIGSEGV here:

Addendum: seems it only fails without openssl.

regards, tom lane

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


Re: [HACKERS] [PATCHES] [patch 0/9] annual pgcrypto update

2006-07-14 Thread Tom Lane
"Marko Kreen" <[EMAIL PROTECTED]> writes:
> On 7/13/06, Neil Conway <[EMAIL PROTECTED]> wrote:
>> Marko, can you take a look at what is causing this regression test
>> failure? The failing machine is kudu:

> Seems you have skipped the CAST5 patch.  Could you recheck?

Applied, thanks.  What I now see is that pgp-pubkey-decrypt passes on
a 32-bit machine but dumps core on a 64-bit machine, with SIGSEGV here:

#0  0x2c8b82ba in mp_int_div (a=Variable "a" is not available.
) at imath.c:3068
3068  q.digits[qpos++] = (mp_digit) qdigit;
(gdb) bt
#0  0x2c8b82ba in mp_int_div (a=Variable "a" is not available.
) at imath.c:3068
#1  0x2c8b9531 in mp_int_exptmod (a=0x970a28, b=0x978530, m=0x9780e0,
c=0x978980) at imath.c:1234
#2  0x2c8b4ef3 in pgp_elgamal_decrypt (pk=Variable "pk" is not 
available.
) at pgp-mpi-internal.c:225
#3  0x2c8be2b9 in pgp_parse_pubenc_sesskey (ctx=0x972848,
pkt=0x977328) at pgp-pubdec.c:116
#4  0x2c8bca0b in pgp_decrypt (ctx=0x972848, msrc=Variable "msrc" is 
not available.
)
at pgp-decrypt.c:1126
#5  0x2c8c0a73 in decrypt_internal (is_pubenc=0, need_text=1,
data=0x9772d0, key=0x976ab8, keypsw=0x0, args=Variable "args" is not 
available.

Any thoughts about the cause?

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] [PATCHES] [patch 0/9] annual pgcrypto update

2006-07-14 Thread Marko Kreen

On 7/13/06, Neil Conway <[EMAIL PROTECTED]> wrote:

Marko, can you take a look at what is causing this regression test
failure? The failing machine is kudu:


Seems you have skipped the CAST5 patch.  Could you recheck?

--
marko

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


Re: [HACKERS] [PATCHES] [patch 0/9] annual pgcrypto update

2006-07-12 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes:
> On Tue, 2006-07-11 at 15:57 -0400, Marko Kreen wrote:
>> Few cleanups and couple of new things [...]

> Applied, thanks for the patch.

This has broken two out of the four buildfarm members that reported
in the last half hour :-(  I think kudu does not like // comments,
not sure what kookaburra is on about.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] [PATCHES] [patch 0/9] annual pgcrypto update

2006-07-12 Thread Neil Conway
On Thu, 2006-07-13 at 00:50 -0400, Tom Lane wrote:
> This has broken two out of the four buildfarm members that reported
> in the last half hour :-(  I think kudu does not like // comments,
> not sure what kookaburra is on about.

BTW, you've switched your animal names :) I fixed the C++-style comment.

Marko, can you take a look at what is causing this regression test
failure? The failing machine is kudu:

http://www.pgbuildfarm.org/cgi-bin/show_history.pl?nm=kudu&br=HEAD

The regression.diffs are:

*** ./expected/pgp-pubkey-decrypt.out   Wed Jul 12 21:30:59 2006
--- ./results/pgp-pubkey-decrypt.outWed Jul 12 21:39:15 2006
***
*** 544,555 
  -- password-protected secret key, wrong password
  select pgp_pub_decrypt(dearmor(data), dearmor(seckey), 'foo')
  from keytbl, encdata where keytbl.id=5 and encdata.id=1;
! ERROR:  Corrupt data
  -- password-protected secret key, right password
  select pgp_pub_decrypt(dearmor(data), dearmor(seckey), 'parool')
  from keytbl, encdata where keytbl.id=5 and encdata.id=1;
!  pgp_pub_decrypt 
! -
!  Secret msg
! (1 row)
! 
--- 544,551 
  -- password-protected secret key, wrong password
  select pgp_pub_decrypt(dearmor(data), dearmor(seckey), 'foo')
  from keytbl, encdata where keytbl.id=5 and encdata.id=1;
! ERROR:  Unsupported cipher algorithm
  -- password-protected secret key, right password
  select pgp_pub_decrypt(dearmor(data), dearmor(seckey), 'parool')
  from keytbl, encdata where keytbl.id=5 and encdata.id=1;
! ERROR:  Unsupported cipher algorithm

-Neil



---(end of broadcast)---
TIP 6: explain analyze is your friend