Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are and how do I use OpenSSL BIO pairs?

Tags:

What exactly is a BIO pair in OpenSSL, and how is it intended to be used? I've already checked the OpenSSL docs, but any details are few and far between.

like image 345
Brian Avatar asked Jan 13 '09 15:01

Brian


2 Answers

A BIO in OpenSSL is similar to a File handle. You use a pair of them to communicate with each other securely like you would with two sockets. The best explanation I've found is here.

I also got a lot of use out of Herong Yang's site a few months ago when I had to write an application using OpenSSL. The sections on creating and signing certificates using OpenSSL and keytool were a big help when it came to testing my application.

like image 131
Bill the Lizard Avatar answered Oct 19 '22 08:10

Bill the Lizard


A BIO pair are two source/sink BIOs that are bound together. Anything that is written to one can be read from the other. If you have two BIOS already, you can join them together using BIO_make_bio_pair. Or you can create a new BIO pair with BIO_new_bio_pair.

One use mentioned in the Network Security with OpenSSL book (see page 111) is that the pair can be bound to a SSL engine. Anything written to the BIO pair will be read by the SSL engine. Anything written to the BIO pair can be read from. OpenSSL has a sample of this (see ssl/ssltest.c)

like image 45
ANuaimi Avatar answered Oct 19 '22 09:10

ANuaimi