security: Add general interface to chain validation policies
Change-Id: I1a0d47aeb847455a2d7d6d48185f6edd9024d298
Refs: #3920
diff --git a/src/security/v2/validator.cpp b/src/security/v2/validator.cpp
index 6dc1f91..638d12d 100644
--- a/src/security/v2/validator.cpp
+++ b/src/security/v2/validator.cpp
@@ -41,11 +41,24 @@
{
BOOST_ASSERT(m_policy != nullptr);
BOOST_ASSERT(m_certFetcher != nullptr);
+ m_policy->setValidator(*this);
m_certFetcher->setCertificateStorage(*this);
}
Validator::~Validator() = default;
+ValidationPolicy&
+Validator::getPolicy()
+{
+ return *m_policy;
+}
+
+CertificateFetcher&
+Validator::getFetcher()
+{
+ return *m_certFetcher;
+}
+
void
Validator::setMaxDepth(size_t depth)
{