security: various enhancements to Interest and Data validation
* Avoid decoding SignatureInfo multiple times while validating an Interest
* Fix handling of signed Interests with malformed InterestSignatureInfo
* Report a NO_SIGNATURE error when SignatureInfo is missing or malformed
* Fail with POLICY_ERROR in ValidationPolicySimpleHierarchy when the
signing identity violates the policy
* Reduce code duplication
* Expand unit test coverage
Change-Id: I1c9d532b2307d5df8f4bd75152af57a4e10835aa
diff --git a/tests/unit/security/validator-fixture.hpp b/tests/unit/security/validator-fixture.hpp
index b225c53..d8d357f 100644
--- a/tests/unit/security/validator-fixture.hpp
+++ b/tests/unit/security/validator-fixture.hpp
@@ -44,13 +44,11 @@
void
mockNetworkOperations();
- /** \brief undo clock advancement of mockNetworkOperations()
+ /**
+ * @brief Undo clock advancement of mockNetworkOperations()
*/
void
- rewindClockAfterValidation()
- {
- m_systemClock->advance(s_mockPeriod * s_mockTimes * -1);
- }
+ rewindClockAfterValidation();
/**
* @brief Issues a certificate for @p subIdentityName signed by @p issuer
@@ -71,8 +69,8 @@
ValidationError lastError{ValidationError::NO_ERROR};
private:
- const static time::milliseconds s_mockPeriod;
- const static int s_mockTimes;
+ static const time::milliseconds s_mockPeriod;
+ static const int s_mockTimes;
};
template<class ValidationPolicyT, class CertificateFetcherT = CertificateFetcherFromNetwork>
@@ -93,6 +91,7 @@
size_t nCallbacks = 0;
this->validator.validate(packet,
[&] (const Packet&) {
+ lastError = ValidationError::NO_ERROR;
++nCallbacks;
BOOST_CHECK_MESSAGE(expectSuccess,
(expectSuccess ? "OK: " : "FAILED: ") + detailedInfo);