aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pk_pad/emsa.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/pk_pad/emsa.cpp')
-rw-r--r--src/lib/pk_pad/emsa.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/lib/pk_pad/emsa.cpp b/src/lib/pk_pad/emsa.cpp
index 3b8641357..4d4b96ad1 100644
--- a/src/lib/pk_pad/emsa.cpp
+++ b/src/lib/pk_pad/emsa.cpp
@@ -11,10 +11,6 @@
#include <botan/emsa1.h>
#endif
-#if defined(BOTAN_HAS_EMSA1_BSI)
- #include <botan/emsa1_bsi.h>
-#endif
-
#if defined(BOTAN_HAS_EMSA_X931)
#include <botan/emsa_x931.h>
#endif
@@ -45,6 +41,19 @@ EMSA* get_emsa(const std::string& algo_spec)
throw Algorithm_Not_Found(algo_spec);
}
+std::string hash_for_emsa(const std::string& algo_spec)
+ {
+ SCAN_Name emsa_name(algo_spec);
+
+ if(emsa_name.arg_count() > 0)
+ {
+ const std::string pos_hash = emsa_name.arg(0);
+ return pos_hash;
+ }
+
+ return "SHA-512"; // safe default if nothing we understand
+ }
+
#define BOTAN_REGISTER_EMSA_NAMED_NOARGS(type, name) \
BOTAN_REGISTER_NAMED_T(EMSA, name, type, make_new_T<type>)
@@ -58,10 +67,6 @@ EMSA* get_emsa(const std::string& algo_spec)
BOTAN_REGISTER_EMSA_1HASH(EMSA1, "EMSA1");
#endif
-#if defined(BOTAN_HAS_EMSA1_BSI)
-BOTAN_REGISTER_EMSA_1HASH(EMSA1_BSI, "EMSA1_BSI");
-#endif
-
#if defined(BOTAN_HAS_EMSA_PKCS1)
BOTAN_REGISTER_NAMED_T(EMSA, "EMSA_PKCS1", EMSA_PCS1v15, EMSA_PKCS1v15::make);
#endif