aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/base/scan_name.cpp
diff options
context:
space:
mode:
authorwinter <winter>2020-10-21 13:18:55 +0800
committerwinter <winter>2020-10-21 13:19:56 +0800
commit209d5016d3a705a3c8d733264ac9a994abd9f83c (patch)
tree410aca577ce1782a76352b90f81649de434ab76c /src/lib/base/scan_name.cpp
parent09c7fa693e896978a68a1563190cbe2071029f1e (diff)
fix parsing nested cipher name
Diffstat (limited to 'src/lib/base/scan_name.cpp')
-rw-r--r--src/lib/base/scan_name.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/base/scan_name.cpp b/src/lib/base/scan_name.cpp
index 954db7c45..f79866ba6 100644
--- a/src/lib/base/scan_name.cpp
+++ b/src/lib/base/scan_name.cpp
@@ -32,8 +32,11 @@ std::string make_arg(const std::vector<std::pair<size_t, std::string>>& name, si
}
else if(name[i].first < level)
{
- output += ")," + name[i].second;
- --paren_depth;
+ for (size_t j = name[i].first; j < level; j++) {
+ output += ")";
+ --paren_depth;
+ }
+ output += "," + name[i].second;
}
else
{
@@ -58,7 +61,7 @@ SCAN_Name::SCAN_Name(const char* algo_spec) : SCAN_Name(std::string(algo_spec))
}
SCAN_Name::SCAN_Name(std::string algo_spec) : m_orig_algo_spec(algo_spec), m_alg_name(), m_args(), m_mode_info()
- {
+ {
if(algo_spec.size() == 0)
throw Invalid_Argument("Expected algorithm name, got empty string");