Hi all,
I want to send ssl sessions from one process to other process. I am
using openssl-0.9.3 on Redhat Linux 6.0. Below is the routine I am using to
copy session.
If I run this I am getting this error
ERROR : error:0D067007:asn1 encoding
routines:ASN1_COLLATE_PRIMITIVE:expecting an asn1 sequence
Session len : 119 value : 0u
Can any one throw some light on what I am doing wrong.
int foo (SSL_SESSION * ssl_session)
{
char buf1[1024], buf [1024 * 10], *p;
int retval;
SSL_SESSION * new_session;
memset ((void *)buf, '\0', 1024 * 10);
p = &buf;
retval = i2d_SSL_SESSION (ssl_session, &p);
if (!retval)
return (-1);
printf ("Session len : %d value : %s\n", retval, buf);
new_session = d2i_SSL_SESSION (&new_session, &p, retval);
if (new_session == NULL) {
retval = ERR_get_error();
ERR_error_string (retval, buf1);
printf ("Session is not recovered .... \n");
printf ("ERROR : %s\n", buf1);
return (-1);
}
if (memcmp (new_session->session_id, ssl_session->session_id,
new_session->session_id_length) == 0)
printf ("-------- Equal .......\n");
else
printf ("-------- Different .......\n");
return 0;
}
Thanks in advance
bye
sarma
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]