Bug #4390
closedDocumentation error in ValidationPolicy::checkPolicy
100%
Description
The documentation for the call to continueValidation in ValidationPolicy::checkPolicy says:
https://github.com/named-data/ndn-cxx/blob/e5a19b8d8631c3b2b8a9bd28502d08cad61f743a/src/security/v2/validation-policy.hpp#L100
* - If packet conforms to the policy and no further key retrievals are necessary,
* the policy should call continueValidation(state, nullptr)
* - If packet conforms to the policy and a key needs to be fetched, the policy should call
* continueValidation(state, <appropriate-key-request-instance>)
But in ValidationContinuation, the request argument comes first:
https://github.com/named-data/ndn-cxx/blob/e5a19b8d8631c3b2b8a9bd28502d08cad61f743a/src/security/v2/validation-policy.hpp#L40
using ValidationContinuation = std::function<void(const shared_ptr<CertificateRequest>& certRequest,
const shared_ptr<ValidationState>& state)>;
Therefore the documentation for the call to continueValidation should reverse the arguments:
* - If packet conforms to the policy and no further key retrievals are necessary,
* the policy should call continueValidation(nullptr, state)
* - If packet conforms to the policy and a key needs to be fetched, the policy should call
* continueValidation(<appropriate-key-request-instance>, state)
The same should be fixed in the documentation for checkPolicy(Interest) and checkPolicy(Certificate).
https://github.com/named-data/ndn-cxx/blob/e5a19b8d8631c3b2b8a9bd28502d08cad61f743a/src/security/v2/validation-policy.hpp#L118
https://github.com/named-data/ndn-cxx/blob/e5a19b8d8631c3b2b8a9bd28502d08cad61f743a/src/security/v2/validation-policy.hpp#L138