aboutsummaryrefslogtreecommitdiffstats
path: root/src/pbe/get_pbe.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-11 03:49:23 +0000
committerlloyd <[email protected]>2008-11-11 03:49:23 +0000
commit54f82a91844808eb1612080427fb64d44c486aad (patch)
tree82de46d4ae586f389120a5257576e8354b1e2d3a /src/pbe/get_pbe.cpp
parent6d2db29350761e5573c6f7fafefb2b937993fb80 (diff)
Make SCAN_Name::arg return a new SCAN_Name that has the same providers list,
this allows provider preferences to be passed down to sub-algorithms.
Diffstat (limited to 'src/pbe/get_pbe.cpp')
-rw-r--r--src/pbe/get_pbe.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pbe/get_pbe.cpp b/src/pbe/get_pbe.cpp
index 7e76b7943..985f61cf8 100644
--- a/src/pbe/get_pbe.cpp
+++ b/src/pbe/get_pbe.cpp
@@ -27,8 +27,8 @@ PBE* get_pbe(const std::string& algo_spec)
SCAN_Name request(algo_spec);
const std::string pbe = request.algo_name();
- const std::string digest = request.arg(0);
- const std::string cipher = request.arg(1);
+ SCAN_Name digest_name = request.arg(0);
+ const std::string cipher = request.arg_as_string(1);
std::vector<std::string> cipher_spec = split_on(cipher, '/');
if(cipher_spec.size() != 2)
@@ -46,9 +46,9 @@ PBE* get_pbe(const std::string& algo_spec)
if(!block_cipher)
throw Algorithm_Not_Found(cipher_algo);
- const HashFunction* hash_function = af.make_hash_function(digest);
+ const HashFunction* hash_function = af.make_hash_function(digest_name);
if(!hash_function)
- throw Algorithm_Not_Found(digest);
+ throw Algorithm_Not_Found(digest_name.as_string());
if(request.arg_count() != 2)
throw Invalid_Algorithm_Name(algo_spec);
@@ -84,8 +84,8 @@ PBE* get_pbe(const OID& pbe_oid, DataSource& params)
if(request.arg_count() != 2)
throw Invalid_Algorithm_Name(request.as_string());
- const std::string digest = request.arg(0);
- const std::string cipher = request.arg(1);
+ SCAN_Name digest_name = request.arg(0);
+ const std::string cipher = request.arg_as_string(1);
std::vector<std::string> cipher_spec = split_on(cipher, '/');
if(cipher_spec.size() != 2)
@@ -103,9 +103,9 @@ PBE* get_pbe(const OID& pbe_oid, DataSource& params)
if(!block_cipher)
throw Algorithm_Not_Found(cipher_algo);
- const HashFunction* hash_function = af.make_hash_function(digest);
+ const HashFunction* hash_function = af.make_hash_function(digest_name);
if(!hash_function)
- throw Algorithm_Not_Found(digest);
+ throw Algorithm_Not_Found(digest_name.as_string());
PBE* pbe = new PBE_PKCS5v15(block_cipher->clone(),
hash_function->clone(),