proxygen
|
#include <EncryptedRecordLayer.h>
Public Member Functions | |
~EncryptedReadRecordLayer () override=default | |
EncryptedReadRecordLayer (EncryptionLevel encryptionLevel) | |
folly::Optional< TLSMessage > | read (folly::IOBufQueue &buf) override |
virtual void | setAead (folly::ByteRange, std::unique_ptr< Aead > aead) |
virtual void | setSkipFailedDecryption (bool enabled) |
void | setProtocolVersion (ProtocolVersion version) |
EncryptionLevel | getEncryptionLevel () const override |
Public Member Functions inherited from fizz::ReadRecordLayer | |
virtual | ~ReadRecordLayer ()=default |
virtual folly::Optional< Param > | readEvent (folly::IOBufQueue &socketBuf) |
virtual bool | hasUnparsedHandshakeData () const |
Private Member Functions | |
folly::Optional< Buf > | getDecryptedBuf (folly::IOBufQueue &buf) |
Private Attributes | |
EncryptionLevel | encryptionLevel_ |
std::unique_ptr< Aead > | aead_ |
bool | skipFailedDecryption_ {false} |
bool | useAdditionalData_ {true} |
uint64_t | seqNum_ {0} |
Additional Inherited Members | |
Static Public Member Functions inherited from fizz::ReadRecordLayer | |
static folly::Optional< Param > | decodeHandshakeMessage (folly::IOBufQueue &buf) |
Definition at line 20 of file EncryptedRecordLayer.h.
|
overridedefault |
|
explicit |
Definition at line 21 of file EncryptedRecordLayer.cpp.
|
private |
Definition at line 25 of file EncryptedRecordLayer.cpp.
References aead_, fizz::alert, folly::IOBufQueue::chainLength(), fizz::change_cipher_spec, folly::IOBuf::coalesce(), folly::IOBuf::data(), folly::IOBufQueue::empty(), folly::IOBufQueue::front(), fizz::illegal_parameter, folly::IOBuf::length(), max, folly::gen::move, folly::none, folly::io::detail::CursorBase< Derived, BufType >::pull(), folly::range(), seqNum_, skipFailedDecryption_, fizz::toString(), folly::IOBufQueue::trimStart(), uint16_t, useAdditionalData_, and folly::IOBuf::wrapBufferAsValue().
Referenced by read(), and setProtocolVersion().
|
overridevirtual |
Returns the current encryption level of the data that the read record layer can process.
Implements fizz::ReadRecordLayer.
Definition at line 139 of file EncryptedRecordLayer.cpp.
References encryptionLevel_.
Referenced by fizz::EncryptedWriteRecordLayer::setMinDesiredRecord(), and setProtocolVersion().
|
overridevirtual |
Reads a fragment from the record layer. Returns an empty optional if insuficient data available. Throws if data malformed. On success, advances buf the amount read.
Implements fizz::ReadRecordLayer.
Definition at line 98 of file EncryptedRecordLayer.cpp.
References folly::io::detail::CursorBase< Derived, BufType >::advanceToEnd(), fizz::alert, folly::IOBufQueue::append(), fizz::application_data, folly::IOBuf::create(), data, fizz::TLSMessage::fragment, folly::IOBufQueue::front(), getDecryptedBuf(), fizz::handshake, folly::IOBufQueue::move(), folly::gen::move, folly::none, folly::IOBufQueue::trimEnd(), and fizz::TLSMessage::type.
|
inlinevirtual |
Reimplemented in fizz::MockEncryptedReadRecordLayer.
Definition at line 28 of file EncryptedRecordLayer.h.
References aead_, folly::gen::move, and seqNum_.
|
inline |
Definition at line 41 of file EncryptedRecordLayer.h.
References getDecryptedBuf(), getEncryptionLevel(), fizz::getRealDraftVersion(), fizz::tls_1_3_20, fizz::tls_1_3_21, fizz::tls_1_3_22, fizz::tls_1_3_23, and useAdditionalData_.
|
inlinevirtual |
Definition at line 37 of file EncryptedRecordLayer.h.
References skipFailedDecryption_.
|
private |
Definition at line 59 of file EncryptedRecordLayer.h.
Referenced by getDecryptedBuf(), setAead(), and fizz::EncryptedWriteRecordLayer::setAead().
|
private |
Definition at line 58 of file EncryptedRecordLayer.h.
Referenced by getEncryptionLevel().
|
mutableprivate |
Definition at line 64 of file EncryptedRecordLayer.h.
Referenced by getDecryptedBuf(), setAead(), and fizz::EncryptedWriteRecordLayer::setAead().
|
private |
Definition at line 60 of file EncryptedRecordLayer.h.
Referenced by getDecryptedBuf(), and setSkipFailedDecryption().
|
private |
Definition at line 62 of file EncryptedRecordLayer.h.
Referenced by getDecryptedBuf(), and setProtocolVersion().