diff options
author | lloyd <[email protected]> | 2012-01-25 01:48:17 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-01-25 01:48:17 +0000 |
commit | 47ff984c0ae0f077b029d0921e7ce1b62fc8f72f (patch) | |
tree | 69e51d3c5f49b37fe239919c4262e48c30c47c30 | |
parent | a4702350f9a5f85b368a4293c4369c2727c65ddb (diff) |
Fix printing PSK ciphersuites. Better assert msg.
-rw-r--r-- | src/tls/tls_ciphersuite.cpp | 28 | ||||
-rw-r--r-- | src/tls/tls_server.cpp | 3 |
2 files changed, 17 insertions, 14 deletions
diff --git a/src/tls/tls_ciphersuite.cpp b/src/tls/tls_ciphersuite.cpp index 8653b0841..a46be8404 100644 --- a/src/tls/tls_ciphersuite.cpp +++ b/src/tls/tls_ciphersuite.cpp @@ -185,24 +185,26 @@ std::string Ciphersuite::to_string() const out << "TLS_"; - if(kex_algo() == "DH") - out << "DHE"; - else if(kex_algo() == "ECDH") - out << "ECDHE"; - else if(kex_algo() == "SRP") - out << "SRP_SHA"; - else if(kex_algo() != "") - out << kex_algo(); - if(kex_algo() != "") + { + if(kex_algo() == "DH") + out << "DHE"; + else if(kex_algo() == "ECDH") + out << "ECDHE"; + else if(kex_algo() == "SRP") + out << "SRP_SHA"; + else + out << kex_algo(); + out << '_'; + } if(sig_algo() == "DSA") - out << "DSS"; - else - out << sig_algo(); + out << "DSS_"; + else if(sig_algo() != "") + out << sig_algo() << '_'; - out << "_WITH_"; + out << "WITH_"; if(cipher_algo() == "ARC4") { diff --git a/src/tls/tls_server.cpp b/src/tls/tls_server.cpp index b4a5ee5bc..1b2e9b91e 100644 --- a/src/tls/tls_server.cpp +++ b/src/tls/tls_server.cpp @@ -263,7 +263,8 @@ void Server::process_handshake_msg(Handshake_Type type, if(sig_algo != "") { - BOTAN_ASSERT(!cert_chains[sig_algo].empty(), "Chose the wrong cert type"); + BOTAN_ASSERT(!cert_chains[sig_algo].empty(), + "Attempting to send empty certificate chain"); state->server_certs = new Certificate(writer, state->hash, |