aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/tls_client.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-02-04 04:03:38 +0000
committerlloyd <[email protected]>2015-02-04 04:03:38 +0000
commit0dd060fed07b0060f94e3bae62e125a85c1bb877 (patch)
treeed4bc7a961e2b30f17ed5e80769c84b0c313c8b7 /src/lib/tls/tls_client.cpp
parentf9a7c85b74be0f4a7273e8e0591703af83036e81 (diff)
Remove algo factory, engines, global RNG, global state, etc.
Convert all uses of Algorithm_Factory and the engines to using Algo_Registry The shared pool of entropy sources remains but is moved to EntropySource. With that and few remaining initializations (default OIDs and aliases) moved elsewhere, the global state is empty and init and shutdown are no-ops. Remove almost all of the headers and code for handling the global state, except LibraryInitializer which remains as a compatability stub. Update seeding for blinding so only one hacky almost-global RNG instance needs to be setup instead of across all pubkey uses (it uses either the system RNG or an AutoSeeded_RNG if the system RNG is not available).
Diffstat (limited to 'src/lib/tls/tls_client.cpp')
-rw-r--r--src/lib/tls/tls_client.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/tls/tls_client.cpp b/src/lib/tls/tls_client.cpp
index 75df6332a..bdc64283c 100644
--- a/src/lib/tls/tls_client.cpp
+++ b/src/lib/tls/tls_client.cpp
@@ -10,6 +10,7 @@
#include <botan/internal/tls_messages.h>
#include <botan/internal/stl_util.h>
#include <iterator>
+#include <sstream>
namespace Botan {
@@ -227,11 +228,15 @@ void Client::process_handshake_msg(const Handshake_State* active_state,
client_extn.begin(), server_extn.end(),
std::back_inserter(diff));
- for(auto i : diff)
+ if(!diff.empty())
{
- throw TLS_Exception(Alert::HANDSHAKE_FAILURE,
- "Server sent extension " + std::to_string(i) +
- " but we did not request it");
+ // Server sent us back an extension we did not send!
+
+ std::ostringstream msg;
+ msg << "Server replied with " << diff.size() << " unsupported extensions:";
+ for(auto&& d : diff)
+ msg << " " << static_cast<int>(d);
+ throw TLS_Exception(Alert::HANDSHAKE_FAILURE, msg.str());
}
if(u16bit srtp = state.server_hello()->srtp_profile())