please help me.....

2007-06-25 Thread sri dhar
hi ,
  I am sridhar.D
  I have a RSA key information on buffer.i want to merge with buffer content to 
SSLcontext object.
   i am using SSL_CTX_use_RSAPrivateKey_ASN1(ctxr[i],keyinfo,strlen(keyinfo)) 
this SSL API.
  that  API is failing . it gives following error message.
   
   
  9755: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong 
tag:tasn_dec.c:1282:
  29755: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 
error:tasn_dec.c:374:Type=RSA
  29755: error:140B200D:SSL routines:SSL_CTX_use_RSAPrivateKey_ASN1:ASN1 
lib:ssl_rsa.c:607
   
   
  how to resolve the issue. please help me.

   
-
 Download prohibited? No problem. CHAT from any browser, without download.

Re: please help me.....

2007-06-25 Thread sri dhar
i tried that way, now its generating coredump files.is there any other way to 
solve that issue...

Marek Marcola <[EMAIL PROTECTED]> wrote:  Hello,
> 
> I have a RSA key information on buffer.i want to merge with buffer
> content to SSLcontext object.
> i am using
> SSL_CTX_use_RSAPrivateKey_ASN1(ctxr[i],keyinfo,strlen(keyinfo)) this
> SSL API.
> that API is failing . it gives following error message.
> 
> 
> 9755: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong
> tag:tasn_dec.c:1282:
> 29755: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested
> asn1 error:tasn_dec.c:374:Type=RSA
> 29755: error:140B200D:SSL routines:SSL_CTX_use_RSAPrivateKey_ASN1:ASN1
> lib:ssl_rsa.c:607
> 
> 
> how to resolve the issue. please help me.
Try d2i_RSAPrivateKey() if your buffer has RSA key in DER format.

Best regards,
-- 
Marek Marcola 

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



-
 Here’s a new way to find what you're looking for - Yahoo! Answers 

Re: please help me.....

2007-06-25 Thread sri dhar
ok i l try that.let me know u ..

Marek Marcola <[EMAIL PROTECTED]> wrote:  Hello,
> i tried that way, now its generating coredump files.is there any other
> way to solve that issue...

You should use something like that (buf and len has your key):

unsigned char *p;
RSA *rsa = NULL;

p = buf;
if ((rsa=d2i_RSAPrivateKey(NULL,&p,(long)len)) == NULL){
goto err;
}
if (SSL_CTX_use_RSAPrivateKey(ctx,rsa) != 1){
goto err;
}
RSA_free(rsa);

But you should be sure that buf has DER (ASN.1) PKCS1 private key.
If you dump this buffer to file, you should be able to do something
like that:
$ openssl rsa -in key.der -inform der -text -noout
$ openssl asn1parse -in key.der -inform der
If you will get error then probably you have pem format, you may try
to convert with:
$ openssl rsa -in key.pem -outform der -out key.der
and try again.

Best regards,
-- 
Marek Marcola 

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


   
-
 The DELETE button on Yahoo! Mail is unhappy. Know why?

Re: please help me.....

2007-06-25 Thread sri dhar
i tried that way,buffer information is  not DER format.
  buffer header like this.
  -BEGIN RSA PRIVATE KEY-
..
   
  -END RSA PRIVATE KEY-
   
  Is they anyother way to resolve that problem?
  


Marek Marcola <[EMAIL PROTECTED]> wrote:
  Hello,
> 
> I have a RSA key information on buffer.i want to merge with buffer
> content to SSLcontext object.
> i am using
> SSL_CTX_use_RSAPrivateKey_ASN1(ctxr[i],keyinfo,strlen(keyinfo)) this
> SSL API.
> that API is failing . it gives following error message.
> 
> 
> 9755: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong
> tag:tasn_dec.c:1282:
> 29755: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested
> asn1 error:tasn_dec.c:374:Type=RSA
> 29755: error:140B200D:SSL routines:SSL_CTX_use_RSAPrivateKey_ASN1:ASN1
> lib:ssl_rsa.c:607
> 
> 
> how to resolve the issue. please help me.
Try d2i_RSAPrivateKey() if your buffer has RSA key in DER format.

Best regards,
-- 
Marek Marcola 

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



-
 Here’s a new way to find what you're looking for - Yahoo! Answers 

Re: please help me.....

2007-06-25 Thread sri dhar
thank you, its working fine.

Marek Marcola <[EMAIL PROTECTED]> wrote:  Hello,
> ok i l try that.let me know u ..

You may try something like that (not tested):

int rsa_read_pem(RSA ** rsa, char *buf, int len)
{
BIO *mem;

if ((mem = BIO_new_mem_buf(buf, len)) == NULL) {
goto err;
}

*rsa = PEM_read_bio_RSAPrivateKey(mem, NULL, NULL, NULL);
BIO_free(mem);

if (*rsa == NULL) {
goto err;
}

return (0);

err:
return (-1);
}

Best regards,
-- 
Marek Marcola 

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


   
-
 The DELETE button on Yahoo! Mail is unhappy. Know why?

Re: TLS ALERT PROTOCOL VERSION Error

2007-08-08 Thread sri dhar
hi mahesh,
openssl version number should be same for both server and 
client.
  if u server or client,check other side openssl version number.update that 
openssl version in your side.then check it...

Mahesh Dantakale <[EMAIL PROTECTED]> wrote:
  Hi all,

I am working on TLS Authentication using OpenSSL 0.9.8a.

When I am trying for Mutual Authentication, the OpenSSL throws "tlsv1 alert 
protocol version" followed by "ssl handshake failure". 

Can anybody explain me, what exactly this problem is?

Log :

DEBUG-> [Wed Aug 08 12:38:24][../src/eapTLSWrapper.c->352]BIO_read -1 bytes , 
errno 0 
ERROR-> [Wed Aug 08 12:38:24][../src/eapTLSWrapper.c->356] SSL_get_error 
returned... 1 
 ERROR-> [Wed Aug 08 12:38:24][../src/eapTLSWrapper.c->389] SSL_get_error 
returned...SSL_ERROR_SSL 
 ERROR-> [Wed Aug 08 12:38:24][../src/eapTLSWrapper.c->393] SSL_get_error 
returned...error:1409442E:SSL routines:SSL3_READ_BYTES:tlsv1 alert protocol 
version 
 ERROR-> [Wed Aug 08 12:38:24][../src/eapTLSWrapper.c->396] SSL_get_error 
returned...error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake 
failure 

Thanks
Mahesh




   
-
 5, 50, 500, 5000 - Store unlimited mails in your inbox. Click here.