aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/cert
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-10-17 03:11:14 -0400
committerJack Lloyd <[email protected]>2016-10-17 03:11:14 -0400
commit0b353965a56dabf7528eecf672cc627304dbb8e1 (patch)
treededfd4db3cc140f4a4c2fbba8a566742bc735fd2 /src/lib/cert
parenta816a52612cd8e9cf12bfdccaacc5ce7960b2700 (diff)
parent8b3bda479efecef760f052cc055d3d6d98bf0637 (diff)
Merge GH #665 Add IncludeOS target, make filesystem/threads optional
Diffstat (limited to 'src/lib/cert')
-rw-r--r--src/lib/cert/x509/certstor.cpp2
-rw-r--r--src/lib/cert/x509/certstor_sql/certstor_sql.h2
-rw-r--r--src/lib/cert/x509/pkcs10.cpp6
-rw-r--r--src/lib/cert/x509/pkcs10.h2
-rw-r--r--src/lib/cert/x509/x509_crl.cpp6
-rw-r--r--src/lib/cert/x509/x509_crl.h2
-rw-r--r--src/lib/cert/x509/x509_obj.cpp2
-rw-r--r--src/lib/cert/x509/x509_obj.h5
-rw-r--r--src/lib/cert/x509/x509cert.cpp6
-rw-r--r--src/lib/cert/x509/x509cert.h2
-rw-r--r--src/lib/cert/x509/x509path.cpp1
11 files changed, 28 insertions, 8 deletions
diff --git a/src/lib/cert/x509/certstor.cpp b/src/lib/cert/x509/certstor.cpp
index 28b46ef1a..24cd84de7 100644
--- a/src/lib/cert/x509/certstor.cpp
+++ b/src/lib/cert/x509/certstor.cpp
@@ -114,6 +114,7 @@ Certificate_Store_In_Memory::Certificate_Store_In_Memory(const X509_Certificate&
add_certificate(cert);
}
+#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
Certificate_Store_In_Memory::Certificate_Store_In_Memory(const std::string& dir)
{
if(dir.empty())
@@ -131,6 +132,7 @@ Certificate_Store_In_Memory::Certificate_Store_In_Memory(const std::string& dir)
}
}
}
+#endif
std::shared_ptr<const X509_Certificate>
Certificate_Store_Overlay::find_cert(const X509_DN& subject_dn,
diff --git a/src/lib/cert/x509/certstor_sql/certstor_sql.h b/src/lib/cert/x509/certstor_sql/certstor_sql.h
index c1168b827..0025884f9 100644
--- a/src/lib/cert/x509/certstor_sql/certstor_sql.h
+++ b/src/lib/cert/x509/certstor_sql/certstor_sql.h
@@ -97,7 +97,7 @@ class BOTAN_DLL Certificate_Store_In_SQL : public Certificate_Store
std::shared_ptr<SQL_Database> m_database;
std::string m_prefix;
std::string m_password;
- std::mutex m_mutex;
+ mutex_type m_mutex;
};
}
diff --git a/src/lib/cert/x509/pkcs10.cpp b/src/lib/cert/x509/pkcs10.cpp
index 40a9894cc..ccd22454b 100644
--- a/src/lib/cert/x509/pkcs10.cpp
+++ b/src/lib/cert/x509/pkcs10.cpp
@@ -25,14 +25,16 @@ PKCS10_Request::PKCS10_Request(DataSource& in) :
do_decode();
}
+#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
/*
* PKCS10_Request Constructor
*/
-PKCS10_Request::PKCS10_Request(const std::string& in) :
- X509_Object(in, "CERTIFICATE REQUEST/NEW CERTIFICATE REQUEST")
+PKCS10_Request::PKCS10_Request(const std::string& fsname) :
+ X509_Object(fsname, "CERTIFICATE REQUEST/NEW CERTIFICATE REQUEST")
{
do_decode();
}
+#endif
/*
* PKCS10_Request Constructor
diff --git a/src/lib/cert/x509/pkcs10.h b/src/lib/cert/x509/pkcs10.h
index 8c9f49d84..c7a9ec300 100644
--- a/src/lib/cert/x509/pkcs10.h
+++ b/src/lib/cert/x509/pkcs10.h
@@ -86,12 +86,14 @@ class BOTAN_DLL PKCS10_Request final : public X509_Object
*/
explicit PKCS10_Request(DataSource& source);
+#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
/**
* Create a PKCS#10 Request from a file.
* @param filename the name of the file containing the DER or PEM
* encoded request file
*/
explicit PKCS10_Request(const std::string& filename);
+#endif
/**
* Create a PKCS#10 Request from binary data.
diff --git a/src/lib/cert/x509/x509_crl.cpp b/src/lib/cert/x509/x509_crl.cpp
index 3c75825c1..8eb4c01db 100644
--- a/src/lib/cert/x509/x509_crl.cpp
+++ b/src/lib/cert/x509/x509_crl.cpp
@@ -24,14 +24,16 @@ X509_CRL::X509_CRL(DataSource& in, bool touc) :
do_decode();
}
+#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
/*
* Load a X.509 CRL
*/
-X509_CRL::X509_CRL(const std::string& in, bool touc) :
- X509_Object(in, "CRL/X509 CRL"), m_throw_on_unknown_critical(touc)
+X509_CRL::X509_CRL(const std::string& fsname, bool touc) :
+ X509_Object(fsname, "CRL/X509 CRL"), m_throw_on_unknown_critical(touc)
{
do_decode();
}
+#endif
X509_CRL::X509_CRL(const std::vector<byte>& in, bool touc) :
X509_Object(in, "CRL/X509 CRL"), m_throw_on_unknown_critical(touc)
diff --git a/src/lib/cert/x509/x509_crl.h b/src/lib/cert/x509/x509_crl.h
index 7373e9936..e11ea8f48 100644
--- a/src/lib/cert/x509/x509_crl.h
+++ b/src/lib/cert/x509/x509_crl.h
@@ -82,6 +82,7 @@ class BOTAN_DLL X509_CRL final : public X509_Object
*/
X509_CRL(DataSource& source, bool throw_on_unknown_critical = false);
+#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
/**
* Construct a CRL from a file containing the DER or PEM encoded CRL.
* @param filename the name of the CRL file
@@ -90,6 +91,7 @@ class BOTAN_DLL X509_CRL final : public X509_Object
*/
X509_CRL(const std::string& filename,
bool throw_on_unknown_critical = false);
+#endif
/**
* Construct a CRL from a binary vector
diff --git a/src/lib/cert/x509/x509_obj.cpp b/src/lib/cert/x509/x509_obj.cpp
index 983be40b2..3c5d2a9b4 100644
--- a/src/lib/cert/x509/x509_obj.cpp
+++ b/src/lib/cert/x509/x509_obj.cpp
@@ -25,6 +25,7 @@ X509_Object::X509_Object(DataSource& stream, const std::string& labels)
init(stream, labels);
}
+#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
/*
* Create a generic X.509 object
*/
@@ -33,6 +34,7 @@ X509_Object::X509_Object(const std::string& file, const std::string& labels)
DataSource_Stream stream(file, true);
init(stream, labels);
}
+#endif
/*
* Create a generic X.509 object
diff --git a/src/lib/cert/x509/x509_obj.h b/src/lib/cert/x509/x509_obj.h
index 8b561a142..40324775c 100644
--- a/src/lib/cert/x509/x509_obj.h
+++ b/src/lib/cert/x509/x509_obj.h
@@ -96,9 +96,12 @@ class BOTAN_DLL X509_Object : public ASN1_Object
virtual ~X509_Object() {}
protected:
X509_Object(DataSource& src, const std::string& pem_labels);
- X509_Object(const std::string& file, const std::string& pem_labels);
X509_Object(const std::vector<byte>& vec, const std::string& labels);
+#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
+ X509_Object(const std::string& file, const std::string& pem_labels);
+#endif
+
void do_decode();
X509_Object() {}
AlgorithmIdentifier m_sig_algo;
diff --git a/src/lib/cert/x509/x509cert.cpp b/src/lib/cert/x509/x509cert.cpp
index 5765214ae..f56495a79 100644
--- a/src/lib/cert/x509/x509cert.cpp
+++ b/src/lib/cert/x509/x509cert.cpp
@@ -50,16 +50,18 @@ X509_Certificate::X509_Certificate(DataSource& in) :
do_decode();
}
+#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
/*
* X509_Certificate Constructor
*/
-X509_Certificate::X509_Certificate(const std::string& in) :
- X509_Object(in, "CERTIFICATE/X509 CERTIFICATE"),
+X509_Certificate::X509_Certificate(const std::string& fsname) :
+ X509_Object(fsname, "CERTIFICATE/X509 CERTIFICATE"),
m_self_signed(false),
m_v3_extensions(false)
{
do_decode();
}
+#endif
/*
* X509_Certificate Constructor
diff --git a/src/lib/cert/x509/x509cert.h b/src/lib/cert/x509/x509cert.h
index 12e99c44e..acdba7e02 100644
--- a/src/lib/cert/x509/x509cert.h
+++ b/src/lib/cert/x509/x509cert.h
@@ -267,12 +267,14 @@ class BOTAN_DLL X509_Certificate : public X509_Object
*/
explicit X509_Certificate(DataSource& source);
+#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
/**
* Create a certificate from a file containing the DER or PEM
* encoded certificate.
* @param filename the name of the certificate file
*/
explicit X509_Certificate(const std::string& filename);
+#endif
/**
* Create a certificate from a buffer
diff --git a/src/lib/cert/x509/x509path.cpp b/src/lib/cert/x509/x509path.cpp
index 65ab3eac1..29853bb4a 100644
--- a/src/lib/cert/x509/x509path.cpp
+++ b/src/lib/cert/x509/x509path.cpp
@@ -15,6 +15,7 @@
#include <chrono>
#include <vector>
#include <set>
+#include <future>
namespace Botan {