diff options
author | lloyd <[email protected]> | 2013-09-05 20:24:29 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-09-05 20:24:29 +0000 |
commit | c98fde26c96c764dbe821b7f76b7b3b93ac772bf (patch) | |
tree | c9ae8862376dd05210ec1968818bfc1245d94203 /src | |
parent | c1c2171a8b0dee82e5bb54d489d4cab601799cf9 (diff) |
Correct Ciphersuite::valid and to_string for CCM
Diffstat (limited to 'src')
-rw-r--r-- | src/tls/tls_ciphersuite.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tls/tls_ciphersuite.cpp b/src/tls/tls_ciphersuite.cpp index 841ce72e8..b662512fd 100644 --- a/src/tls/tls_ciphersuite.cpp +++ b/src/tls/tls_ciphersuite.cpp @@ -108,7 +108,7 @@ bool Ciphersuite::valid() const const auto mode = cipher_and_mode[1]; #if !defined(BOTAN_HAS_AEAD_CCM) - if(mode == "CCM") + if(mode == "CCM(16,3)" || mode == "CCM(8,3)") return false; #endif @@ -211,6 +211,16 @@ std::string Ciphersuite::to_string() const out << "3DES_EDE"; else if(cipher_algo().find("Camellia") == 0) out << "CAMELLIA_" << std::to_string(8*cipher_keylen()); + else if(cipher_algo().find("/CCM(") != std::string::npos) + { + const std::string base_algo = cipher_algo().substr(0, cipher_algo().find("/CCM(")); + out << replace_chars(base_algo, {'-', '/'}, '_'); + + if(cipher_algo().find("/CCM(8,3)") != std::string::npos) + out << "_CCM_8"; + else + out << "_CCM"; + } else out << replace_chars(cipher_algo(), {'-', '/'}, '_'); |