Project

General

Profile

Bug #5145

Updated by Junxiao Shi about 3 years ago

[ValidatorConfig specification](https://github.com/named-data/ndn-cxx/blob/b08edd8d3e5a2162a5c86e774e06f3b141f5cd5d/docs/tutorials/security-validator-config.rst#id5) states: 

 > A rule must have at least one **checker** property. 
 > A packet is treated as valid if it can pass at least one of the checkers and as invalid when it cannot pass any checkers. 

 [Rule::check function implementation](https://github.com/named-data/ndn-cxx/blob/b08edd8d3e5a2162a5c86e774e06f3b141f5cd5d/ndn-cxx/security/validator-config/rule.cpp#L87-L93) is: 

 ```cpp 
   for (const auto& checker : m_checkers) { 
     bool result = checker->check(pktType, pktName, klName, state); 
     if (!result) { 
       return result; 
     } 
     hasPendingResult = true; 
   } 
 ``` 

 If a rule has multiple checkers and a packet would pass some but not all checkers: 

 * According to the current specification, the packet should be treated as valid. 
 * According to the current implementation, specification, the packet would be treated as invalid. 

 Either the specification or the implementation must be updated to match the other.

Back