diff options
author | lloyd <[email protected]> | 2012-03-23 13:37:34 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-03-23 13:37:34 +0000 |
commit | bd92af1b7fff3943703f2422836db84ba71f4e44 (patch) | |
tree | 2f3c7116e66e6dc2b7e486e2a571f872c6922366 /src/credentials/credentials_manager.cpp | |
parent | afcd29c599e1e27b674df4f630a665c095b0ff44 (diff) |
Add a special hook in credentials manager for the session ticket key,
with a default implementation that creates a new random key on the
first call.
Diffstat (limited to 'src/credentials/credentials_manager.cpp')
-rw-r--r-- | src/credentials/credentials_manager.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/credentials/credentials_manager.cpp b/src/credentials/credentials_manager.cpp index ef5d44819..a70d8d660 100644 --- a/src/credentials/credentials_manager.cpp +++ b/src/credentials/credentials_manager.cpp @@ -7,6 +7,7 @@ #include <botan/credentials_manager.h> #include <botan/x509stor.h> +#include <botan/libstate.h> namespace Botan { @@ -30,6 +31,13 @@ SymmetricKey Credentials_Manager::psk(const std::string&, throw Internal_Error("No PSK set for identity " + identity); } +const SymmetricKey& Credentials_Manager::session_ticket_key() + { + if(m_session_ticket_key.length() == 0) + m_session_ticket_key = SymmetricKey(global_state().global_rng(), 32); + return m_session_ticket_key; + } + std::string Credentials_Manager::srp_identifier(const std::string&, const std::string&) { |