|
Squid Web Cache master
|
#include <bio.h>
Public Member Functions | |
| ServerBio (const int anFd) | |
| void | stateChanged (const SSL *ssl, int where, int ret) override |
| The ServerBio version of the Ssl::Bio::stateChanged method. | |
| int | write (const char *buf, int size, BIO *table) override |
| int | read (char *buf, int size, BIO *table) override |
| void | flush (BIO *table) override |
| void | setClientFeatures (Security::TlsDetails::Pointer const &details, SBuf const &hello) |
| Sets the random number to use in client SSL HELLO message. | |
| bool | resumingSession () |
| bool | encryptedCertificates () const |
| bool | holdWrite () const |
| The write hold state. | |
| void | holdWrite (bool h) |
| Enables or disables the write hold state. | |
| void | recordInput (bool r) |
| Enables or disables the input data recording, for internal analysis. | |
| bool | canSplice () |
| Whether we can splice or not the SSL stream. | |
| bool | canBump () |
| Whether we can bump or not the SSL stream. | |
| void | mode (Ssl::BumpMode m) |
| The bumping mode. | |
| Ssl::BumpMode | bumpMode () |
| return the bumping mode | |
| bool | gotHello () const |
| bool | gotHelloFailed () const |
| Return true if the Server Hello parsing failed. | |
| const Security::TlsDetails::Pointer & | receivedHelloDetails () const |
| int | fd () const |
| The SSL socket descriptor. | |
| const SBuf & | rBufData () |
| The buffered input data. | |
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() | |
Protected Attributes | |
| const int | fd_ |
| the SSL socket we are reading and writing | |
| SBuf | rbuf |
| Used to buffer input data. | |
Private Member Functions | |
| int | readAndGive (char *buf, const int size, BIO *table) |
| Read and give everything to OpenSSL. | |
| int | readAndParse (char *buf, const int size, BIO *table) |
| int | readAndBuffer (BIO *table) |
| int | giveBuffered (char *buf, const int size) |
Private Attributes | |
| Security::TlsDetails::Pointer | clientTlsDetails |
| SSL client features extracted from ClientHello message or SSL object. | |
| SBuf | clientSentHello |
| TLS client hello message, used to adapt our tls Hello message to the server. | |
| SBuf | helloMsg |
| Used to buffer output data. | |
| mb_size_t | helloMsgSize |
| bool | helloBuild |
| True if the client hello message sent to the server. | |
| bool | allowSplice |
| True if the SSL stream can be spliced. | |
| bool | allowBump |
| True if the SSL stream can be bumped. | |
| bool | holdWrite_ |
| The write hold state of the bio. | |
| bool | record_ |
| If true the input data recorded to rbuf for internal use. | |
| bool | parsedHandshake |
| whether we are done parsing TLS Hello | |
| bool | parseError |
| error while parsing server hello message | |
| Ssl::BumpMode | bumpMode_ |
| size_t | rbufConsumePos |
| The size of data stored in rbuf which passed to the openSSL. | |
| Security::HandshakeParser | parser_ |
| The TLS/SSL messages parser. | |
BIO node to handle socket IO for squid server side If bumping is enabled, analyses the SSL hello message sent by squid OpenSSL subsystem (step3 bumping step) against bumping mode:
|
inline |
Definition at line 161 of file bio.h.
References bumpMode_.
Referenced by Ssl::PeekingPeerConnector::noteNegotiationError(), and Ssl::PeekingPeerConnector::noteWantWrite().
|
inline |
Definition at line 158 of file bio.h.
References allowBump.
Referenced by Ssl::PeekingPeerConnector::checkForPeekAndSplice().
|
inline |
Definition at line 156 of file bio.h.
References allowSplice.
Referenced by Ssl::PeekingPeerConnector::checkForPeekAndSplice().
|
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 63 of file bio.cc.
References Ssl::Bio::fd(), squid_bio_create(), squid_bio_ctrl(), squid_bio_destroy(), squid_bio_puts(), squid_bio_read(), squid_bio_write(), and SquidMethods.
Referenced by CreateSession().
| bool Ssl::ServerBio::encryptedCertificates | ( | ) | const |
whether the server encrypts its certificate (e.g., TLS v1.3)
| false | the server uses plain certs or its intent is unknown |
Definition at line 439 of file bio.cc.
References Security::Tls1p3orLater().
Referenced by Ssl::PeekingPeerConnector::noteNegotiationError().
|
inlineinherited |
Definition at line 49 of file bio.h.
References Ssl::Bio::fd_.
Referenced by Ssl::Bio::Create(), Security::NegotiationHistory::retrieveNegotiatedInfo(), and squid_bio_ctrl().
|
overridevirtual |
The ServerBio version of the Ssl::Bio::flush method. Flushes any buffered data
Reimplemented from Ssl::Bio.
Definition at line 424 of file bio.cc.
References Ssl::Bio::write().
|
inline |
| true | if the Server hello message received |
Definition at line 164 of file bio.h.
References parsedHandshake, and parseError.
|
inline |
Definition at line 167 of file bio.h.
References parsedHandshake, and parseError.
|
inline |
Definition at line 150 of file bio.h.
References holdWrite_.
Referenced by Ssl::PeekingPeerConnector::checkForPeekAndSpliceMatched(), Ssl::PeekingPeerConnector::noteNegotiationError(), and Ssl::PeekingPeerConnector::noteWantWrite().
|
inline |
Definition at line 152 of file bio.h.
References holdWrite_.
|
staticinherited |
|
inline |
Definition at line 160 of file bio.h.
References bumpMode_.
Referenced by Ssl::PeekingPeerConnector::initialize().
|
inlineinherited |
Definition at line 61 of file bio.h.
References Ssl::Bio::rbuf.
Referenced by Ssl::PeekingPeerConnector::initialize().
|
private |
Reads more data into the read buffer. Returns either the number of bytes read or, on errors (including "try again" errors), a negative number.
Definition at line 327 of file bio.cc.
References Ssl::Bio::read(), and SQUID_TCP_SO_RCVBUF.
Definition at line 281 of file bio.cc.
References Ssl::Bio::read(), and size.
|
inline |
Definition at line 170 of file bio.h.
References Security::HandshakeParser::details, and parser_.
Referenced by Security::PeerConnector::recordNegotiationDetails().
|
inline |
Definition at line 154 of file bio.h.
References record_.
Referenced by Ssl::PeekingPeerConnector::checkForPeekAndSpliceMatched(), and Ssl::PeekingPeerConnector::initialize().
| bool Ssl::ServerBio::resumingSession | ( | ) |
Definition at line 433 of file bio.cc.
Referenced by Ssl::PeekingPeerConnector::noteNegotiationError().
| void Ssl::ServerBio::setClientFeatures | ( | Security::TlsDetails::Pointer const & | details, |
| SBuf const & | hello | ||
| ) |
Definition at line 264 of file bio.cc.
Referenced by Ssl::PeekingPeerConnector::initialize().
Reimplemented from Ssl::Bio.
Definition at line 258 of file bio.cc.
References Ssl::Bio::stateChanged().
The ServerBio version of the Ssl::Bio::write method If a clientRandom number is set then rewrites the raw hello message "client random" field with the provided random number. It may buffer the output packets.
Reimplemented from Ssl::Bio.
Definition at line 355 of file bio.cc.
References assert, Ssl::bumpPeek, Ssl::bumpStare, debugs, Must, size, and Ssl::Bio::write().
|
private |
|
private |
Definition at line 185 of file bio.h.
Referenced by canSplice().
|
private |
Definition at line 191 of file bio.h.
Referenced by bumpMode(), and mode().
|
private |
|
protectedinherited |
Definition at line 63 of file bio.h.
Referenced by Ssl::Bio::Bio(), and Ssl::Bio::fd().
|
private |
Definition at line 187 of file bio.h.
Referenced by holdWrite(), and holdWrite().
|
private |
Definition at line 189 of file bio.h.
Referenced by gotHello(), and gotHelloFailed().
|
private |
Definition at line 190 of file bio.h.
Referenced by gotHello(), and gotHelloFailed().
|
private |
Definition at line 195 of file bio.h.
Referenced by receivedHelloDetails().
|
protectedinherited |
Definition at line 64 of file bio.h.
Referenced by Ssl::Bio::rBufData(), and Ssl::ClientBio::setReadBufData().
|
private |
Definition at line 188 of file bio.h.
Referenced by recordInput().