aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/kdf/kdf.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-09-10 01:45:47 -0400
committerJack Lloyd <[email protected]>2015-09-10 01:45:47 -0400
commitd21de17f070863c7e0b7e8d254eb35689001a53a (patch)
tree2627df5d3c911a56dea6a56aeca693a73d66f85e /src/lib/kdf/kdf.cpp
parenta96a7b79662f5045f0810dfa5d5cb4ebbd04ae42 (diff)
Fix static lib registration for block, hash, mac, stream, kdf
The support problems from having static libraries not work in the obvious way will be endless trouble. Instead have each set of registrations tag along in a source file for the basic type, at the cost of some extra ifdefs. On shared libs this is harmless - everything is going into the shared object anyway. With static libs, this means pulling in a single block cipher pulls in the text of all the them. But that's still strictly better than the amalgamation (which is really pulling in everything), and it works (unlike status quo).
Diffstat (limited to 'src/lib/kdf/kdf.cpp')
-rw-r--r--src/lib/kdf/kdf.cpp51
1 files changed, 49 insertions, 2 deletions
diff --git a/src/lib/kdf/kdf.cpp b/src/lib/kdf/kdf.cpp
index 793cd3d62..89bb8d58a 100644
--- a/src/lib/kdf/kdf.cpp
+++ b/src/lib/kdf/kdf.cpp
@@ -6,8 +6,31 @@
*/
#include <botan/kdf.h>
-#include <botan/internal/algo_registry.h>
-#include <botan/exceptn.h>
+#include <botan/internal/kdf_utils.h>
+
+#if defined(BOTAN_HAS_HKDF)
+#include <botan/hkdf.h>
+#endif
+
+#if defined(BOTAN_HAS_KDF1)
+#include <botan/kdf1.h>
+#endif
+
+#if defined(BOTAN_HAS_KDF2)
+#include <botan/kdf2.h>
+#endif
+
+#if defined(BOTAN_HAS_TLS_V10_PRF)
+#include <botan/prf_tls.h>
+#endif
+
+#if defined(BOTAN_HAS_TLS_V12_PRF)
+#include <botan/prf_tls.h>
+#endif
+
+#if defined(BOTAN_HAS_X942_PRF)
+#include <botan/prf_x942.h>
+#endif
namespace Botan {
@@ -23,4 +46,28 @@ KDF* get_kdf(const std::string& algo_spec)
throw Algorithm_Not_Found(algo_spec);
}
+#if defined(BOTAN_HAS_HKDF)
+BOTAN_REGISTER_NAMED_T(KDF, "HKDF", HKDF, HKDF::make);
+#endif
+
+#if defined(BOTAN_HAS_KDF1)
+BOTAN_REGISTER_KDF_1HASH(KDF1, "KDF1");
+#endif
+
+#if defined(BOTAN_HAS_KDF2)
+BOTAN_REGISTER_KDF_1HASH(KDF2, "KDF2");
+#endif
+
+#if defined(BOTAN_HAS_TLS_V10_PRF)
+BOTAN_REGISTER_KDF_NOARGS(TLS_PRF, "TLS-PRF");
+#endif
+
+#if defined(BOTAN_HAS_TLS_V12_PRF)
+BOTAN_REGISTER_NAMED_T(KDF, "TLS-12-PRF", TLS_12_PRF, TLS_12_PRF::make);
+#endif
+
+#if defined(BOTAN_HAS_X942_PRF)
+BOTAN_REGISTER_KDF_NAMED_1STR(X942_PRF, "X9.42-PRF");
+#endif
+
}