diff options
author | René Meusel <[email protected]> | 2021-10-28 10:56:03 +0530 |
---|---|---|
committer | René Meusel <[email protected]> | 2021-10-28 12:10:44 +0530 |
commit | fc980c60d6aa0cf8c853b8c449c241d6deec9274 (patch) | |
tree | c4952c0e7543d1b451f7961ff683c53715717c0b /src/cli/tls_utils.cpp | |
parent | 60103d4cef08c921a6ffbdf32081df8aad759695 (diff) |
Ciphersuite::by_id() ::from_name() return a std::optional
Diffstat (limited to 'src/cli/tls_utils.cpp')
-rw-r--r-- | src/cli/tls_utils.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cli/tls_utils.cpp b/src/cli/tls_utils.cpp index a36f2c2df..956815974 100644 --- a/src/cli/tls_utils.cpp +++ b/src/cli/tls_utils.cpp @@ -66,8 +66,8 @@ class TLS_Ciphersuites final : public Command for(uint16_t suite_id : policy->ciphersuite_list(version)) { - const Botan::TLS::Ciphersuite suite(Botan::TLS::Ciphersuite::by_id(suite_id)); - output() << suite.to_string() << "\n"; + const auto s = Botan::TLS::Ciphersuite::by_id(suite_id); + output() << ((s) ? s->to_string() : "unknown cipher suite") << "\n"; } } }; @@ -161,9 +161,9 @@ class TLS_Client_Hello_Reader final : public Command oss << "SessionID: " << Botan::hex_encode(hello.session_id()) << "\n"; for(uint16_t csuite_id : hello.ciphersuites()) { - auto csuite = Botan::TLS::Ciphersuite::by_id(csuite_id); - if(csuite.valid()) - oss << "Cipher: " << csuite.to_string() << "\n"; + const auto csuite = Botan::TLS::Ciphersuite::by_id(csuite_id); + if(csuite && csuite->valid()) + oss << "Cipher: " << csuite->to_string() << "\n"; else if(csuite_id == 0x00FF) oss << "Cipher: EMPTY_RENEGOTIATION_INFO_SCSV\n"; else |