security: Construct KeyChain from configuration file.
Change-Id: Iaddac24e2c4e199fdde83fa1d0067a87e18729c4
Refs: #1532
diff --git a/src/util/config-file.cpp b/src/util/config-file.cpp
index 162cf60..6ba45aa 100644
--- a/src/util/config-file.cpp
+++ b/src/util/config-file.cpp
@@ -40,9 +40,21 @@
{
using namespace boost::filesystem;
- path home(std::getenv("HOME"));
- if (!home.empty())
+#ifdef NDN_CXX_HAVE_TESTS
+ if (std::getenv("TEST_HOME"))
{
+ path testHome(std::getenv("TEST_HOME"));
+ testHome /= ".ndn/client.conf";
+ if (exists(testHome))
+ {
+ return absolute(testHome);
+ }
+ }
+#endif // NDN_CXX_HAVE_TESTS
+
+ if (std::getenv("HOME"))
+ {
+ path home(std::getenv("HOME"));
home /= ".ndn/client.conf";
if (exists(home))
{