aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_ciphersuite.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2013-04-10 22:20:07 +0000
committerlloyd <[email protected]>2013-04-10 22:20:07 +0000
commit3f9d452f604956e92a78f13e068530235519f84e (patch)
treed7a5142a38001127f76ba271e243ad392657b80a /src/tls/tls_ciphersuite.cpp
parentbf8e0fc381df4f4c89b5d7bf8f4f6f6038ad287d (diff)
Make the IV length and MAC keylength explicit in the ciphersuite
Add support for alternate PRFs
Diffstat (limited to 'src/tls/tls_ciphersuite.cpp')
-rw-r--r--src/tls/tls_ciphersuite.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/tls/tls_ciphersuite.cpp b/src/tls/tls_ciphersuite.cpp
index 3a1a9fefd..1cc8a8f2f 100644
--- a/src/tls/tls_ciphersuite.cpp
+++ b/src/tls/tls_ciphersuite.cpp
@@ -104,22 +104,23 @@ std::string Ciphersuite::to_string() const
{
if(cipher_algo() == "3DES")
out << "3DES_EDE";
- else if(cipher_algo() == "Camellia-128" || cipher_algo() == "Camellia-256")
+ else if(cipher_algo().find("Camellia") == 0)
out << "CAMELLIA_" << std::to_string(8*cipher_keylen());
else
- out << replace_char(cipher_algo(), '-', '_');
+ out << replace_chars(cipher_algo(), {'-', '/'}, '_');
- out << "_CBC_";
+ if(cipher_algo().find("/GCM") != std::string::npos)
+ out << "_";
+ else
+ out << "_CBC_";
}
if(mac_algo() == "SHA-1")
out << "SHA";
- else if(mac_algo() == "SHA-256")
- out << "SHA256";
- else if(mac_algo() == "SHA-384")
- out << "SHA384";
+ else if(mac_algo() == "AEAD")
+ out << erase_chars(prf_algo(), {'-'});
else
- out << mac_algo();
+ out << erase_chars(mac_algo(), {'-'});
return out.str();
}