aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/tls_utils.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-22 12:39:45 -0400
committerJack Lloyd <[email protected]>2017-10-24 11:51:28 -0400
commit3feae2f7893090b263e762c79b47b99f7f4d07ba (patch)
tree09f0bac281886ff0003d8d07ee90c7aa2e729985 /src/cli/tls_utils.cpp
parentda0a1124242e3a108819df58054e8dd909268a00 (diff)
Refactor option parsing in cli and test code
Allows cleaning up header includes, also somewhat smaller binaries.
Diffstat (limited to 'src/cli/tls_utils.cpp')
-rw-r--r--src/cli/tls_utils.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/cli/tls_utils.cpp b/src/cli/tls_utils.cpp
index f62781af9..7b2474a69 100644
--- a/src/cli/tls_utils.cpp
+++ b/src/cli/tls_utils.cpp
@@ -114,13 +114,8 @@ class TLS_Ciphersuites final : public Command
}
else
{
- std::ifstream policy_file(policy_type);
- if(!policy_file.good())
- {
- throw CLI_Error("Error TLS policy '" + policy_type + "' is neither a file nor a known policy type");
- }
-
- policy.reset(new Botan::TLS::Text_Policy(policy_file));
+ const std::string policy_txt = slurp_file_as_str(policy_type);
+ policy.reset(new Botan::TLS::Text_Policy(policy_txt));
}
for(uint16_t suite_id : policy->ciphersuite_list(version, with_srp))