diff options
author | lloyd <[email protected]> | 2012-07-05 15:09:33 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-07-05 15:09:33 +0000 |
commit | 2f94d5c85d3eb05a3d2f83e7783fb8d1bc2d5536 (patch) | |
tree | 03c2dfe5bc79f9c753a7b24086e811c641e0f6b3 /src/tls/tls_record.h | |
parent | efa00d7ffddc9a41b1fe74ed863bc7debfc44359 (diff) |
Record_Writer needs a PRNG for the IV generation. Share the reference
with the channel object instead of calling the global object.
Diffstat (limited to 'src/tls/tls_record.h')
-rw-r--r-- | src/tls/tls_record.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/tls/tls_record.h b/src/tls/tls_record.h index 9b1f7e0f7..0b67f9a63 100644 --- a/src/tls/tls_record.h +++ b/src/tls/tls_record.h @@ -50,13 +50,15 @@ class BOTAN_DLL Record_Writer void set_maximum_fragment_size(size_t max_fragment); - Record_Writer(std::function<void (const byte[], size_t)> output_fn); + Record_Writer(std::function<void (const byte[], size_t)> output_fn, + RandomNumberGenerator& rng); + + Record_Writer(const Record_Writer&) = delete; + + Record_Writer& operator=(const Record_Writer&) = delete; ~Record_Writer() { delete m_mac; } private: - Record_Writer(const Record_Writer&) {} - Record_Writer& operator=(const Record_Writer&) { return (*this); } - void send_record(byte type, const byte input[], size_t length); std::function<void (const byte[], size_t)> m_output_fn; @@ -65,6 +67,7 @@ class BOTAN_DLL Record_Writer Pipe m_cipher; MessageAuthenticationCode* m_mac; + RandomNumberGenerator& m_rng; size_t m_block_size, m_mac_size, m_iv_size, m_max_fragment; @@ -109,11 +112,11 @@ class BOTAN_DLL Record_Reader Record_Reader(); + Record_Reader(const Record_Reader&) = delete; + Record_Reader& operator=(const Record_Reader&) = delete; + ~Record_Reader() { delete m_mac; } private: - Record_Reader(const Record_Reader&) {} - Record_Reader& operator=(const Record_Reader&) { return (*this); } - size_t fill_buffer_to(const byte*& input, size_t& input_size, size_t& input_consumed, |