diff options
author | lloyd <[email protected]> | 2015-01-07 13:05:20 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-01-07 13:05:20 +0000 |
commit | bb1228d8a9e6f823f4875a1f6bafa9726ef506ae (patch) | |
tree | dee0b5414eb8eb7d29b85768cf22c54b78e34a31 /src/lib/tls/tls_reader.h | |
parent | 5fd3c7adffa9fe705e493f81def04d9d57db4442 (diff) |
Support setting the number of pad bytes in a heartbeat message. Use
random instead of all-zero padding. Check on sanity of received pads
to the extent possible. Bugzilla 269.
Diffstat (limited to 'src/lib/tls/tls_reader.h')
-rw-r--r-- | src/lib/tls/tls_reader.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/tls/tls_reader.h b/src/lib/tls/tls_reader.h index 028893cc1..f80e494f4 100644 --- a/src/lib/tls/tls_reader.h +++ b/src/lib/tls/tls_reader.h @@ -34,14 +34,13 @@ class TLS_Data_Reader throw decode_error("Extra bytes at end of message"); } - size_t remaining_bytes() const - { - return m_buf.size() - m_offset; - } + size_t remaining_bytes() const { return m_buf.size() - m_offset; } + + bool has_remaining() const { return (remaining_bytes() > 0); } - bool has_remaining() const + std::vector<byte> get_remaining() { - return (remaining_bytes() > 0); + return std::vector<byte>(m_buf.begin() + m_offset, m_buf.end()); } void discard_next(size_t bytes) |