make: conditionally link to libsqlite3.
diff --git a/ndn-cpp/security/identity/basic-identity-storage.cpp b/ndn-cpp/security/identity/basic-identity-storage.cpp
index 5215e5f..18320d3 100644
--- a/ndn-cpp/security/identity/basic-identity-storage.cpp
+++ b/ndn-cpp/security/identity/basic-identity-storage.cpp
@@ -7,8 +7,7 @@
// Only compile if ndn-cpp-config.h defines NDN_CPP_HAVE_SQLITE3.
#include "../../ndn-cpp-config.h"
-#if 0 // temporarily disable.
-//#ifdef NDN_CPP_HAVE_SQLITE3
+#ifdef NDN_CPP_HAVE_SQLITE3
#include <stdlib.h>
#include <sstream>
@@ -217,10 +216,10 @@
return false;
}
-#if 0
Name
BasicIdentityStorage::getNewKeyName(const Name& identityName, bool useKsk)
{
+#if 0
TimeInterval ti = time::NowUnixTimestamp();
ostringstream oss;
oss << ti.total_seconds();
@@ -239,8 +238,10 @@
throw SecurityException("Key name already exists");
return keyName;
-}
+#else
+ throw logic_error("unimplemented");
#endif
+}
bool
BasicIdentityStorage::doesKeyExist(const Name& keyName)
@@ -387,10 +388,10 @@
return certExist;
}
-#if 0
void
BasicIdentityStorage::addAnyCertificate(const Certificate& certificate)
{
+#if 0
const Name& certificateName = certificate.getName();
Name keyName = getKeyNameForCertificate(certificateName);
@@ -424,11 +425,15 @@
int res = sqlite3_step(statement);
sqlite3_finalize(statement);
+#else
+ throw logic_error("unimplemented");
+#endif
}
void
BasicIdentityStorage::addCertificate(const Certificate& certificate)
{
+#if 0
_LOG_DEBUG("1");
const Name& certificateName = certificate.getName();
Name keyName = getKeyNameForCertificate(certificateName);
@@ -483,11 +488,15 @@
int res = sqlite3_step(statement);
sqlite3_finalize(statement);
+#else
+ throw logic_error("unimplemented");
+#endif
}
shared_ptr<Certificate>
BasicIdentityStorage::getCertificate(const Name &certificateName, bool allowAny)
{
+#if 0
if (doesCertificateExist(certificateName)) {
sqlite3_stmt *statement;
if (!allowAny) {
@@ -521,8 +530,10 @@
_LOG_DEBUG("Certificate does not exist!");
return shared_ptr<Certificate>();
}
-}
+#else
+ throw logic_error("unimplemented");
#endif
+}
Name
BasicIdentityStorage::getDefaultIdentity()
diff --git a/ndn-cpp/security/identity/basic-identity-storage.hpp b/ndn-cpp/security/identity/basic-identity-storage.hpp
index 5c61112..1cc2eb7 100644
--- a/ndn-cpp/security/identity/basic-identity-storage.hpp
+++ b/ndn-cpp/security/identity/basic-identity-storage.hpp
@@ -10,8 +10,7 @@
// Only compile if ndn-cpp-config.h defines NDN_CPP_HAVE_SQLITE3.
#include "../../ndn-cpp-config.h"
-#if 0 // temporarily disable.
-//#ifdef NDN_CPP_HAVE_SQLITE3
+#ifdef NDN_CPP_HAVE_SQLITE3
#include <sqlite3.h>
#include "../../common.hpp"