#include <bio.h>

Inheritance diagram for Ssl::ClientBio:
Collaboration diagram for Ssl::ClientBio:

Public Member Functions

 ClientBio (const int anFd)
virtual void stateChanged (const SSL *ssl, int where, int ret)
virtual int write (const char *buf, int size, BIO *table)
 The ClientBio version of the Ssl::Bio::write method. More...
virtual int read (char *buf, int size, BIO *table)
void hold (bool h)
 Prevents or allow writing on socket. More...
void setReadBufData (SBuf &data)
virtual void flush (BIO *table)

Static Public Member Functions

static BIO * Create (const int fd, Security::Io::Type type)
static void Link (SSL *ssl, BIO *bio)
 Tells ssl connection to use BIO and monitor state via stateChanged() More...

Protected Attributes

const int fd_
 the SSL socket we are reading and writing More...
SBuf rbuf
 Used to buffer input data. More...

Private Attributes

bool holdRead_
 The read hold state of the bio. More...
bool holdWrite_
 The write hold state of the bio. More...
int helloSize
 The SSL hello message sent by client size. More...
FadingCounter renegotiations
 client requested renegotiations limit control More...
const char * abortReason
 why we should terminate the connection during next TLS operation (or nil) More...

Static Private Attributes

static const time_t RenegotiationsWindow = 10
 approximate size of a time window for computing client-initiated renegotiation rate (in seconds) More...
static const int RenegotiationsLimit = 5
 the maximum tolerated number of client-initiated renegotiations in RenegotiationsWindow More...

Detailed Description

BIO node to handle socket IO for squid client side If bumping is enabled this Bio detects and analyses client hello message to retrieve the SSL features supported by the client

Definition at line 70 of file bio.h.

Constructor & Destructor Documentation

◆ ClientBio()

Ssl::ClientBio::ClientBio ( const int  anFd)

Definition at line 167 of file bio.cc.

References FadingCounter::configure(), and renegotiations.

Member Function Documentation

◆ Create()

BIO * Ssl::Bio::Create ( const int  fd,
Security::Io::Type  type 

Creates a low-level BIO table, creates a high-level Ssl::Bio object for a given socket, and then links the two together via BIO_C_SET_FD.

Definition at line 62 of file bio.cc.

References NULL, squid_bio_create(), squid_bio_ctrl(), squid_bio_destroy(), squid_bio_puts(), squid_bio_read(), squid_bio_write(), SquidMethods, and type.

Referenced by CreateSession().

◆ flush()

virtual void Ssl::Bio::flush ( BIO *  table)

Flushes any buffered data to socket. The Ssl::Bio does not buffer any data, so this method has nothing to do

Reimplemented in Ssl::ServerBio.

Definition at line 47 of file bio.h.

Referenced by squid_bio_ctrl().

◆ hold()

void Ssl::ClientBio::hold ( bool  h)

Definition at line 86 of file bio.h.

References holdRead_, and holdWrite_.

Referenced by ConnStateData::doPeekAndSpliceStep(), and ConnStateData::startPeekAndSplice().

◆ Link()

void Ssl::Bio::Link ( SSL *  ssl,
BIO *  bio 

Definition at line 88 of file bio.cc.

References squid_ssl_info().

Referenced by CreateSession().

◆ read()

int Ssl::ClientBio::read ( char *  buf,
int  size,
BIO *  table 

The ClientBio version of the Ssl::Bio::read method If the holdRead flag is true then it does not write any data to socket and sets the "read retry" flag of the BIO to true

Reimplemented from Ssl::Bio.

Definition at line 216 of file bio.cc.

References buf, debugs, int, Ssl::Bio::read(), and size.

◆ setReadBufData()

void Ssl::ClientBio::setReadBufData ( SBuf data)

Sets the buffered input data (Bio::rbuf). Used to pass payload data (normally client HELLO data) retrieved by the caller.

Definition at line 91 of file bio.h.

References data, and Ssl::Bio::rbuf.

Referenced by ConnStateData::getSslContextDone(), and ConnStateData::startPeekAndSplice().

◆ stateChanged()

void Ssl::ClientBio::stateChanged ( const SSL *  ssl,
int  where,
int  ret 

The ClientBio version of the Ssl::Bio::stateChanged method When the client hello message retrieved, fill the "features" member with the client provided information.

Reimplemented from Ssl::Bio.

Definition at line 178 of file bio.cc.

References DBG_IMPORTANT, debugs, fd_table, and Ssl::Bio::stateChanged().

◆ write()

int Ssl::ClientBio::write ( const char *  buf,
int  size,
BIO *  table 

Reimplemented from Ssl::Bio.

Definition at line 199 of file bio.cc.

References buf, debugs, size, and Ssl::Bio::write().

Member Data Documentation

◆ abortReason

const char* Ssl::ClientBio::abortReason

Definition at line 105 of file bio.h.

◆ fd_

const int Ssl::Bio::fd_

Definition at line 63 of file bio.h.

Referenced by Ssl::Bio::Bio().

◆ helloSize

int Ssl::ClientBio::helloSize

Definition at line 101 of file bio.h.

◆ holdRead_

bool Ssl::ClientBio::holdRead_

Definition at line 99 of file bio.h.

Referenced by hold().

◆ holdWrite_

bool Ssl::ClientBio::holdWrite_

Definition at line 100 of file bio.h.

Referenced by hold().

◆ rbuf

SBuf Ssl::Bio::rbuf

Definition at line 64 of file bio.h.

Referenced by setReadBufData().

◆ renegotiations

FadingCounter Ssl::ClientBio::renegotiations

Definition at line 102 of file bio.h.

Referenced by ClientBio().

◆ RenegotiationsLimit

const int Ssl::ClientBio::RenegotiationsLimit = 5

Definition at line 97 of file bio.h.

◆ RenegotiationsWindow

const time_t Ssl::ClientBio::RenegotiationsWindow = 10

Definition at line 94 of file bio.h.

The documentation for this class was generated from the following files:






Web Site Translations