Re: Bingo!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 16, 2007 at 11:17:23PM +0100, Sebastian Hagedorn wrote:

> I haven't yet found what BIO stands for According to Wikipedia it's "an 
> abstraction library used by OpenSSL to handle communication of various 
> kinds, including files and sockets, both secure and not".

You can think about a BIO as an object that wraps around a file (socket)
descriptor, has an internal buffer and some methods for reading and
writing. I.e. instead of calling the read() syscall on the socket, you
call the ->read method of the BIO, and that ->read method may do
whatever it wants including decrypting the raw SSL stream.

Of course this description is not entirely correct but is enough to give
you the idea.

> I'm not sure what to make of that. I would assume that we've got a blocking 
> BIO, because it is - d'oh - blocking. But I don't see how you influence 
> what kind of BIO you use.

A BIO is non-blocking if the underlying file (socket) descriptor has the
O_NONBLOCK flag set, either during open or by a previous call to
fcntl().

And yes, if O_NONBLOCK was not set on a socket, then any OpenSSL
operations can block pretty much indefinitely.

Gabor

-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------
----
Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux