Skip to content

Commit

Permalink
Fix build with latest ndn-cxx
Browse files Browse the repository at this point in the history
Change-Id: I016e054fcb80ef30c27dbf8d77085c38a748dfe1
  • Loading branch information
Pesa committed Jan 26, 2024
1 parent fad1264 commit af4e4e7
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/access-manager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California
* Copyright (c) 2014-2024, Regents of the University of California
*
* NAC library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -46,7 +46,7 @@ AccessManager::AccessManager(const Identity& identity, const Name& dataset,

auto kekPrefix = Name(m_nacKey.getIdentity()).append(KEK);

auto kek = make_shared<Data>(m_nacKey.getDefaultCertificate());
auto kek = std::make_shared<Data>(m_nacKey.getDefaultCertificate());
kek->setName(Name(kekPrefix).append(nacKeyId));
kek->setFreshnessPeriod(DEFAULT_KEK_FRESHNESS_PERIOD);
m_keyChain.sign(*kek, signingByIdentity(m_identity));
Expand Down Expand Up @@ -106,7 +106,7 @@ AccessManager::addMember(const Certificate& memberCert)
content.setPayload(kdkData->wireEncode());
content.setPayloadKey(memberKey.encrypt({secret, secretLength}));

auto kdk = make_shared<Data>(kdkName);
auto kdk = std::make_shared<Data>(kdkName);
kdk->setContent(content.wireEncode());
// FreshnessPeriod can serve as a soft access control for revoking access
kdk->setFreshnessPeriod(DEFAULT_KDK_FRESHNESS_PERIOD);
Expand Down
6 changes: 3 additions & 3 deletions src/encryptor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2023, Regents of the University of California
* Copyright (c) 2014-2024, Regents of the University of California
*
* NAC library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -117,7 +117,7 @@ EncryptedContent
Encryptor::encrypt(span<const uint8_t> data)
{
// Generate IV
auto iv = make_shared<Buffer>(AES_IV_SIZE);
auto iv = std::make_shared<Buffer>(AES_IV_SIZE);
random::generateSecureBytes(*iv);

OBufferStream os;
Expand Down Expand Up @@ -192,7 +192,7 @@ Encryptor::makeAndPublishCkData(const ErrorCallback& onFailure)
EncryptedContent content;
content.setPayload(kek.encrypt(m_ckBits));

auto ckData = make_shared<Data>(Name(m_ckName).append(ENCRYPTED_BY).append(m_kek->getName()));
auto ckData = std::make_shared<Data>(Name(m_ckName).append(ENCRYPTED_BY).append(m_kek->getName()));
ckData->setContent(content.wireEncode());
// FreshnessPeriod can serve as a soft access control for revoking access
ckData->setFreshnessPeriod(DEFAULT_CK_FRESHNESS_PERIOD);
Expand Down
6 changes: 3 additions & 3 deletions tests/clock-fixture.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California
* Copyright (c) 2014-2024, Regents of the University of California
*
* NAC library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand All @@ -22,8 +22,8 @@
namespace ndn::nac::tests {

ClockFixture::ClockFixture()
: m_steadyClock(make_shared<time::UnitTestSteadyClock>())
, m_systemClock(make_shared<time::UnitTestSystemClock>())
: m_steadyClock(std::make_shared<time::UnitTestSteadyClock>())
, m_systemClock(std::make_shared<time::UnitTestSystemClock>())
{
time::setCustomClocks(m_steadyClock, m_systemClock);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/clock-fixture.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California
* Copyright (c) 2014-2024, Regents of the University of California
*
* NAC library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -73,8 +73,8 @@ class ClockFixture
}

protected:
shared_ptr<time::UnitTestSteadyClock> m_steadyClock;
shared_ptr<time::UnitTestSystemClock> m_systemClock;
std::shared_ptr<time::UnitTestSteadyClock> m_steadyClock;
std::shared_ptr<time::UnitTestSystemClock> m_systemClock;
};

} // namespace ndn::nac::tests
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/decryptor.t.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2023, Regents of the University of California
* Copyright (c) 2014-2024, Regents of the University of California
*
* NAC library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -41,10 +41,10 @@ class DecryptorStaticDataEnvironment : public IoKeyChainFixture
{
StaticData data;
for (const auto& block : data.managerPackets) {
m_ims.insert(*make_shared<Data>(block));
m_ims.insert(*std::make_shared<Data>(block));
}
for (const auto& block : data.encryptorPackets) {
m_ims.insert(*make_shared<Data>(block));
m_ims.insert(*std::make_shared<Data>(block));
}

auto serveFromIms = [this] (const Name&, const Interest& interest) {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/encrypted-content.t.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2023, Regents of the University of California
* Copyright (c) 2014-2024, Regents of the University of California
*
* This file is part of NAC (Name-Based Access Control for NDN).
* See AUTHORS.md for complete list of NAC authors and contributors.
Expand Down Expand Up @@ -35,7 +35,7 @@ class EncryptedContentFixture
public:
EncryptedContent content;
Block randomBlock = "01 03 000000"_block;
ConstBufferPtr randomBuffer = make_shared<const Buffer>(10);
ConstBufferPtr randomBuffer = std::make_shared<const Buffer>(10);
};

BOOST_FIXTURE_TEST_SUITE(TestEncryptedContent, EncryptedContentFixture)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/encryptor.t.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2023, Regents of the University of California
* Copyright (c) 2014-2024, Regents of the University of California
*
* NAC library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -59,7 +59,7 @@ class EncryptorStaticDataEnvironment : public IoKeyChainFixture
{
StaticData data;
for (const auto& block : data.managerPackets) {
m_ims.insert(*make_shared<Data>(block));
m_ims.insert(*std::make_shared<Data>(block));
}
advanceClocks(1_ms, 10);
}
Expand Down

0 comments on commit af4e4e7

Please sign in to comment.