tests: use NullSignature

Change-Id: Icb8ff95905cfa2ba9d9a493d7a60b30a61a8d671
This commit is contained in:
Davide Pesavento
2020-10-02 20:00:03 -04:00
parent c1d4837b6f
commit b7e72c3a0a
5 changed files with 48 additions and 47 deletions
+4 -7
View File
@@ -25,8 +25,6 @@
#include "tests/test-common.hpp"
#include <ndn-cxx/security/signature-sha256-with-rsa.hpp>
namespace nfd {
namespace tests {
@@ -34,7 +32,7 @@ shared_ptr<Interest>
makeInterest(const Name& name, bool canBePrefix, optional<time::milliseconds> lifetime,
optional<Interest::Nonce> nonce)
{
auto interest = make_shared<Interest>(name);
auto interest = std::make_shared<Interest>(name);
interest->setCanBePrefix(canBePrefix);
if (lifetime) {
interest->setInterestLifetime(*lifetime);
@@ -46,16 +44,15 @@ makeInterest(const Name& name, bool canBePrefix, optional<time::milliseconds> li
shared_ptr<Data>
makeData(const Name& name)
{
auto data = make_shared<Data>(name);
auto data = std::make_shared<Data>(name);
return signData(data);
}
Data&
signData(Data& data)
{
ndn::SignatureSha256WithRsa fakeSignature;
fakeSignature.setValue(ndn::encoding::makeEmptyBlock(tlv::SignatureValue));
data.setSignature(fakeSignature);
data.setSignatureInfo(ndn::SignatureInfo(tlv::NullSignature));
data.setSignatureValue(std::make_shared<ndn::Buffer>());
data.wireEncode();
return data;
}