aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/kdf
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2020-11-05 03:47:06 -0500
committerJack Lloyd <[email protected]>2020-11-06 11:31:22 -0500
commita55e4b22b6cbeeb30ca787d4ea4e3933ccccbdf1 (patch)
tree3d066440f30d30a46179caded3f1273d06a4dd95 /src/lib/kdf
parent7c27982e27b953682554de3c4b22843e0e7461e7 (diff)
Remove deprecated headers, make more headers internal
Now modules default to internal headers instead of defaulting to public; making a new public API should be a visible and intentional choice. Brings the public header count from over 300 to around 150. Also removes the deprecated tls_blocking interface
Diffstat (limited to 'src/lib/kdf')
-rw-r--r--src/lib/kdf/hkdf/hkdf.cpp4
-rw-r--r--src/lib/kdf/hkdf/hkdf.h14
-rw-r--r--src/lib/kdf/kdf.cpp18
-rw-r--r--src/lib/kdf/kdf1/kdf1.cpp2
-rw-r--r--src/lib/kdf/kdf1/kdf1.h4
-rw-r--r--src/lib/kdf/kdf1_iso18033/kdf1_iso18033.cpp2
-rw-r--r--src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h4
-rw-r--r--src/lib/kdf/kdf2/kdf2.cpp2
-rw-r--r--src/lib/kdf/kdf2/kdf2.h4
-rw-r--r--src/lib/kdf/prf_tls/prf_tls.cpp2
-rw-r--r--src/lib/kdf/prf_tls/prf_tls.h6
-rw-r--r--src/lib/kdf/prf_x942/prf_x942.cpp4
-rw-r--r--src/lib/kdf/prf_x942/prf_x942.h4
-rw-r--r--src/lib/kdf/sp800_108/sp800_108.cpp4
-rw-r--r--src/lib/kdf/sp800_108/sp800_108.h8
-rw-r--r--src/lib/kdf/sp800_56a/sp800_56a.cpp2
-rw-r--r--src/lib/kdf/sp800_56a/sp800_56a.h6
-rw-r--r--src/lib/kdf/sp800_56c/sp800_56c.cpp2
-rw-r--r--src/lib/kdf/sp800_56c/sp800_56c.h4
19 files changed, 37 insertions, 59 deletions
diff --git a/src/lib/kdf/hkdf/hkdf.cpp b/src/lib/kdf/hkdf/hkdf.cpp
index 0a62648fc..2c9196c3b 100644
--- a/src/lib/kdf/hkdf/hkdf.cpp
+++ b/src/lib/kdf/hkdf/hkdf.cpp
@@ -6,8 +6,8 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/hkdf.h>
-#include <botan/loadstor.h>
+#include <botan/internal/hkdf.h>
+#include <botan/internal/loadstor.h>
namespace Botan {
diff --git a/src/lib/kdf/hkdf/hkdf.h b/src/lib/kdf/hkdf/hkdf.h
index 4b1ed2922..cf4efb443 100644
--- a/src/lib/kdf/hkdf/hkdf.h
+++ b/src/lib/kdf/hkdf/hkdf.h
@@ -12,18 +12,12 @@
#include <botan/mac.h>
#include <botan/kdf.h>
-/*
-* The definitions of HKDF, HKDF_Extract, HKDF_Expand will be made internal
-* in the future. However the function hkdf_expand_label will still be defined.
-*/
-//BOTAN_FUTURE_INTERNAL_HEADER(hkdf.h)
-
namespace Botan {
/**
* HKDF from RFC 5869.
*/
-class BOTAN_PUBLIC_API(2,0) HKDF final : public KDF
+class HKDF final : public KDF
{
public:
/**
@@ -47,7 +41,7 @@ class BOTAN_PUBLIC_API(2,0) HKDF final : public KDF
/**
* HKDF Extraction Step from RFC 5869.
*/
-class BOTAN_PUBLIC_API(2,0) HKDF_Extract final : public KDF
+class HKDF_Extract final : public KDF
{
public:
/**
@@ -71,7 +65,7 @@ class BOTAN_PUBLIC_API(2,0) HKDF_Extract final : public KDF
/**
* HKDF Expansion Step from RFC 5869.
*/
-class BOTAN_PUBLIC_API(2,0) HKDF_Expand final : public KDF
+class HKDF_Expand final : public KDF
{
public:
/**
@@ -104,7 +98,7 @@ class BOTAN_PUBLIC_API(2,0) HKDF_Expand final : public KDF
* @param length the desired output length
*/
secure_vector<uint8_t>
-BOTAN_PUBLIC_API(2,3) hkdf_expand_label(
+BOTAN_TEST_API hkdf_expand_label(
const std::string& hash_fn,
const uint8_t secret[], size_t secret_len,
const std::string& label,
diff --git a/src/lib/kdf/kdf.cpp b/src/lib/kdf/kdf.cpp
index 7f7d352db..87a6bb5f6 100644
--- a/src/lib/kdf/kdf.cpp
+++ b/src/lib/kdf/kdf.cpp
@@ -12,39 +12,39 @@
#include <botan/exceptn.h>
#if defined(BOTAN_HAS_HKDF)
-#include <botan/hkdf.h>
+#include <botan/internal/hkdf.h>
#endif
#if defined(BOTAN_HAS_KDF1)
-#include <botan/kdf1.h>
+#include <botan/internal/kdf1.h>
#endif
#if defined(BOTAN_HAS_KDF2)
-#include <botan/kdf2.h>
+#include <botan/internal/kdf2.h>
#endif
#if defined(BOTAN_HAS_KDF1_18033)
-#include <botan/kdf1_iso18033.h>
+#include <botan/internal/kdf1_iso18033.h>
#endif
#if defined(BOTAN_HAS_TLS_V10_PRF) || defined(BOTAN_HAS_TLS_V12_PRF)
-#include <botan/prf_tls.h>
+#include <botan/internal/prf_tls.h>
#endif
#if defined(BOTAN_HAS_X942_PRF)
-#include <botan/prf_x942.h>
+#include <botan/internal/prf_x942.h>
#endif
#if defined(BOTAN_HAS_SP800_108)
-#include <botan/sp800_108.h>
+#include <botan/internal/sp800_108.h>
#endif
#if defined(BOTAN_HAS_SP800_56A)
-#include <botan/sp800_56a.h>
+#include <botan/internal/sp800_56a.h>
#endif
#if defined(BOTAN_HAS_SP800_56C)
-#include <botan/sp800_56c.h>
+#include <botan/internal/sp800_56c.h>
#endif
namespace Botan {
diff --git a/src/lib/kdf/kdf1/kdf1.cpp b/src/lib/kdf/kdf1/kdf1.cpp
index 3de261c55..844311681 100644
--- a/src/lib/kdf/kdf1/kdf1.cpp
+++ b/src/lib/kdf/kdf1/kdf1.cpp
@@ -5,7 +5,7 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/kdf1.h>
+#include <botan/internal/kdf1.h>
namespace Botan {
diff --git a/src/lib/kdf/kdf1/kdf1.h b/src/lib/kdf/kdf1/kdf1.h
index 388b55251..612be45f7 100644
--- a/src/lib/kdf/kdf1/kdf1.h
+++ b/src/lib/kdf/kdf1/kdf1.h
@@ -11,14 +11,12 @@
#include <botan/kdf.h>
#include <botan/hash.h>
-BOTAN_FUTURE_INTERNAL_HEADER(kdf1.h)
-
namespace Botan {
/**
* KDF1, from IEEE 1363
*/
-class BOTAN_PUBLIC_API(2,0) KDF1 final : public KDF
+class KDF1 final : public KDF
{
public:
std::string name() const override { return "KDF1(" + m_hash->name() + ")"; }
diff --git a/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.cpp b/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.cpp
index c7699d2f2..2a076cbff 100644
--- a/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.cpp
+++ b/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.cpp
@@ -5,7 +5,7 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/kdf1_iso18033.h>
+#include <botan/internal/kdf1_iso18033.h>
namespace Botan {
diff --git a/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h b/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h
index 5f913057e..5a96c2a63 100644
--- a/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h
+++ b/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h
@@ -11,14 +11,12 @@
#include <botan/kdf.h>
#include <botan/hash.h>
-BOTAN_FUTURE_INTERNAL_HEADER(kdf1_iso18033.h)
-
namespace Botan {
/**
* KDF1, from ISO 18033-2
*/
-class BOTAN_PUBLIC_API(2,0) KDF1_18033 final : public KDF
+class KDF1_18033 final : public KDF
{
public:
std::string name() const override { return "KDF1-18033(" + m_hash->name() + ")"; }
diff --git a/src/lib/kdf/kdf2/kdf2.cpp b/src/lib/kdf/kdf2/kdf2.cpp
index 4e3bb5583..577176c23 100644
--- a/src/lib/kdf/kdf2/kdf2.cpp
+++ b/src/lib/kdf/kdf2/kdf2.cpp
@@ -5,7 +5,7 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/kdf2.h>
+#include <botan/internal/kdf2.h>
namespace Botan {
diff --git a/src/lib/kdf/kdf2/kdf2.h b/src/lib/kdf/kdf2/kdf2.h
index 43abbf087..1f4d30a4f 100644
--- a/src/lib/kdf/kdf2/kdf2.h
+++ b/src/lib/kdf/kdf2/kdf2.h
@@ -11,14 +11,12 @@
#include <botan/kdf.h>
#include <botan/hash.h>
-BOTAN_FUTURE_INTERNAL_HEADER(kdf2.h)
-
namespace Botan {
/**
* KDF2, from IEEE 1363
*/
-class BOTAN_PUBLIC_API(2,0) KDF2 final : public KDF
+class KDF2 final : public KDF
{
public:
std::string name() const override { return "KDF2(" + m_hash->name() + ")"; }
diff --git a/src/lib/kdf/prf_tls/prf_tls.cpp b/src/lib/kdf/prf_tls/prf_tls.cpp
index c98c7d351..540166546 100644
--- a/src/lib/kdf/prf_tls/prf_tls.cpp
+++ b/src/lib/kdf/prf_tls/prf_tls.cpp
@@ -5,7 +5,7 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/prf_tls.h>
+#include <botan/internal/prf_tls.h>
#include <botan/exceptn.h>
namespace Botan {
diff --git a/src/lib/kdf/prf_tls/prf_tls.h b/src/lib/kdf/prf_tls/prf_tls.h
index 603086a7e..8d10f7270 100644
--- a/src/lib/kdf/prf_tls/prf_tls.h
+++ b/src/lib/kdf/prf_tls/prf_tls.h
@@ -11,14 +11,12 @@
#include <botan/kdf.h>
#include <botan/mac.h>
-BOTAN_FUTURE_INTERNAL_HEADER(prf_tls.h)
-
namespace Botan {
/**
* PRF used in TLS 1.0/1.1
*/
-class BOTAN_PUBLIC_API(2,0) TLS_PRF final : public KDF
+class TLS_PRF final : public KDF
{
public:
std::string name() const override { return "TLS-PRF"; }
@@ -45,7 +43,7 @@ class BOTAN_PUBLIC_API(2,0) TLS_PRF final : public KDF
/**
* PRF used in TLS 1.2
*/
-class BOTAN_PUBLIC_API(2,0) TLS_12_PRF final : public KDF
+class TLS_12_PRF final : public KDF
{
public:
std::string name() const override { return "TLS-12-PRF(" + m_mac->name() + ")"; }
diff --git a/src/lib/kdf/prf_x942/prf_x942.cpp b/src/lib/kdf/prf_x942/prf_x942.cpp
index 4a4a3a7f0..2fb2ef543 100644
--- a/src/lib/kdf/prf_x942/prf_x942.cpp
+++ b/src/lib/kdf/prf_x942/prf_x942.cpp
@@ -5,10 +5,10 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/prf_x942.h>
+#include <botan/internal/prf_x942.h>
#include <botan/der_enc.h>
#include <botan/hash.h>
-#include <botan/loadstor.h>
+#include <botan/internal/loadstor.h>
#include <algorithm>
namespace Botan {
diff --git a/src/lib/kdf/prf_x942/prf_x942.h b/src/lib/kdf/prf_x942/prf_x942.h
index 98af7e069..5f993fef4 100644
--- a/src/lib/kdf/prf_x942/prf_x942.h
+++ b/src/lib/kdf/prf_x942/prf_x942.h
@@ -11,14 +11,12 @@
#include <botan/kdf.h>
#include <botan/asn1_obj.h>
-BOTAN_FUTURE_INTERNAL_HEADER(prf_x942.h)
-
namespace Botan {
/**
* PRF from ANSI X9.42
*/
-class BOTAN_PUBLIC_API(2,0) X942_PRF final : public KDF
+class X942_PRF final : public KDF
{
public:
std::string name() const override;
diff --git a/src/lib/kdf/sp800_108/sp800_108.cpp b/src/lib/kdf/sp800_108/sp800_108.cpp
index 909e8d47d..b36d66b8c 100644
--- a/src/lib/kdf/sp800_108/sp800_108.cpp
+++ b/src/lib/kdf/sp800_108/sp800_108.cpp
@@ -5,8 +5,8 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/sp800_108.h>
-#include <botan/loadstor.h>
+#include <botan/internal/sp800_108.h>
+#include <botan/internal/loadstor.h>
#include <botan/exceptn.h>
#include <iterator>
diff --git a/src/lib/kdf/sp800_108/sp800_108.h b/src/lib/kdf/sp800_108/sp800_108.h
index 46f734e8e..0055c0ad8 100644
--- a/src/lib/kdf/sp800_108/sp800_108.h
+++ b/src/lib/kdf/sp800_108/sp800_108.h
@@ -11,14 +11,12 @@
#include <botan/kdf.h>
#include <botan/mac.h>
-BOTAN_FUTURE_INTERNAL_HEADER(sp800_108.h)
-
namespace Botan {
/**
* NIST SP 800-108 KDF in Counter Mode (5.1)
*/
-class BOTAN_PUBLIC_API(2,0) SP800_108_Counter final : public KDF
+class SP800_108_Counter final : public KDF
{
public:
std::string name() const override { return "SP800-108-Counter(" + m_prf->name() + ")"; }
@@ -58,7 +56,7 @@ class BOTAN_PUBLIC_API(2,0) SP800_108_Counter final : public KDF
/**
* NIST SP 800-108 KDF in Feedback Mode (5.2)
*/
-class BOTAN_PUBLIC_API(2,0) SP800_108_Feedback final : public KDF
+class SP800_108_Feedback final : public KDF
{
public:
std::string name() const override { return "SP800-108-Feedback(" + m_prf->name() + ")"; }
@@ -95,7 +93,7 @@ class BOTAN_PUBLIC_API(2,0) SP800_108_Feedback final : public KDF
/**
* NIST SP 800-108 KDF in Double Pipeline Mode (5.3)
*/
-class BOTAN_PUBLIC_API(2,0) SP800_108_Pipeline final : public KDF
+class SP800_108_Pipeline final : public KDF
{
public:
std::string name() const override { return "SP800-108-Pipeline(" + m_prf->name() + ")"; }
diff --git a/src/lib/kdf/sp800_56a/sp800_56a.cpp b/src/lib/kdf/sp800_56a/sp800_56a.cpp
index 8e9bcf856..06d724da6 100644
--- a/src/lib/kdf/sp800_56a/sp800_56a.cpp
+++ b/src/lib/kdf/sp800_56a/sp800_56a.cpp
@@ -6,7 +6,7 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/sp800_56a.h>
+#include <botan/internal/sp800_56a.h>
#include <botan/scan_name.h>
#include <botan/exceptn.h>
diff --git a/src/lib/kdf/sp800_56a/sp800_56a.h b/src/lib/kdf/sp800_56a/sp800_56a.h
index e83f117e2..512ab5b68 100644
--- a/src/lib/kdf/sp800_56a/sp800_56a.h
+++ b/src/lib/kdf/sp800_56a/sp800_56a.h
@@ -13,15 +13,13 @@
#include <botan/hash.h>
#include <botan/mac.h>
-BOTAN_FUTURE_INTERNAL_HEADER(sp800_56a.h)
-
namespace Botan {
/**
* NIST SP 800-56A KDF using hash function
* @warning This KDF ignores the provided salt value
*/
-class BOTAN_PUBLIC_API(2,2) SP800_56A_Hash final : public KDF
+class SP800_56A_Hash final : public KDF
{
public:
std::string name() const override { return "SP800-56A(" + m_hash->name() + ")"; }
@@ -61,7 +59,7 @@ class BOTAN_PUBLIC_API(2,2) SP800_56A_Hash final : public KDF
/**
* NIST SP 800-56A KDF using HMAC
*/
-class BOTAN_PUBLIC_API(2,2) SP800_56A_HMAC final : public KDF
+class SP800_56A_HMAC final : public KDF
{
public:
std::string name() const override { return "SP800-56A(" + m_mac->name() + ")"; }
diff --git a/src/lib/kdf/sp800_56c/sp800_56c.cpp b/src/lib/kdf/sp800_56c/sp800_56c.cpp
index c0a1a1f68..fbdd13eb9 100644
--- a/src/lib/kdf/sp800_56c/sp800_56c.cpp
+++ b/src/lib/kdf/sp800_56c/sp800_56c.cpp
@@ -5,7 +5,7 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/sp800_56c.h>
+#include <botan/internal/sp800_56c.h>
namespace Botan {
diff --git a/src/lib/kdf/sp800_56c/sp800_56c.h b/src/lib/kdf/sp800_56c/sp800_56c.h
index bdbdfcd9e..ffc56752c 100644
--- a/src/lib/kdf/sp800_56c/sp800_56c.h
+++ b/src/lib/kdf/sp800_56c/sp800_56c.h
@@ -11,14 +11,12 @@
#include <botan/kdf.h>
#include <botan/mac.h>
-BOTAN_FUTURE_INTERNAL_HEADER(sp800_56c.h)
-
namespace Botan {
/**
* NIST SP 800-56C KDF
*/
-class BOTAN_PUBLIC_API(2,0) SP800_56C final : public KDF
+class SP800_56C final : public KDF
{
public:
std::string name() const override { return "SP800-56C(" + m_prf->name() + ")"; }