Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Wrapper around cSslContext that is used when this link is being encrypted by SSL. More...
#include <TCPLinkImpl.h>
Public Member Functions | |
cLinkTlsContext (cTCPLinkImpl &a_Link) | |
void | FlushBuffers (void) |
Tries to read any cleartext data available through the SSL, reports it in the link. More... | |
bool | IsLink (cTCPLinkImpl *a_Link) |
Returns true if the context's associated TCP link is the same link as a_Link. More... | |
virtual int | ReceiveEncrypted (unsigned char *a_Buffer, size_t a_NumBytes) override |
void | ResetSelf (void) |
Removes the self ownership so that we can detect the SSL closure. More... | |
void | Send (const void *a_Data, size_t a_Length) |
Sends the specified cleartext data over the SSL to the remote peer. More... | |
virtual int | SendEncrypted (const unsigned char *a_Buffer, size_t a_NumBytes) override |
void | SetSelf (cLinkTlsContextWPtr a_Self) |
Shares ownership of self, so that this object can keep itself alive for as long as it needs. More... | |
void | StoreReceivedData (const char *a_Data, size_t a_NumBytes) |
Stores the specified block of data into the buffer of the data to be decrypted (incoming from remote). More... | |
void | TryFinishHandshaking (void) |
Tries to finish handshaking the SSL. More... | |
Private Attributes | |
AString | m_CleartextData |
Buffer for storing the outgoing cleartext data until the link has finished handshaking. More... | |
AString | m_EncryptedData |
Buffer for storing the incoming encrypted data until it is requested by the SSL decryptor. More... | |
cTCPLinkImpl & | m_Link |
cLinkTlsContextWPtr | m_Self |
Shared ownership of self, so that this object can keep itself alive for as long as it needs. More... | |
Wrapper around cSslContext that is used when this link is being encrypted by SSL.
Definition at line 95 of file TCPLinkImpl.h.
cTCPLinkImpl::cLinkTlsContext::cLinkTlsContext | ( | cTCPLinkImpl & | a_Link | ) |
Definition at line 566 of file TCPLinkImpl.cpp.
void cTCPLinkImpl::cLinkTlsContext::FlushBuffers | ( | void | ) |
Tries to read any cleartext data available through the SSL, reports it in the link.
Definition at line 611 of file TCPLinkImpl.cpp.
|
inline |
Returns true if the context's associated TCP link is the same link as a_Link.
Definition at line 137 of file TCPLinkImpl.h.
|
overridevirtual |
Definition at line 684 of file TCPLinkImpl.cpp.
void cTCPLinkImpl::cLinkTlsContext::ResetSelf | ( | void | ) |
Removes the self ownership so that we can detect the SSL closure.
Definition at line 584 of file TCPLinkImpl.cpp.
void cTCPLinkImpl::cLinkTlsContext::Send | ( | const void * | a_Data, |
size_t | a_Length | ||
) |
Sends the specified cleartext data over the SSL to the remote peer.
If the handshake hasn't been completed yet, queues the data for sending when it completes.
Definition at line 662 of file TCPLinkImpl.cpp.
|
overridevirtual |
Definition at line 706 of file TCPLinkImpl.cpp.
void cTCPLinkImpl::cLinkTlsContext::SetSelf | ( | cLinkTlsContextWPtr | a_Self | ) |
Shares ownership of self, so that this object can keep itself alive for as long as it needs.
Definition at line 575 of file TCPLinkImpl.cpp.
void cTCPLinkImpl::cLinkTlsContext::StoreReceivedData | ( | const char * | a_Data, |
size_t | a_NumBytes | ||
) |
Stores the specified block of data into the buffer of the data to be decrypted (incoming from remote).
Also flushes the SSL buffers by attempting to read any data through the SSL context.
Definition at line 593 of file TCPLinkImpl.cpp.
void cTCPLinkImpl::cLinkTlsContext::TryFinishHandshaking | ( | void | ) |
Tries to finish handshaking the SSL.
Definition at line 639 of file TCPLinkImpl.cpp.
|
private |
Buffer for storing the outgoing cleartext data until the link has finished handshaking.
Definition at line 104 of file TCPLinkImpl.h.
|
private |
Buffer for storing the incoming encrypted data until it is requested by the SSL decryptor.
Definition at line 101 of file TCPLinkImpl.h.
|
private |
Definition at line 98 of file TCPLinkImpl.h.
|
private |
Shared ownership of self, so that this object can keep itself alive for as long as it needs.
Definition at line 107 of file TCPLinkImpl.h.