On 6/15/2011 11:57 AM, ml.vladimbe...@gmail.com wrote:
Hello. By default OpenSSL itself works with sockets. I would want to implement operation with sockets without admitting it to OpenSSL. I.e. for example, when OpenSSL wants to write down something in a socket, it should cause my function and I will transfer data to the socket. And it is exact also obtaining the data from a socket I cause a function of OpenSSL, transferring to it the data accepted from a socket. I.e. I implement function WriteSocket. When OpenSSL wants to write something in a socket, it causes WriteSocket and nothing more it should disturb.
Well that wouldn't work as stated. How would OpenSSL know when it was time to call WriteSocket? You will have to call into OpenSSL when you want to see if has any data it needs to write to the socket.
In fact, you will have to manage *four* I/O streams to and from OpenSSL. When you receive encrypted data from the socket, you will have to hand it to OpenSSL. When you know it is safe to write to the socket, you will need to check if OpenSSL has any encrypted data to send and if so, read it from OpenSSL and send it to the other side. When anything changes, you will also need to check if OpenSSL has any decrypted plaintext to deliver to your application. And you will have to pass any plaintext your application wish to send to OpenSSL.
> When the data from a socket has come I send notification
message OpenSSL about that the data has come, actually I cause function of OpenSSL ReadSocket, transferring it the buffer with the come data. I.e. any operations of waiting of reading OpenSSL is not necessary to do, it has sent the data and can easy smoke a bamboo, expecting when I will cause ReadSocket. Whether is it possible to implement? I have read in the documentation about BIO-functions, and could not understand is it possible to implement or not.
Look at the example code that uses BIO pairs. DS ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org