Re: using the bn library tips, faq or howto anywhere

2004-09-05 Thread Tan Eng Ten
Hmm, i think that depends on which BN_ functions. In your example, 
BN_bin2bn() returns a new BIGNUM object, so you do not need to BN_new().

b l wrote:
Hi,
If i reuse a BIGNUM created with BN_new() without
freeing it first will i cause a memory leak?
does the BIGNUM dynamically allocate memory each time
it is used by certain functions?
for example
i create BIGNUM * tempBN=BN_new();
i might make a call to 
BN_bin2bn (char1,len,tempBN);

i might make a similar call later
BN_bin2bn(char2,len2,tempBN);
is this reuse of a big number like this going to cause
a memory leak?? 
Is tempBN reusing the same memory or is it allocating
new memory. How is it working internally?

Is there a faq/sample code/tips on how to use the BN
library?
At the moment i allocate a lot of BIGNUM's using
BN_new() at the start of the program. I then reuse
these BIGNUM's over and over and over throughout
multiple runs of a long computation.
I had thought that by creating them at the start of
the program and then just reusing them that i wouldn't
be repeatedly dynamically allocating memory and not
freeing it. 
but now i'm not so sure. Musn't the BIGNUM be
reallocating memory every time i use it otherwise how 
does it know what size to make itself initially?
How should i do this type of thing properly?

thanks for any help.
b




___
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


Re: using the bn library tips, faq or howto anywhere

2004-09-05 Thread b l
thanks Nils,

brian


--- Nils Larsch <[EMAIL PROTECTED]> wrote:

> b l wrote:
> > Hi,
> > 
> > If i reuse a BIGNUM created with BN_new() without
> > freeing it first will i cause a memory leak?
> 
> no
> 
> > does the BIGNUM dynamically allocate memory each
> time
> > it is used by certain functions?
> 
> yes (but only if it's required)
> 
> > 
> > for example
> > i create BIGNUM * tempBN=BN_new();
> > 
> > i might make a call to 
> > BN_bin2bn (char1,len,tempBN);
> > 
> > i might make a similar call later
> > BN_bin2bn(char2,len2,tempBN);
> > 
> > is this reuse of a big number like this going to
> cause
> > a memory leak?? 
> 
> no
> 
> > Is tempBN reusing the same memory or is it
> allocating
> > new memory. How is it working internally?
> 
> if the current memory is sufficient to fulfil the
> task
> it's reused, otherwise it's increased via realloc
> etc.
> 
> > 
> > Is there a faq/sample code/tips on how to use the
> BN
> > library?
> 
> crypto/{rsa|dsa|...} ;-)
> 
> > 
> > At the moment i allocate a lot of BIGNUM's using
> > BN_new() at the start of the program. I then reuse
> > these BIGNUM's over and over and over throughout
> > multiple runs of a long computation.
> 
> alternative use BN_CTX (see for example 'man
> BN_CTX_new')
> 
> > 
> > I had thought that by creating them at the start
> of
> > the program and then just reusing them that i
> wouldn't
> > be repeatedly dynamically allocating memory and
> not
> > freeing it. 
> 
> that's true
> 
> > but now i'm not so sure. Musn't the BIGNUM be
> > reallocating memory every time i use it otherwise
> how 
> > does it know what size to make itself initially?
> > How should i do this type of thing properly?
> 
> Nils
>
__
> OpenSSL Project
> http://www.openssl.org
> User Support Mailing List   
> [EMAIL PROTECTED]
> Automated List Manager  
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


Re: Query on CRL distribution point

2004-09-05 Thread Dr. Stephen Henson
On Sun, Sep 05, 2004, pijush koley wrote:

> Hi!
> I want to setup a test CA using OpenSSL. So I configured openssl.cnf file according 
> to my environment. Then I executed following command
>  
> CA.pl -newca
>  
> This gave an error and it indicated that following line produced an error.
>  
> crlDistributionPoints = URI:ldap://:/CRLObjID=CRLPoint,o=domain
>  
> Than I changed this line to 
>  
> crlDistributionPoints = URI:http://:/TestCRL/
>  
> and this time whole setup worked fine. 
> Can anybody please tell me why crlDistributionPoints failed to take an URI started 
> with "ldap"?
>  

Yes its the embedded comma. If you need a comma then use the alternative
@section format mentioned in doc/openssl.txt

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


Re: using the bn library tips, faq or howto anywhere

2004-09-05 Thread Nils Larsch
b l wrote:
Hi,
If i reuse a BIGNUM created with BN_new() without
freeing it first will i cause a memory leak?
no
does the BIGNUM dynamically allocate memory each time
it is used by certain functions?
yes (but only if it's required)
for example
i create BIGNUM * tempBN=BN_new();
i might make a call to 
BN_bin2bn (char1,len,tempBN);

i might make a similar call later
BN_bin2bn(char2,len2,tempBN);
is this reuse of a big number like this going to cause
a memory leak?? 
no
Is tempBN reusing the same memory or is it allocating
new memory. How is it working internally?
if the current memory is sufficient to fulfil the task
it's reused, otherwise it's increased via realloc etc.
Is there a faq/sample code/tips on how to use the BN
library?
crypto/{rsa|dsa|...} ;-)
At the moment i allocate a lot of BIGNUM's using
BN_new() at the start of the program. I then reuse
these BIGNUM's over and over and over throughout
multiple runs of a long computation.
alternative use BN_CTX (see for example 'man BN_CTX_new')
I had thought that by creating them at the start of
the program and then just reusing them that i wouldn't
be repeatedly dynamically allocating memory and not
freeing it. 
that's true
but now i'm not so sure. Musn't the BIGNUM be
reallocating memory every time i use it otherwise how 
does it know what size to make itself initially?
How should i do this type of thing properly?
Nils
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


using the bn library tips, faq or howto anywhere

2004-09-05 Thread b l
Hi,

If i reuse a BIGNUM created with BN_new() without
freeing it first will i cause a memory leak?
does the BIGNUM dynamically allocate memory each time
it is used by certain functions?

for example
i create BIGNUM * tempBN=BN_new();

i might make a call to 
BN_bin2bn (char1,len,tempBN);

i might make a similar call later
BN_bin2bn(char2,len2,tempBN);

is this reuse of a big number like this going to cause
a memory leak?? 
Is tempBN reusing the same memory or is it allocating
new memory. How is it working internally?

Is there a faq/sample code/tips on how to use the BN
library?

At the moment i allocate a lot of BIGNUM's using
BN_new() at the start of the program. I then reuse
these BIGNUM's over and over and over throughout
multiple runs of a long computation.

I had thought that by creating them at the start of
the program and then just reusing them that i wouldn't
be repeatedly dynamically allocating memory and not
freeing it. 
but now i'm not so sure. Musn't the BIGNUM be
reallocating memory every time i use it otherwise how 
does it know what size to make itself initially?
How should i do this type of thing properly?

thanks for any help.

b









___
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


Query on CRL distribution point

2004-09-05 Thread pijush koley
Hi!
I want to setup a test CA using OpenSSL. So I configured openssl.cnf file according to my environment. Then I executed following command
 
CA.pl -newca
 
This gave an error and it indicated that following line produced an error.
 
crlDistributionPoints = URI:ldap://:/CRLObjID=CRLPoint,o=domain
 
Than I changed this line to 
 

crlDistributionPoints = URI:http://:/TestCRL/
 
and this time whole setup worked fine. 
Can anybody please tell me why crlDistributionPoints failed to take an URI started with "ldap"?
 
Thanks in advance.
Regards
-Pijush
 
 __Do You Yahoo!?Tired of spam?  Yahoo! Mail has the best spam protection around http://mail.yahoo.com 

A problem with the installation (Unable to load private key)

2004-09-05 Thread Nabil Azahaf
umask 77 ; \
/usr/bin/openssl req -new -key /etc/httpd/conf/ssl.key/server.key -out
/etc/httpd/conf/ssl.csr/server.csr
unable to load Private Key
14854:error:0906D06C:PEM routines:PEM_read_bio:no start
line:pem_lib.c:632:Expecting: ANY PRIVATE KEY
make: *** [/etc/httpd/conf/ssl.csr/server.csr] Error 1

^^ This happens when i'm giving the command: "make certreq" in the
directory: /usr/share/ssl/certs using Redhat 9 Shrike as operating
system, I have generated a key which is located at
/etc/httpd/conf/ssl.key/server.key.

Can any1 help me with this problem, I never worked  with OpenSSL before.

Thanks in advance,
Nabi1
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]