thanks for the help.  i have been trying to get bio pairs working.  i found 
bio pair code in ssl/ssltect.c (ssltest seems to sit in a loop, checking if 
there is anything to read or write).

i'm not exactly sure what the correct way is write a client application that 
uses BIO functions to handle the whole SSL process (SSL handshake, symmetric 
key exchange, data encryption/decryption).

below is pseudo code for what i have so far.  does this seem right?  is 
there sample code somewhere that demonstrates the whole SSL process using 
BIO functions?

   /* setup ssl method and bio chain */
   c_ctx = SSL_CTX_new(SSLv3_client_method());
   c_ssl = SSL_new(c_ctx);

   BIO_new_bio_pair(client, BUF_SIZE, client_io, BUF_SIZE);
   c_ssl_bio = BIO_new(BIO_f_ssl());

   /* c_ssl_bio -> client -> client_io */
   SSL_set_connect_state(c_ssl);
   SSL_set_bio(c_ssl, client, client);
   BIO_set_ssl(c_ssl_bio, c_ssl, BIO_NOCLOSE);

   /* before/connect initialization */
   BIO_write(c_ssl_bio, buf, i);
   BIO_read(client_io, buf, sizeof(buf));
   i_send (conn, data, data_len);

   /* SSLv3 read server hello A */
   i_receive (conn, data, data_len);
   BIO_write(client_io, data, data_len);
   BIO_read(c_ssl_bio, buf, i);

   /* SSLv3 read finished A */
   BIO_write(c_ssl_bio, buf, i);
   BIO_read(client_io, buf, sizeof(buf));
   i_send (conn, data, data_len);

   /* SSL negotiation finished successfully */
   i_receive (conn, data, data_len);
   BIO_write(client_io, data, data_len);
   BIO_read(c_ssl_bio, buf, i);

thanks
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.

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

Reply via email to