aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/rec_wri.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-12-30 20:20:42 +0000
committerlloyd <[email protected]>2011-12-30 20:20:42 +0000
commitdeb92d7f6d43206c04f332625d6b1e1a2abc444d (patch)
tree06c331d7f51071750091e013c6f853c015eacd18 /src/tls/rec_wri.cpp
parent766f5eeb5c99936e7ddcf3e4c82095f087b6e928 (diff)
Add a function for getting the version number of an active connection.
Add a new callback that is called with the session info when a handshake completes. Currently only called on the server side as the client doesn't have session resumption yet. Rename CipherSuite to TLS_Cipher_Suite.
Diffstat (limited to 'src/tls/rec_wri.cpp')
-rw-r--r--src/tls/rec_wri.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/tls/rec_wri.cpp b/src/tls/rec_wri.cpp
index a9a5b4549..9af48b4ee 100644
--- a/src/tls/rec_wri.cpp
+++ b/src/tls/rec_wri.cpp
@@ -14,8 +14,6 @@
#include <botan/loadstor.h>
#include <botan/libstate.h>
-#include <stdio.h>
-
namespace Botan {
/*
@@ -34,8 +32,6 @@ void Record_Writer::set_maximum_fragment_size(size_t max_fragment)
m_max_fragment = MAX_PLAINTEXT_SIZE;
else
m_max_fragment = clamp(max_fragment, 128, MAX_PLAINTEXT_SIZE);
-
- printf("Setting max fragment size to %d\n", m_max_fragment);
}
/*
@@ -70,9 +66,18 @@ void Record_Writer::set_version(Version_Code version)
}
/*
+* Get the version in use
+*/
+Version_Code Record_Writer::get_version() const
+ {
+ return static_cast<Version_Code>(
+ (static_cast<u16bit>(m_major) << 8) | m_minor);
+ }
+
+/*
* Set the keys for writing
*/
-void Record_Writer::set_keys(const CipherSuite& suite,
+void Record_Writer::activate(const TLS_Cipher_Suite& suite,
const SessionKeys& keys,
Connection_Side side)
{