aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/hello_verify.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-05-18 20:32:36 +0000
committerlloyd <[email protected]>2012-05-18 20:32:36 +0000
commitc691561f3198f481c13457433efbccc1c9fcd898 (patch)
treea45ea2c5a30e0cb009fbcb68a61ef39332ff790c /src/tls/hello_verify.cpp
parentd76700f01c7ecac5633edf75f8d7408b46c5dbac (diff)
Fairly huge update that replaces the old secmem types with std::vector
using a custom allocator. Currently our allocator just does new/delete with a memset before deletion, and the mmap and mlock allocators have been removed.
Diffstat (limited to 'src/tls/hello_verify.cpp')
-rw-r--r--src/tls/hello_verify.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tls/hello_verify.cpp b/src/tls/hello_verify.cpp
index e844d7f72..c77076e4c 100644
--- a/src/tls/hello_verify.cpp
+++ b/src/tls/hello_verify.cpp
@@ -13,7 +13,7 @@ namespace Botan {
namespace TLS {
-Hello_Verify_Request::Hello_Verify_Request(const MemoryRegion<byte>& buf)
+Hello_Verify_Request::Hello_Verify_Request(const std::vector<byte>& buf)
{
if(buf.size() < 3)
throw Decoding_Error("Hello verify request too small");
@@ -25,7 +25,7 @@ Hello_Verify_Request::Hello_Verify_Request(const MemoryRegion<byte>& buf)
copy_mem(&m_cookie[0], &buf[2], buf.size() - 2);
}
-Hello_Verify_Request::Hello_Verify_Request(const MemoryVector<byte>& client_hello_bits,
+Hello_Verify_Request::Hello_Verify_Request(const std::vector<byte>& client_hello_bits,
const std::string& client_identity,
const SymmetricKey& secret_key)
{
@@ -37,10 +37,10 @@ Hello_Verify_Request::Hello_Verify_Request(const MemoryVector<byte>& client_hell
hmac->update_be(client_identity.size());
hmac->update(client_identity);
- m_cookie = hmac->final();
+ m_cookie = unlock(hmac->final());
}
-MemoryVector<byte> Hello_Verify_Request::serialize() const
+std::vector<byte> Hello_Verify_Request::serialize() const
{
/* DTLS 1.2 server implementations SHOULD use DTLS version 1.0
regardless of the version of TLS that is expected to be
@@ -49,7 +49,7 @@ MemoryVector<byte> Hello_Verify_Request::serialize() const
Protocol_Version format_version(Protocol_Version::TLS_V11);
- MemoryVector<byte> bits;
+ std::vector<byte> bits;
bits.push_back(format_version.major_version());
bits.push_back(format_version.minor_version());
bits += m_cookie;