security: code cleanup and doxygen improvements in tpm::BackEndOsx
Change-Id: I6d6d77ab315a10c280e7643d4cec5269ed10fe5e
diff --git a/tests/unit-tests/security/tpm/back-end-wrapper-file.hpp b/tests/unit-tests/security/tpm/back-end-wrapper-file.hpp
index 64f5a0a..dabd6d3 100644
--- a/tests/unit-tests/security/tpm/back-end-wrapper-file.hpp
+++ b/tests/unit-tests/security/tpm/back-end-wrapper-file.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -54,7 +54,7 @@
}
std::string
- getScheme()
+ getScheme() const
{
return "tpm-file";
}
diff --git a/tests/unit-tests/security/tpm/back-end-wrapper-mem.hpp b/tests/unit-tests/security/tpm/back-end-wrapper-mem.hpp
index 692ba65..ddf629b 100644
--- a/tests/unit-tests/security/tpm/back-end-wrapper-mem.hpp
+++ b/tests/unit-tests/security/tpm/back-end-wrapper-mem.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -47,7 +47,7 @@
}
std::string
- getScheme()
+ getScheme() const
{
return "tpm-memory";
}
diff --git a/tests/unit-tests/security/tpm/back-end-wrapper-osx.hpp b/tests/unit-tests/security/tpm/back-end-wrapper-osx.hpp
index d02b717..6d7d35b 100644
--- a/tests/unit-tests/security/tpm/back-end-wrapper-osx.hpp
+++ b/tests/unit-tests/security/tpm/back-end-wrapper-osx.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -24,7 +24,8 @@
#include "security/tpm/back-end-osx.hpp"
#include "security/tpm/key-handle-osx.hpp"
-#include <Availability.h>
+
+#include <cstdlib>
namespace ndn {
namespace security {
@@ -47,17 +48,17 @@
m_HOME = std::getenv("HOME");
if (!oldHOME.empty())
- setenv("HOME", oldHOME.c_str(), 1);
+ setenv("HOME", oldHOME.data(), 1);
else
unsetenv("HOME");
- m_impl = unique_ptr<BackEnd>(new BackEndOsx);
+ m_impl = make_unique<BackEndOsx>();
}
~BackEndWrapperOsx()
{
if (!m_HOME.empty())
- setenv("HOME", m_HOME.c_str(), 1);
+ setenv("HOME", m_HOME.data(), 1);
else
unsetenv("HOME");
}
@@ -69,7 +70,7 @@
}
std::string
- getScheme()
+ getScheme() const
{
return "tpm-osxkeychain";
}