On Mon 20 Jun 2011 (11:00 -0700), David Schwartz wrote:
> 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.

Why not simply create a second socket - your app reads from that, does
whatever is needed and writes to the openssl socket. When openssl
writes to its socket, you read it, do whatever, then write it out your
socket?

-- 
Jim Segrave           j...@j-e-s.net


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to