add check of verification for content
Change-Id: If3404c76bb001fb65ebb9a231020bc7a319a0142
diff --git a/ccnx/ccnx-wrapper.cpp b/ccnx/ccnx-wrapper.cpp
index a9f0821..91148de 100644
--- a/ccnx/ccnx-wrapper.cpp
+++ b/ccnx/ccnx-wrapper.cpp
@@ -475,6 +475,8 @@
tuple<Closure *, ExecutorPtr, Selectors> *realData = reinterpret_cast< tuple<Closure*, ExecutorPtr, Selectors>* > (selfp->data);
tie (cp, executor, selectors) = *realData;
+ bool verified = false;
+
switch (kind)
{
case CCN_UPCALL_FINAL: // effecitve in unit tests
@@ -486,6 +488,7 @@
return CCN_UPCALL_RESULT_OK;
case CCN_UPCALL_CONTENT:
+ verified = true;
_LOG_TRACE (">> incomingData content upcall: " << Name (info->content_ccnb, info->content_comps));
break;
@@ -512,7 +515,7 @@
return CCN_UPCALL_RESULT_OK;
}
- PcoPtr pco = make_shared<ParsedContentObject> (info->content_ccnb, info->pco->offset[CCN_PCO_E]);
+ PcoPtr pco = make_shared<ParsedContentObject> (info->content_ccnb, info->pco->offset[CCN_PCO_E], verified);
// this will be run in executor
executor->execute (bind (&Closure::runDataCallback, cp, pco->name (), pco));
@@ -694,4 +697,12 @@
return Name(retval);
}
+bool
+CcnxWrapper::verifyPco(PcoPtr &pco)
+{
+ bool verified = ccn_verify_content(m_handle, pco->msg(), (ccn_parsed_ContentObject *)pco->pco());
+ pco->setVerified(verified);
+ return verified;
+}
+
}