-----Original Message-----
From: Alex Cosic [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 25, 2000 12:41 AM
To: '[EMAIL PROTECTED]'
Subject: DSA_generate_parameters
> Hi all,
> I have made program which includes the following code:
> // make a ptr to a DSA structure
> dsa = DSA_new(); // make a new dsa
This is not necessary and causes a little memory leak
>
> // GENERATE PARAMETERS
> pBits = KEYLENGTH; // bits in a key (512)
> seedLen = 20; // starting seed for psuedo random generator
> dsa = DSA_generate_parameters(pBits, NULL, seedLen, NULL, NULL, NULL,
NULL);
^^^^
you shouldn't give a seedLen of 20 when you don't provide a
buffer with random data.
This is the way I do it:
DSA * pDSA;
unsigned char seed_buf[seed_len];
for (i = 0; i < seed_len; i++) seed_buf[i] = rand(); // well, not
very clever, but works...
pDSA = DSA_generate_parameters(
key_len,
seed_buf,
seed_len,
NULL,
NULL,
callback,
NULL);
DSA_generate_key(pDSA);
with the callback function:
void callback()
{
DoSomethingOrNot();
}
Robert
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]