Cuberite
A lightweight, fast and extensible game server for Minecraft
BufferedSslContext.h
Go to the documentation of this file.
1 
2 // BufferedSslContext.h
3 
4 // Declares the cBufferedSslContext class representing a SSL context with the SSL peer data backed by a cByteBuffer
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "SslContext.h"
13 #include "ErrorCodes.h"
14 
15 
16 
17 
18 
20  public cSslContext
21 {
22  typedef cSslContext super;
23 
24 public:
26  cBufferedSslContext(size_t a_BufferSize = 64000);
27 
31  size_t WriteIncoming(const void * a_Data, size_t a_NumBytes);
32 
36  size_t ReadOutgoing(void * a_Data, size_t a_DataMaxSize);
37 
38 protected:
41 
44 
45 
46  // cSslContext overrides:
47  virtual int ReceiveEncrypted(unsigned char * a_Buffer, size_t a_NumBytes) override;
48  virtual int SendEncrypted(const unsigned char * a_Buffer, size_t a_NumBytes) override;
49 } ;
50 
51 
52 
53 
size_t WriteIncoming(const void *a_Data, size_t a_NumBytes)
Stores the specified data in the "incoming" buffer, to be process by the SSL decryptor.
cBufferedSslContext(size_t a_BufferSize=64000)
Creates a new context with the buffers of specified size for the encrypted / decrypted data...
virtual int ReceiveEncrypted(unsigned char *a_Buffer, size_t a_NumBytes) override
size_t ReadOutgoing(void *a_Data, size_t a_DataMaxSize)
Retrieves data from the "outgoing" buffer, after being processed by the SSL encryptor.
cByteBuffer m_IncomingData
Buffer for the data that has come in and needs to be decrypted from the SSL stream.
An object that can store incoming bytes and lets its clients read the bytes sequentially The bytes ar...
Definition: ByteBuffer.h:29
virtual int SendEncrypted(const unsigned char *a_Buffer, size_t a_NumBytes) override
cByteBuffer m_OutgoingData
Buffer for the data that has been encrypted into the SSL stream and should be sent out...