aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/pk_algs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/pubkey/pk_algs.cpp')
-rw-r--r--src/lib/pubkey/pk_algs.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/pubkey/pk_algs.cpp b/src/lib/pubkey/pk_algs.cpp
index e821e7846..e2009ce0e 100644
--- a/src/lib/pubkey/pk_algs.cpp
+++ b/src/lib/pubkey/pk_algs.cpp
@@ -84,10 +84,13 @@ std::unique_ptr<Public_Key>
load_public_key(const AlgorithmIdentifier& alg_id,
const std::vector<uint8_t>& key_bits)
{
- const std::string alg_name = OIDS::lookup(alg_id.oid);
- if(alg_name == "")
+ const std::vector<std::string> alg_info = split_on(OIDS::lookup(alg_id.oid), '/');
+
+ if(alg_info.empty())
throw Decoding_Error("Unknown algorithm OID: " + alg_id.oid.as_string());
+ const std::string alg_name = alg_info[0];
+
#if defined(BOTAN_HAS_RSA)
if(alg_name == "RSA")
return std::unique_ptr<Public_Key>(new RSA_PublicKey(alg_id, key_bits));