Mailing List Archive

Usage of gcry_pk_genkey()
hi again,
I wrote a wrapper for the gcry_pk_genkey() function

int crypto_rsagenkey(GCRY_SEXP *key,int bits)
{
int ret;
GCRY_SEXP parms;
gcry_sexp_build( &parms, NULL, "(genkey(rsa(nbits %d)))", bits);
ret=gcry_pk_genkey( key,parms );
gcry_sexp_release( parms );
return ret;
}

void crypto_releasekey(GCRY_SEXP key)
{
gcry_sexp_dump(key);
gcry_sexp_release(key);
}

But if I use the crypto_rsagenkey() Wrapper function I recive this output

.+++++
DBG: overflow in prime generation
:....+++++
DBG: overflow in prime generation
:.........+++++
DBG: overflow in prime generation
:.....+++++
DBG: overflow in prime generation
:.+++++
DBG: overflow in prime generation
and so on until I stop the program

what is wrong with my wrapper function?
Re: Usage of gcry_pk_genkey() [ In reply to ]
On Mon Apr 29 2002; 21:16, Rüdiger Sonderfeld wrote:

> I wrote a wrapper for the gcry_pk_genkey() function
[snip]

The code seems to be okay, I tested it.


> But if I use the crypto_rsagenkey() Wrapper function I recive this output
[snip]
> and so on until I stop the program
>
> what is wrong with my wrapper function?

I've no idea. But for me it works:
--
+++++
+++++
[open]
SEXP OUTPUT
[close]
--

Maybe it's a problem with your libgcrypt version. But IIRC you said
you used 1.1.6 and I use the same and I succeed.


Timo
Re: Usage of gcry_pk_genkey() [ In reply to ]
On Mon, 29 Apr 2002 21:16:41 +0200, Rüdiger Sonderfeld said:

> DBG: overflow in prime generation
> and so on until I stop the program

You are using 1.1.5, right? There is a silly bug in it - upgrade to
1.1.6.

2002-01-04 Werner Koch <wk@gnupg.org>

* primegen.c (gen_prime): Of course we should use set_bit
and not set_highbit to set the second high bit.
Re: Usage of gcry_pk_genkey() [ In reply to ]
Am Montag, 29. April 2002 22:26 schrieb Werner Koch:
> On Mon, 29 Apr 2002 21:16:41 +0200, Rüdiger Sonderfeld said:
> > DBG: overflow in prime generation
> > and so on until I stop the program
>
> You are using 1.1.5, right? There is a silly bug in it - upgrade to
> 1.1.6.

I have installed 1.1.6 but this printf("%s\n",gcry_check_version(NULL));
prints 1.1.5
*confused*
Re: Usage of gcry_pk_genkey() [ In reply to ]
On Sat May 04 2002; 22:02, Rüdiger Sonderfeld wrote:

> I have installed 1.1.6 but this printf("%s\n",gcry_check_version(NULL));
> prints 1.1.5
> *confused*

Maybe there is something wrong with your libs?
For example in /usr/lib gcrypt 1.1.5 and in /usr/local/lib 1.1.6?

You could use the ldd program to find out what version gcc
used for linking...


Timo
Re: Usage of gcry_pk_genkey() [ In reply to ]
Am Samstag, 4. Mai 2002 22:20 schrieb Timo Schulz:
> On Sat May 04 2002; 22:02, Rüdiger Sonderfeld wrote:
> > I have installed 1.1.6 but this printf("%s\n",gcry_check_version(NULL));
> > prints 1.1.5
> > *confused*
>
> Maybe there is something wrong with your libs?
> For example in /usr/lib gcrypt 1.1.5 and in /usr/local/lib 1.1.6?
>
> You could use the ldd program to find out what version gcc
> used for linking...

I'm an idiot! I updated the lib in /usr/local/lib but in /usr/local/lib there
were the old file...

now it works!

Thanks