aboutsummaryrefslogtreecommitdiffstats
path: root/src/pbe/get_pbe.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-12 18:11:50 +0000
committerlloyd <[email protected]>2008-11-12 18:11:50 +0000
commitff1e835d888a2783e59efc30fa125bfaf7d150fe (patch)
treef69008ec6cfc733bd993a584e7298c1d48afc89d /src/pbe/get_pbe.cpp
parente99e232ac74cb2761468e2edad4881fc26033df3 (diff)
Remove support for provider identifiers from SCAN_Name - it turns out this
was not the right place to keep track of this information. Also modify all Algorithm_Factory constructor functions to take instead of a SCAN_Name a pair of std::strings - the SCAN name and an optional provider name. If a provider is specified, either that provider will be used or the request will fail. Otherwise, the library will attempt best effort, based on user-set algorithm implementation settings (combine with benchmark.h for choosing the fastest implementation at runtime) or if not set, a static ordering (preset in static_provider_weight in prov_weight.cpp, though it would be nice to make this easier to toggle).
Diffstat (limited to 'src/pbe/get_pbe.cpp')
-rw-r--r--src/pbe/get_pbe.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pbe/get_pbe.cpp b/src/pbe/get_pbe.cpp
index 985f61cf8..5fa0291c8 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();
- SCAN_Name digest_name = request.arg(0);
- const std::string cipher = request.arg_as_string(1);
+ std::string digest_name = request.arg(0);
+ const std::string cipher = request.arg(1);
std::vector<std::string> cipher_spec = split_on(cipher, '/');
if(cipher_spec.size() != 2)
@@ -48,7 +48,7 @@ PBE* get_pbe(const std::string& algo_spec)
const HashFunction* hash_function = af.make_hash_function(digest_name);
if(!hash_function)
- throw Algorithm_Not_Found(digest_name.as_string());
+ throw Algorithm_Not_Found(digest_name);
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());
- SCAN_Name digest_name = request.arg(0);
- const std::string cipher = request.arg_as_string(1);
+ std::string digest_name = request.arg(0);
+ const std::string cipher = request.arg(1);
std::vector<std::string> cipher_spec = split_on(cipher, '/');
if(cipher_spec.size() != 2)
@@ -105,7 +105,7 @@ PBE* get_pbe(const OID& pbe_oid, DataSource& params)
const HashFunction* hash_function = af.make_hash_function(digest_name);
if(!hash_function)
- throw Algorithm_Not_Found(digest_name.as_string());
+ throw Algorithm_Not_Found(digest_name);
PBE* pbe = new PBE_PKCS5v15(block_cipher->clone(),
hash_function->clone(),