]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: ssl: add new files ssl_sock.[ch] to provide the SSL data layer
authorEmeric Brun <ebrun@exceliance.fr>
Fri, 18 May 2012 13:47:34 +0000 (15:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 3 Sep 2012 18:49:14 +0000 (20:49 +0200)
commit4659195e31d8c44cf04ecc12e31712a426a9ef95
treeed951b56512956ec761ef937c5d92385b4aff76c
parent7dd0e505ca5d2230a0785dc2159bfa8acfef56c2
MEDIUM: ssl: add new files ssl_sock.[ch] to provide the SSL data layer

This data layer supports socket-to-buffer and buffer-to-socket operations.
No sock-to-pipe nor pipe-to-sock functions are provided, since splicing does
not provide any benefit with data transformation. At best it could save a
memcpy() and avoid keeping a buffer allocated but that does not seem very
useful.

An init function and a close function are provided because the SSL context
needs to be allocated/freed.

A data-layer shutw() function is also provided because upon successful
shutdown, we want to store the SSL context in the cache in order to reuse
it for future connections and avoid a new key generation.

The handshake function is directly called from the connection handler.
At this point it is not certain whether this will remain this way or
if a new ->handshake callback will be added to the data layer so that
the connection handler doesn't care about SSL.

The sock-to-buf and buf-to-sock functions are all capable of enabling
the SSL handshake at any time. This also implies polling in the opposite
direction to what was expected. The upper layers must take that into
account (it is OK right now with the stream interface).
include/proto/ssl_sock.h [new file with mode: 0644]
src/connection.c
src/ssl_sock.c [new file with mode: 0644]