Project

General

Profile

Actions

Bug #4390

closed

Documentation error in ValidationPolicy::checkPolicy

Added by Anonymous over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Security
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

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

Actions

Also available in: Atom PDF