Added support for ClientHello padding (RFC 7685) and fixed buffering bug.

This commit is contained in:
Thomas Pornin 2016-11-18 18:03:06 +01:00
parent e8929ff27f
commit 60126cafc8
7 changed files with 540 additions and 449 deletions

View file

@ -1020,6 +1020,14 @@ typedef struct {
*/
br_ssl_engine_context eng;
/*
* Minimum ClientHello length; padding with an extension (RFC
* 7685) is added if necessary to match at least that length.
* Such padding is nominally unnecessary, but it has been used
* to work around some server implementation bugs.
*/
uint16_t min_clienthello_len;
/*
* Implementations.
*/
@ -1081,6 +1089,15 @@ br_ssl_client_set_ecdsa(br_ssl_client_context *cc, br_ecdsa_vrfy iecdsa)
cc->iecdsa = iecdsa;
}
/*
* Set the minimum ClientHello length (RFC 7685 padding).
*/
static inline void
br_ssl_client_set_min_clienthello_len(br_ssl_client_context *cc, uint16_t len)
{
cc->min_clienthello_len = len;
}
/*
* Prepare or reset a client context for connecting with a server of
* name 'server_name'. The 'server_name' parameter is used to fill the