Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /* |
Davide Pesavento | 47ce2ee | 2023-05-09 01:33:33 -0400 | [diff] [blame] | 3 | * Copyright (c) 2013-2023 Regents of the University of California. |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [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 | |
Alexander Afanasyev | 09236c2 | 2020-06-03 13:42:38 -0400 | [diff] [blame] | 22 | #include "ndn-cxx/security/validation-policy-config.hpp" |
| 23 | #include "ndn-cxx/security/validator.hpp" |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 24 | #include "ndn-cxx/util/io.hpp" |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 25 | |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 26 | #include <boost/algorithm/string/predicate.hpp> |
Davide Pesavento | d8e0cad | 2021-05-26 21:43:47 -0400 | [diff] [blame] | 27 | #include <boost/filesystem/operations.hpp> |
| 28 | #include <boost/filesystem/path.hpp> |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 29 | #include <boost/lexical_cast.hpp> |
| 30 | #include <boost/property_tree/info_parser.hpp> |
| 31 | |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 32 | #include <fstream> |
| 33 | |
Davide Pesavento | 47ce2ee | 2023-05-09 01:33:33 -0400 | [diff] [blame] | 34 | namespace ndn::security::validator_config { |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 35 | |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 36 | void |
| 37 | ValidationPolicyConfig::load(const std::string& filename) |
| 38 | { |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 39 | std::ifstream inputFile(filename); |
| 40 | if (!inputFile) { |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 41 | NDN_THROW(Error("Failed to read configuration file: " + filename)); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 42 | } |
| 43 | load(inputFile, filename); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | void |
| 47 | ValidationPolicyConfig::load(const std::string& input, const std::string& filename) |
| 48 | { |
| 49 | std::istringstream inputStream(input); |
| 50 | load(inputStream, filename); |
| 51 | } |
| 52 | |
| 53 | void |
| 54 | ValidationPolicyConfig::load(std::istream& input, const std::string& filename) |
| 55 | { |
| 56 | ConfigSection tree; |
| 57 | try { |
| 58 | boost::property_tree::read_info(input, tree); |
| 59 | } |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 60 | catch (const boost::property_tree::info_parser_error& e) { |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 61 | NDN_THROW(Error("Failed to parse configuration file " + filename + |
| 62 | " line " + to_string(e.line()) + ": " + e.message())); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 63 | } |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 64 | load(tree, filename); |
| 65 | } |
| 66 | |
| 67 | void |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 68 | ValidationPolicyConfig::load(const ConfigSection& configSection, const std::string& filename) |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 69 | { |
Davide Pesavento | 0a6456c | 2019-11-14 00:33:11 -0500 | [diff] [blame] | 70 | BOOST_ASSERT(!filename.empty()); |
| 71 | |
Alexander Afanasyev | 7b11246 | 2018-10-17 11:51:52 -0400 | [diff] [blame] | 72 | if (m_validator == nullptr) { |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 73 | NDN_THROW(Error("Validator instance not assigned on the policy")); |
Alexander Afanasyev | 7b11246 | 2018-10-17 11:51:52 -0400 | [diff] [blame] | 74 | } |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 75 | if (m_isConfigured) { |
Alexander Afanasyev | 6aff024 | 2017-08-29 17:14:44 -0400 | [diff] [blame] | 76 | m_shouldBypass = false; |
| 77 | m_dataRules.clear(); |
| 78 | m_interestRules.clear(); |
Alexander Afanasyev | 6aff024 | 2017-08-29 17:14:44 -0400 | [diff] [blame] | 79 | m_validator->resetAnchors(); |
| 80 | m_validator->resetVerifiedCertificates(); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 81 | } |
| 82 | m_isConfigured = true; |
| 83 | |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 84 | for (const auto& subSection : configSection) { |
| 85 | const std::string& sectionName = subSection.first; |
| 86 | const ConfigSection& section = subSection.second; |
| 87 | |
| 88 | if (boost::iequals(sectionName, "rule")) { |
| 89 | auto rule = Rule::create(section, filename); |
| 90 | if (rule->getPktType() == tlv::Data) { |
| 91 | m_dataRules.push_back(std::move(rule)); |
| 92 | } |
| 93 | else if (rule->getPktType() == tlv::Interest) { |
| 94 | m_interestRules.push_back(std::move(rule)); |
| 95 | } |
| 96 | } |
| 97 | else if (boost::iequals(sectionName, "trust-anchor")) { |
| 98 | processConfigTrustAnchor(section, filename); |
| 99 | } |
| 100 | else { |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 101 | NDN_THROW(Error("Error processing configuration file " + filename + |
| 102 | ": unrecognized section " + sectionName)); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | void |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 108 | ValidationPolicyConfig::processConfigTrustAnchor(const ConfigSection& configSection, |
| 109 | const std::string& filename) |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 110 | { |
| 111 | using namespace boost::filesystem; |
| 112 | |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 113 | auto propertyIt = configSection.begin(); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 114 | |
| 115 | // Get trust-anchor.type |
| 116 | if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "type")) { |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 117 | NDN_THROW(Error("Expecting <trust-anchor.type>")); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 118 | } |
| 119 | |
| 120 | std::string type = propertyIt->second.data(); |
| 121 | propertyIt++; |
| 122 | |
| 123 | if (boost::iequals(type, "file")) { |
| 124 | // Get trust-anchor.file |
| 125 | if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "file-name")) { |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 126 | NDN_THROW(Error("Expecting <trust-anchor.file-name>")); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 127 | } |
| 128 | |
| 129 | std::string file = propertyIt->second.data(); |
| 130 | propertyIt++; |
| 131 | |
| 132 | time::nanoseconds refresh = getRefreshPeriod(propertyIt, configSection.end()); |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 133 | if (propertyIt != configSection.end()) |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 134 | NDN_THROW(Error("Expecting end of <trust-anchor>")); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 135 | |
Varun Patil | 574c3f9 | 2020-11-25 09:07:33 +0530 | [diff] [blame] | 136 | m_validator->loadAnchor(file, absolute(file, path(filename).parent_path()).string(), |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 137 | refresh, false); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 138 | } |
| 139 | else if (boost::iequals(type, "base64")) { |
| 140 | // Get trust-anchor.base64-string |
| 141 | if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "base64-string")) |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 142 | NDN_THROW(Error("Expecting <trust-anchor.base64-string>")); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 143 | |
| 144 | std::stringstream ss(propertyIt->second.data()); |
| 145 | propertyIt++; |
| 146 | |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 147 | if (propertyIt != configSection.end()) |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 148 | NDN_THROW(Error("Expecting end of <trust-anchor>")); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 149 | |
| 150 | auto idCert = io::load<Certificate>(ss); |
| 151 | if (idCert != nullptr) { |
| 152 | m_validator->loadAnchor("", std::move(*idCert)); |
| 153 | } |
| 154 | else { |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 155 | NDN_THROW(Error("Cannot decode certificate from base64-string")); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 156 | } |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 157 | } |
| 158 | else if (boost::iequals(type, "dir")) { |
| 159 | if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "dir")) |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 160 | NDN_THROW(Error("Expecting <trust-anchor.dir>")); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 161 | |
| 162 | std::string dirString(propertyIt->second.data()); |
| 163 | propertyIt++; |
| 164 | |
| 165 | time::nanoseconds refresh = getRefreshPeriod(propertyIt, configSection.end()); |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 166 | if (propertyIt != configSection.end()) |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 167 | NDN_THROW(Error("Expecting end of <trust-anchor>")); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 168 | |
| 169 | path dirPath = absolute(dirString, path(filename).parent_path()); |
| 170 | m_validator->loadAnchor(dirString, dirPath.string(), refresh, true); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 171 | } |
| 172 | else if (boost::iequals(type, "any")) { |
| 173 | m_shouldBypass = true; |
| 174 | } |
| 175 | else { |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 176 | NDN_THROW(Error("Unrecognized <trust-anchor.type>: " + type)); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 177 | } |
| 178 | } |
| 179 | |
| 180 | time::nanoseconds |
| 181 | ValidationPolicyConfig::getRefreshPeriod(ConfigSection::const_iterator& it, |
| 182 | const ConfigSection::const_iterator& end) |
| 183 | { |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 184 | auto refresh = time::nanoseconds::max(); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 185 | if (it == end) { |
| 186 | return refresh; |
| 187 | } |
| 188 | |
| 189 | if (!boost::iequals(it->first, "refresh")) { |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 190 | NDN_THROW(Error("Expecting <trust-anchor.refresh>")); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | std::string inputString = it->second.data(); |
| 194 | ++it; |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 195 | char unit = inputString[inputString.size() - 1]; |
| 196 | std::string refreshString = inputString.substr(0, inputString.size() - 1); |
| 197 | |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 198 | int32_t refreshPeriod = -1; |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 199 | try { |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 200 | refreshPeriod = boost::lexical_cast<int32_t>(refreshString); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 201 | } |
| 202 | catch (const boost::bad_lexical_cast&) { |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 203 | // pass |
| 204 | } |
| 205 | if (refreshPeriod < 0) { |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 206 | NDN_THROW(Error("Bad refresh value: " + refreshString)); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 207 | } |
| 208 | |
| 209 | if (refreshPeriod == 0) { |
| 210 | return getDefaultRefreshPeriod(); |
| 211 | } |
| 212 | |
| 213 | switch (unit) { |
| 214 | case 'h': |
Davide Pesavento | 0f83080 | 2018-01-16 23:58:58 -0500 | [diff] [blame] | 215 | return time::hours(refreshPeriod); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 216 | case 'm': |
Davide Pesavento | 0f83080 | 2018-01-16 23:58:58 -0500 | [diff] [blame] | 217 | return time::minutes(refreshPeriod); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 218 | case 's': |
Davide Pesavento | 0f83080 | 2018-01-16 23:58:58 -0500 | [diff] [blame] | 219 | return time::seconds(refreshPeriod); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 220 | default: |
Davide Pesavento | 923ba44 | 2019-02-12 22:00:38 -0500 | [diff] [blame] | 221 | NDN_THROW(Error("Bad refresh time unit: "s + unit)); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 222 | } |
| 223 | } |
| 224 | |
| 225 | time::nanoseconds |
| 226 | ValidationPolicyConfig::getDefaultRefreshPeriod() |
| 227 | { |
Davide Pesavento | 0f83080 | 2018-01-16 23:58:58 -0500 | [diff] [blame] | 228 | return 1_h; |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | void |
| 232 | ValidationPolicyConfig::checkPolicy(const Data& data, const shared_ptr<ValidationState>& state, |
| 233 | const ValidationContinuation& continueValidation) |
| 234 | { |
| 235 | BOOST_ASSERT_MSG(!hasInnerPolicy(), "ValidationPolicyConfig must be a terminal inner policy"); |
| 236 | |
| 237 | if (m_shouldBypass) { |
| 238 | return continueValidation(nullptr, state); |
| 239 | } |
| 240 | |
Davide Pesavento | 2acce25 | 2022-09-08 22:03:03 -0400 | [diff] [blame] | 241 | Name klName = getKeyLocatorName(data.getSignatureInfo(), *state); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 242 | if (!state->getOutcome()) { // already failed |
| 243 | return; |
| 244 | } |
| 245 | |
Davide Pesavento | 2acce25 | 2022-09-08 22:03:03 -0400 | [diff] [blame] | 246 | auto sigType = tlv::SignatureTypeValue(data.getSignatureType()); |
| 247 | |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 248 | for (const auto& rule : m_dataRules) { |
Eric Newberry | 17d7c47 | 2020-06-18 21:29:22 -0700 | [diff] [blame] | 249 | if (rule->match(tlv::Data, data.getName(), state)) { |
Davide Pesavento | 2acce25 | 2022-09-08 22:03:03 -0400 | [diff] [blame] | 250 | if (rule->check(tlv::Data, sigType, data.getName(), klName, state)) { |
Junxiao Shi | b55e5d3 | 2018-07-18 13:32:00 -0600 | [diff] [blame] | 251 | return continueValidation(make_shared<CertificateRequest>(klName), state); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 252 | } |
| 253 | // rule->check calls state->fail(...) if the check fails |
| 254 | return; |
| 255 | } |
| 256 | } |
| 257 | |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 258 | return state->fail({ValidationError::POLICY_ERROR, |
| 259 | "No rule matched for data `" + data.getName().toUri() + "`"}); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 260 | } |
| 261 | |
| 262 | void |
| 263 | ValidationPolicyConfig::checkPolicy(const Interest& interest, const shared_ptr<ValidationState>& state, |
| 264 | const ValidationContinuation& continueValidation) |
| 265 | { |
| 266 | BOOST_ASSERT_MSG(!hasInnerPolicy(), "ValidationPolicyConfig must be a terminal inner policy"); |
| 267 | |
| 268 | if (m_shouldBypass) { |
| 269 | return continueValidation(nullptr, state); |
| 270 | } |
| 271 | |
Davide Pesavento | 2acce25 | 2022-09-08 22:03:03 -0400 | [diff] [blame] | 272 | auto sigInfo = getSignatureInfo(interest, *state); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 273 | if (!state->getOutcome()) { // already failed |
| 274 | return; |
| 275 | } |
| 276 | |
Davide Pesavento | 2acce25 | 2022-09-08 22:03:03 -0400 | [diff] [blame] | 277 | Name klName = getKeyLocatorName(sigInfo, *state); |
| 278 | if (!state->getOutcome()) { // already failed |
| 279 | return; |
| 280 | } |
| 281 | |
| 282 | auto sigType = tlv::SignatureTypeValue(sigInfo.getSignatureType()); |
| 283 | |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 284 | for (const auto& rule : m_interestRules) { |
Eric Newberry | 17d7c47 | 2020-06-18 21:29:22 -0700 | [diff] [blame] | 285 | if (rule->match(tlv::Interest, interest.getName(), state)) { |
Alexander Afanasyev | 17d4b93 | 2021-03-17 17:58:40 -0400 | [diff] [blame] | 286 | if (rule->check(tlv::Interest, sigType, interest.getName(), klName, state)) { |
Junxiao Shi | b55e5d3 | 2018-07-18 13:32:00 -0600 | [diff] [blame] | 287 | return continueValidation(make_shared<CertificateRequest>(klName), state); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 288 | } |
| 289 | // rule->check calls state->fail(...) if the check fails |
| 290 | return; |
| 291 | } |
| 292 | } |
| 293 | |
Davide Pesavento | 5df42a8 | 2018-03-08 20:06:51 -0500 | [diff] [blame] | 294 | return state->fail({ValidationError::POLICY_ERROR, |
| 295 | "No rule matched for interest `" + interest.getName().toUri() + "`"}); |
Alexander Afanasyev | e5a19b8 | 2017-01-30 22:30:46 -0800 | [diff] [blame] | 296 | } |
| 297 | |
Davide Pesavento | 47ce2ee | 2023-05-09 01:33:33 -0400 | [diff] [blame] | 298 | } // namespace ndn::security::validator_config |