diff options
author | Matthias Gierlings <[email protected]> | 2016-04-29 20:44:30 +0200 |
---|---|---|
committer | Matthias Gierlings <[email protected]> | 2016-06-19 18:25:46 +0200 |
commit | d4f3e7c4ac584daa9d7e1ae10cb3412e450e25cf (patch) | |
tree | 5541bf045d77110a55f1858e385f54d7b761851b /src/lib/tls/tls_server_handshake_state.h | |
parent | 23d6f67e76b633077b5de91945f61290ff091e1e (diff) |
Reduction of code complexity in TLS classes.
-reduced number of parameters in various methods
-reduced cyclomatic complexity (McCabe-Metric)
-removed "TLSEXT_HEARTBEAT_SUPPORT" from tls_extensions.h (leftover
from heartbeat extension removal?)
Diffstat (limited to 'src/lib/tls/tls_server_handshake_state.h')
-rw-r--r-- | src/lib/tls/tls_server_handshake_state.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/lib/tls/tls_server_handshake_state.h b/src/lib/tls/tls_server_handshake_state.h new file mode 100644 index 000000000..281dd82df --- /dev/null +++ b/src/lib/tls/tls_server_handshake_state.h @@ -0,0 +1,47 @@ +/* +* TLS Server +* (C) 2004-2011,2012,2016 Jack Lloyd +* 2016 Matthias Gierlings +* +* Botan is released under the Simplified BSD License (see license.txt) +*/ + +#ifndef BOTAN_TLS_SERVER_HANDSHAKE_STATE_H__ +#define BOTAN_TLS_SERVER_HANDSHAKE_STATE_H__ + +#include <botan/internal/tls_handshake_state.h> +namespace Botan { + +namespace TLS { + +class Server_Handshake_State : public Handshake_State + { + public: + Server_Handshake_State(Handshake_IO* io, handshake_msg_cb cb) + : Handshake_State(io, cb) {} + + Private_Key* server_rsa_kex_key() { return m_server_rsa_kex_key; } + void set_server_rsa_kex_key(Private_Key* key) + { m_server_rsa_kex_key = key; } + + bool allow_session_resumption() const + { return m_allow_session_resumption; } + void set_allow_session_resumption(bool allow_session_resumption) + { m_allow_session_resumption = allow_session_resumption; } + + + private: + // Used by the server only, in case of RSA key exchange. Not owned + Private_Key* m_server_rsa_kex_key = nullptr; + + /* + * Used by the server to know if resumption should be allowed on + * a server-initiated renegotiation + */ + bool m_allow_session_resumption = true; + }; + +} + +} +#endif //BOTAN_TLS_SERVER_HANDSHAKE_STATE_H__ |