Reece Wilson
d68fc7fc91
[+] ByteBuffer::GetNextLinearWrite() [-] ByteBuffer::WriterTryGetWriteHeadFor [+] ITLSPrivateKeyPair [+] ITLSContext::GetFatalErrorCodeAsString() [+] Begin to add certificate chains [*] Clean up TLS
38 lines
996 B
C++
38 lines
996 B
C++
/***
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: TLSProtocolRecv.hpp
|
|
Date: 2022-8-24
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
namespace Aurora::IO::TLS
|
|
{
|
|
struct TLSContext;
|
|
|
|
struct TLSProtocolRecv : Protocol::IProtocolInterceptorEx
|
|
{
|
|
TLSProtocolRecv(TLSContext *pParent);
|
|
|
|
virtual bool OnDataAvailable(const AuSPtr<Memory::ByteBuffer> &pReadInByteBuffer,
|
|
const AuSPtr<Memory::ByteBuffer> &pWriteOutByteBuffer) override;
|
|
|
|
bool TryHandshake();
|
|
|
|
bool DoHandshake(bool &bComplete);
|
|
bool DoOneTick(const AuSPtr<Memory::ByteBuffer> &pWriteOutByteBuffer);
|
|
|
|
bool bHasRead {};
|
|
AuUInt32 uBytesRead {};
|
|
AuUInt32 uBytesReadAvail {};
|
|
AuWPtr<Memory::ByteBuffer> pReadInByteBuffer;
|
|
|
|
bool &HasCompletedHandshake();
|
|
|
|
private:
|
|
TLSContext *pParent_;
|
|
bool bHasCompletedHandshake_ {};
|
|
bool bHasFailedOnce {};
|
|
};
|
|
} |