#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 *)
 
int fd () const
 The SSL socket descriptor. More...
 
const SBufrBufData ()
 The buffered input data. More...
 

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...
 
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)
explicit

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 
)
staticinherited

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 Ssl::Bio::fd(), 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().

◆ fd()

int Ssl::Bio::fd ( ) const
inlineinherited

◆ flush()

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

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)
inline

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 
)
staticinherited

Definition at line 88 of file bio.cc.

References squid_ssl_info().

Referenced by CreateSession().

◆ rBufData()

const SBuf& Ssl::Bio::rBufData ( )
inlineinherited

Definition at line 61 of file bio.h.

References Ssl::Bio::rbuf.

Referenced by Ssl::PeekingPeerConnector::initialize().

◆ read()

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

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 215 of file bio.cc.

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

◆ setReadBufData()

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

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 Ssl::Bio::rbuf.

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

◆ stateChanged()

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

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 177 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 
)
virtual

Reimplemented from Ssl::Bio.

Definition at line 198 of file bio.cc.

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

Member Data Documentation

◆ abortReason

const char* Ssl::ClientBio::abortReason
private

Definition at line 104 of file bio.h.

◆ fd_

const int Ssl::Bio::fd_
protectedinherited

Definition at line 63 of file bio.h.

Referenced by Ssl::Bio::Bio(), and Ssl::Bio::fd().

◆ holdRead_

bool Ssl::ClientBio::holdRead_
private

Definition at line 99 of file bio.h.

Referenced by hold().

◆ holdWrite_

bool Ssl::ClientBio::holdWrite_
private

Definition at line 100 of file bio.h.

Referenced by hold().

◆ rbuf

SBuf Ssl::Bio::rbuf
protectedinherited

Definition at line 64 of file bio.h.

Referenced by Ssl::Bio::rBufData(), and setReadBufData().

◆ renegotiations

FadingCounter Ssl::ClientBio::renegotiations
private

Definition at line 101 of file bio.h.

Referenced by ClientBio().

◆ RenegotiationsLimit

const int Ssl::ClientBio::RenegotiationsLimit = 5
staticprivate

Definition at line 97 of file bio.h.

◆ RenegotiationsWindow

const time_t Ssl::ClientBio::RenegotiationsWindow = 10
staticprivate

Definition at line 94 of file bio.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors