diff options
author | lloyd <[email protected]> | 2012-01-05 21:01:34 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-01-05 21:01:34 +0000 |
commit | 74226be019b1a66f8eae9a6516f2eb28a53fb9e2 (patch) | |
tree | 60cb288f4d6b1a5f284d993b0de2bfedf4476420 /src/tls/rec_wri.cpp | |
parent | 66665fe98ddfe08a1c12fedb43eabe83532349a2 (diff) |
If the maximum fragment extension was negotiated, enforce it. Also
enforce the 2^14 byte plaintext limit in the reader (previously only
the 2^14+2048 byte ciphertext size limit was enforced).
Diffstat (limited to 'src/tls/rec_wri.cpp')
-rw-r--r-- | src/tls/rec_wri.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tls/rec_wri.cpp b/src/tls/rec_wri.cpp index d9f86492d..4ccec58d9 100644 --- a/src/tls/rec_wri.cpp +++ b/src/tls/rec_wri.cpp @@ -20,10 +20,11 @@ namespace Botan { * Record_Writer Constructor */ Record_Writer::Record_Writer(std::tr1::function<void (const byte[], size_t)> out) : - m_output_fn(out), m_max_fragment(MAX_PLAINTEXT_SIZE) + m_output_fn(out) { m_mac = 0; reset(); + set_maximum_fragment_size(0); } void Record_Writer::set_maximum_fragment_size(size_t max_fragment) @@ -39,6 +40,7 @@ void Record_Writer::set_maximum_fragment_size(size_t max_fragment) */ void Record_Writer::reset() { + set_maximum_fragment_size(0); m_cipher.reset(); delete m_mac; |