Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Davide Pesavento | 0f83080 | 2018-01-16 23:58:58 -0500 | [diff] [blame] | 2 | /* |
Davide Pesavento | 187e9f9 | 2023-03-20 22:46:22 -0400 | [diff] [blame] | 3 | * Copyright (c) 2013-2023 Regents of the University of California. |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
| 6 | * |
| 7 | * ndn-cxx library is free software: you can redistribute it and/or modify it under the |
| 8 | * terms of the GNU Lesser General Public License as published by the Free Software |
| 9 | * Foundation, either version 3 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY |
| 12 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 13 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received copies of the GNU General Public License and GNU Lesser |
| 16 | * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see |
| 17 | * <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
| 20 | */ |
| 21 | |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 22 | #include "ndn-cxx/security/validity-period.hpp" |
Davide Pesavento | 152ef44 | 2023-04-22 02:02:29 -0400 | [diff] [blame] | 23 | #include "ndn-cxx/util/concepts.hpp" |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 24 | |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 25 | #include "tests/boost-test.hpp" |
Davide Pesavento | 4c1ad4c | 2020-11-16 21:12:02 -0500 | [diff] [blame] | 26 | #include "tests/unit/clock-fixture.hpp" |
Davide Pesavento | 74daf74 | 2018-11-23 18:14:13 -0500 | [diff] [blame] | 27 | |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 28 | #include <boost/lexical_cast.hpp> |
| 29 | |
Davide Pesavento | 47ce2ee | 2023-05-09 01:33:33 -0400 | [diff] [blame] | 30 | namespace ndn::tests { |
Yingdi Yu | 10bf63a | 2015-11-04 14:14:37 -0800 | [diff] [blame] | 31 | |
Davide Pesavento | 47ce2ee | 2023-05-09 01:33:33 -0400 | [diff] [blame] | 32 | using ndn::security::ValidityPeriod; |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 33 | |
Davide Pesavento | 152ef44 | 2023-04-22 02:02:29 -0400 | [diff] [blame] | 34 | BOOST_CONCEPT_ASSERT((boost::EqualityComparable<ValidityPeriod>)); |
| 35 | BOOST_CONCEPT_ASSERT((WireEncodable<ValidityPeriod>)); |
| 36 | BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<ValidityPeriod>)); |
| 37 | BOOST_CONCEPT_ASSERT((WireDecodable<ValidityPeriod>)); |
| 38 | static_assert(std::is_convertible_v<ValidityPeriod::Error*, tlv::Error*>, |
| 39 | "ValidityPeriod::Error must inherit from tlv::Error"); |
| 40 | |
Davide Pesavento | eee3e82 | 2016-11-26 19:19:34 +0100 | [diff] [blame] | 41 | BOOST_AUTO_TEST_SUITE(Security) |
| 42 | BOOST_AUTO_TEST_SUITE(TestValidityPeriod) |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 43 | |
Junxiao Shi | 9ee770b | 2022-04-25 23:33:33 +0000 | [diff] [blame] | 44 | BOOST_AUTO_TEST_SUITE(MakeRelative) |
| 45 | |
| 46 | BOOST_AUTO_TEST_CASE(FromNow) |
| 47 | { |
| 48 | auto vp = ValidityPeriod::makeRelative(-1_s, 365_days, time::fromIsoString("20091117T203458,651387237")); |
| 49 | auto period = vp.getPeriod(); |
| 50 | BOOST_CHECK_EQUAL(period.first, time::fromIsoString("20091117T203458")); |
| 51 | BOOST_CHECK_EQUAL(period.second, time::fromIsoString("20101117T203458")); |
| 52 | } |
| 53 | |
| 54 | BOOST_AUTO_TEST_CASE(Positive) |
| 55 | { |
| 56 | auto vp = ValidityPeriod::makeRelative(10_s, 1_days, time::fromIsoString("20091117T203458,651387237")); |
| 57 | auto period = vp.getPeriod(); |
| 58 | BOOST_CHECK_EQUAL(period.first, time::fromIsoString("20091117T203509")); |
| 59 | BOOST_CHECK_EQUAL(period.second, time::fromIsoString("20091118T203458")); |
| 60 | } |
| 61 | |
| 62 | BOOST_AUTO_TEST_CASE(Negative) |
| 63 | { |
| 64 | auto vp = ValidityPeriod::makeRelative(-1_days, -10_s, time::fromIsoString("20091117T203458,651387237")); |
| 65 | auto period = vp.getPeriod(); |
| 66 | BOOST_CHECK_EQUAL(period.first, time::fromIsoString("20091116T203459")); |
| 67 | BOOST_CHECK_EQUAL(period.second, time::fromIsoString("20091117T203448")); |
| 68 | } |
| 69 | |
| 70 | BOOST_AUTO_TEST_SUITE_END() // MakeRelative |
| 71 | |
Davide Pesavento | 4c1ad4c | 2020-11-16 21:12:02 -0500 | [diff] [blame] | 72 | BOOST_FIXTURE_TEST_CASE(ConstructorSetter, ClockFixture) |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 73 | { |
Davide Pesavento | 4c1ad4c | 2020-11-16 21:12:02 -0500 | [diff] [blame] | 74 | auto now = m_systemClock->getNow(); |
| 75 | auto notBefore = now - 1_day; |
| 76 | auto notAfter = notBefore + 2_days; |
| 77 | ValidityPeriod validity1(notBefore, notAfter); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 78 | |
| 79 | auto period = validity1.getPeriod(); |
| 80 | BOOST_CHECK_GE(period.first, notBefore); // fractional seconds will be removed |
Davide Pesavento | 0f83080 | 2018-01-16 23:58:58 -0500 | [diff] [blame] | 81 | BOOST_CHECK_LT(period.first, notBefore + 1_s); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 82 | |
| 83 | BOOST_CHECK_LE(period.second, notAfter); // fractional seconds will be removed |
Davide Pesavento | 0f83080 | 2018-01-16 23:58:58 -0500 | [diff] [blame] | 84 | BOOST_CHECK_GT(period.second, notAfter - 1_s); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 85 | BOOST_CHECK_EQUAL(validity1.isValid(), true); |
| 86 | |
Davide Pesavento | 0f83080 | 2018-01-16 23:58:58 -0500 | [diff] [blame] | 87 | BOOST_CHECK_EQUAL(ValidityPeriod(now - 2_days, now - 1_day).isValid(), false); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 88 | |
| 89 | BOOST_CHECK_NO_THROW((ValidityPeriod())); |
| 90 | ValidityPeriod validity2; |
Yingdi Yu | 10bf63a | 2015-11-04 14:14:37 -0800 | [diff] [blame] | 91 | BOOST_CHECK_EQUAL(validity2.isValid(), false); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 92 | |
| 93 | validity2.setPeriod(notBefore, notAfter); |
Davide Pesavento | 187e9f9 | 2023-03-20 22:46:22 -0400 | [diff] [blame] | 94 | BOOST_CHECK(validity2.getPeriod() != std::pair(time::getUnixEpoch(), time::getUnixEpoch())); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 95 | BOOST_CHECK_EQUAL(validity2, validity1); |
| 96 | |
Davide Pesavento | 0f83080 | 2018-01-16 23:58:58 -0500 | [diff] [blame] | 97 | validity1.setPeriod(time::getUnixEpoch(), time::getUnixEpoch() + 10 * 365_days); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 98 | BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(validity1), |
| 99 | "(19700101T000000, 19791230T000000)"); |
| 100 | |
Davide Pesavento | 0f83080 | 2018-01-16 23:58:58 -0500 | [diff] [blame] | 101 | validity1.setPeriod(time::getUnixEpoch() + 1_ns, |
Junxiao Shi | 502c4c3 | 2023-07-17 12:26:22 +0000 | [diff] [blame] | 102 | time::getUnixEpoch() + 3650_days + 1_ns); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 103 | BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(validity1), |
| 104 | "(19700101T000001, 19791230T000000)"); |
Yingdi Yu | 10bf63a | 2015-11-04 14:14:37 -0800 | [diff] [blame] | 105 | |
Junxiao Shi | 502c4c3 | 2023-07-17 12:26:22 +0000 | [diff] [blame] | 106 | validity1.setPeriod(time::getUnixEpoch() + 999999999_ns, |
| 107 | time::getUnixEpoch() + 3650_days + 999999999_ns); |
| 108 | BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(validity1), |
| 109 | "(19700101T000001, 19791230T000000)"); |
| 110 | |
| 111 | validity1.setPeriod(time::getUnixEpoch() - 2_days + 1_ns, |
| 112 | time::getUnixEpoch() - 1_day + 1_ns); |
| 113 | BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(validity1), |
| 114 | "(19691230T000001, 19691231T000000)"); |
| 115 | |
| 116 | validity1.setPeriod(time::getUnixEpoch() - 2_days + 999999999_ns, |
| 117 | time::getUnixEpoch() - 1_day + 999999999_ns); |
| 118 | BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(validity1), |
| 119 | "(19691230T000001, 19691231T000000)"); |
| 120 | |
Yingdi Yu | 10bf63a | 2015-11-04 14:14:37 -0800 | [diff] [blame] | 121 | BOOST_CHECK_EQUAL(ValidityPeriod(now, now).isValid(), true); |
Davide Pesavento | 0f83080 | 2018-01-16 23:58:58 -0500 | [diff] [blame] | 122 | BOOST_CHECK_EQUAL(ValidityPeriod(now + 1_s, now).isValid(), false); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | const uint8_t VP1[] = { |
| 126 | 0xfd, 0x00, 0xfd, 0x26, // ValidityPeriod |
| 127 | 0xfd, 0x00, 0xfe, 0x0f, // NotBefore |
| 128 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x31, // 19700101T000000 |
| 129 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, |
| 130 | 0xfd, 0x00, 0xff, 0x0f, // NotAfter |
| 131 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x32, // 19700102T000000 |
| 132 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 |
| 133 | }; |
| 134 | |
| 135 | BOOST_AUTO_TEST_CASE(EncodingDecoding) |
| 136 | { |
Davide Pesavento | 47ce2ee | 2023-05-09 01:33:33 -0400 | [diff] [blame] | 137 | time::system_clock::time_point notBefore = time::getUnixEpoch(); |
| 138 | time::system_clock::time_point notAfter = notBefore + 1_day; |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 139 | ValidityPeriod v1(notBefore, notAfter); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 140 | BOOST_CHECK_EQUAL_COLLECTIONS(v1.wireEncode().begin(), v1.wireEncode().end(), |
| 141 | VP1, VP1 + sizeof(VP1)); |
| 142 | |
Davide Pesavento | fbea4fc | 2022-02-08 07:26:04 -0500 | [diff] [blame] | 143 | ValidityPeriod v2(Block{VP1}); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 144 | BOOST_CHECK(v1.getPeriod() == v2.getPeriod()); |
| 145 | } |
| 146 | |
Junxiao Shi | 502c4c3 | 2023-07-17 12:26:22 +0000 | [diff] [blame] | 147 | const uint8_t VP2[] = { |
| 148 | 0xfd, 0x00, 0xfd, 0x26, // ValidityPeriod |
| 149 | 0xfd, 0x00, 0xfe, 0x0f, // NotBefore |
| 150 | 0x30, 0x30, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, // 00010101T000000 |
| 151 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, |
| 152 | 0xfd, 0x00, 0xff, 0x0f, // NotAfter |
| 153 | 0x39, 0x39, 0x39, 0x39, 0x31, 0x32, 0x33, 0x31, // 99991231T235959 |
| 154 | 0x54, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39 |
| 155 | }; |
| 156 | |
| 157 | BOOST_AUTO_TEST_CASE(DecodingLarge) |
| 158 | { |
| 159 | ValidityPeriod v(Block{VP2}); |
| 160 | BOOST_CHECK(v.isValid(time::fromIsoString("16770921T001245"))); |
| 161 | BOOST_CHECK(v.isValid(time::fromIsoString("19010120T120000"))); |
| 162 | BOOST_CHECK(v.isValid(time::fromIsoString("20230725T120000"))); |
| 163 | BOOST_CHECK(v.isValid(time::fromIsoString("22001030T120000"))); |
| 164 | BOOST_CHECK(v.isValid(time::fromIsoString("22620411T234716"))); |
| 165 | } |
| 166 | |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 167 | const uint8_t VP_E1[] = { |
Junxiao Shi | 502c4c3 | 2023-07-17 12:26:22 +0000 | [diff] [blame] | 168 | 0xfd, 0x00, 0xff, 0x26, // ValidityPeriod (wrong TLV-TYPE) |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 169 | 0xfd, 0x00, 0xfe, 0x0f, // NotBefore |
| 170 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x31, // 19700101T000000 |
| 171 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, |
| 172 | 0xfd, 0x00, 0xff, 0x0f, // NotAfter |
| 173 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x32, // 19700102T000000 |
| 174 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 |
| 175 | }; |
| 176 | |
| 177 | const uint8_t VP_E2[] = { |
| 178 | 0xfd, 0x00, 0xfd, 0x26, // ValidityPeriod |
Junxiao Shi | 502c4c3 | 2023-07-17 12:26:22 +0000 | [diff] [blame] | 179 | 0xfd, 0x00, 0xff, 0x0f, // NotBefore (wrong TLV-TYPE) |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 180 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x31, // 19700101T000000 |
| 181 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, |
| 182 | 0xfd, 0x00, 0xff, 0x0f, // NotAfter |
| 183 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x32, // 19700102T000000 |
| 184 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 |
| 185 | }; |
| 186 | |
| 187 | const uint8_t VP_E3[] = { |
| 188 | 0xfd, 0x00, 0xfd, 0x26, // ValidityPeriod |
| 189 | 0xfd, 0x00, 0xfe, 0x0f, // NotBefore |
| 190 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x31, // 19700101T000000 |
| 191 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, |
Junxiao Shi | 502c4c3 | 2023-07-17 12:26:22 +0000 | [diff] [blame] | 192 | 0xfd, 0x00, 0xfe, 0x0f, // NotAfter (wrong TLV-TYPE) |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 193 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x32, // 19700102T000000 |
| 194 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 |
| 195 | }; |
| 196 | |
| 197 | const uint8_t VP_E4[] = { |
| 198 | 0xfd, 0x00, 0xfd, 0x39, // ValidityPeriod |
| 199 | 0xfd, 0x00, 0xfe, 0x0f, // NotBefore |
| 200 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x31, // 19700101T000000 |
| 201 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, |
| 202 | 0xfd, 0x00, 0xff, 0x0f, // NotAfter |
| 203 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x32, // 19700102T000000 |
| 204 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, |
Junxiao Shi | 502c4c3 | 2023-07-17 12:26:22 +0000 | [diff] [blame] | 205 | 0xfd, 0x00, 0xff, 0x0f, // NotAfter (duplicate) |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 206 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x32, // 19700102T000000 |
| 207 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 |
| 208 | }; |
| 209 | |
| 210 | const uint8_t VP_E5[] = { |
| 211 | 0xfd, 0x00, 0xfd, 0x13, // ValidityPeriod |
| 212 | 0xfd, 0x00, 0xfe, 0x0f, // NotBefore |
| 213 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x31, // 19700101T000000 |
| 214 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 |
Junxiao Shi | 502c4c3 | 2023-07-17 12:26:22 +0000 | [diff] [blame] | 215 | // missing NotAfter |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 216 | }; |
| 217 | |
| 218 | const uint8_t VP_E6[] = { |
| 219 | 0xfd, 0x00, 0xfd, 0x26, // ValidityPeriod |
| 220 | 0xfd, 0x00, 0xfe, 0x0f, // NotBefore |
| 221 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x31, // 19700101T00000\xFF |
| 222 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0xFF, |
| 223 | 0xfd, 0x00, 0xff, 0x0f, // NotAfter |
| 224 | 0x31, 0x39, 0x37, 0x30, 0x30, 0x31, 0x30, 0x32, // 19700102T000000 |
| 225 | 0x54, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 |
| 226 | }; |
| 227 | |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 228 | BOOST_AUTO_TEST_CASE(DecodingError) |
| 229 | { |
Davide Pesavento | fbea4fc | 2022-02-08 07:26:04 -0500 | [diff] [blame] | 230 | BOOST_CHECK_THROW(ValidityPeriod(Block{VP_E1}), ValidityPeriod::Error); |
| 231 | BOOST_CHECK_THROW(ValidityPeriod(Block{VP_E2}), ValidityPeriod::Error); |
| 232 | BOOST_CHECK_THROW(ValidityPeriod(Block{VP_E3}), ValidityPeriod::Error); |
| 233 | BOOST_CHECK_THROW(ValidityPeriod(Block{VP_E4}), ValidityPeriod::Error); |
| 234 | BOOST_CHECK_THROW(ValidityPeriod(Block{VP_E5}), ValidityPeriod::Error); |
| 235 | BOOST_CHECK_THROW(ValidityPeriod(Block{VP_E6}), ValidityPeriod::Error); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 236 | |
| 237 | Block emptyBlock; |
Davide Pesavento | fbea4fc | 2022-02-08 07:26:04 -0500 | [diff] [blame] | 238 | BOOST_CHECK_THROW(ValidityPeriod{emptyBlock}, ValidityPeriod::Error); |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | BOOST_AUTO_TEST_CASE(Comparison) |
| 242 | { |
Davide Pesavento | 47ce2ee | 2023-05-09 01:33:33 -0400 | [diff] [blame] | 243 | auto notBefore = time::getUnixEpoch(); |
| 244 | auto notAfter = notBefore + 1_day; |
| 245 | auto notAfter2 = notBefore + 2_days; |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 246 | |
| 247 | ValidityPeriod validity1(notBefore, notAfter); |
| 248 | ValidityPeriod validity2(notBefore, notAfter); |
| 249 | BOOST_CHECK(validity1 == validity2); |
| 250 | |
| 251 | ValidityPeriod validity3(notBefore, notAfter2); |
| 252 | BOOST_CHECK(validity1 != validity3); |
| 253 | } |
| 254 | |
Davide Pesavento | eee3e82 | 2016-11-26 19:19:34 +0100 | [diff] [blame] | 255 | BOOST_AUTO_TEST_SUITE_END() // TestValidityPeriod |
| 256 | BOOST_AUTO_TEST_SUITE_END() // Security |
Yingdi Yu | 7a81389 | 2015-06-09 14:19:54 -0700 | [diff] [blame] | 257 | |
Davide Pesavento | 47ce2ee | 2023-05-09 01:33:33 -0400 | [diff] [blame] | 258 | } // namespace ndn::tests |