security: Correct ValidityPeriod::isValid check

Change-Id: I235773470d838f5842cdf595f83d744935d304bd
Refs: #2868
diff --git a/src/security/validity-period.cpp b/src/security/validity-period.cpp
index c6f6026..14ba0f2 100644
--- a/src/security/validity-period.cpp
+++ b/src/security/validity-period.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -39,6 +39,12 @@
 
 using boost::chrono::time_point_cast;
 
+ValidityPeriod::ValidityPeriod()
+  : ValidityPeriod(time::system_clock::TimePoint() + time::nanoseconds(1),
+                   time::system_clock::TimePoint())
+{
+}
+
 ValidityPeriod::ValidityPeriod(const time::system_clock::TimePoint& notBefore,
                                const time::system_clock::TimePoint& notAfter)
   : m_notBefore(time_point_cast<TimePoint::duration>(notBefore + TimePoint::duration(1) -
@@ -144,7 +150,7 @@
 bool
 ValidityPeriod::isValid(const time::system_clock::TimePoint& now) const
 {
-  return m_notBefore < now && now < m_notAfter;
+  return m_notBefore <= now && now <= m_notAfter;
 }
 
 bool
diff --git a/src/security/validity-period.hpp b/src/security/validity-period.hpp
index ab24d68..d09657f 100644
--- a/src/security/validity-period.hpp
+++ b/src/security/validity-period.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -48,16 +48,16 @@
   };
 
 public:
-  /** @brief Set validity period (UNIX epoch, UNIX epoch) that is always invalid
+  /** @brief Set validity period [UNIX epoch + 1 nanosecond, UNIX epoch] that is always invalid
    */
-  ValidityPeriod() = default;
+  ValidityPeriod();
 
   /** @brief Create validity period from @p block
    */
   explicit
   ValidityPeriod(const Block& block);
 
-  /** @brief Create validity period (@p notBefore, @p notAfter)
+  /** @brief Create validity period [@p notBefore, @p notAfter]
    *  @param notBefore exclusive beginning of the validity period range
    *  @param notAfter exclusive end of the validity period range
    *
@@ -70,12 +70,12 @@
 
   /** @brief Check if @p now falls within the validity period
    *  @param now Time point to check if it falls within the period
-   *  @return periodBegin < @p now and @p now < periodEnd
+   *  @return periodBegin <= @p now and @p now <= periodEnd
    */
   bool
   isValid(const time::system_clock::TimePoint& now = time::system_clock::now()) const;
 
-  /** @brief Set validity period (@p notBefore, @p notAfter)
+  /** @brief Set validity period [@p notBefore, @p notAfter]
    *  @param notBefore exclusive beginning of the validity period range
    *  @param notAfter exclusive end of the validity period range
    *