Switch to new KeyChain where possible
signed_interest::POS_RANDOM_VAL and signed_interest::POS_TIMESTAMP
constants are deprecated. Use command_interest:: equivalents instead.
This commit also includes fix for the backward compatibility regression
due to move of deprecated TPM/PublicInfo header files.
Change-Id: Ic3b008fc6758f3ac83f191158b6ac0789483f90d
Refs: #3098
diff --git a/tests/unit-tests/util/io.t.cpp b/tests/unit-tests/util/io.t.cpp
index e4dfa63..20e9412 100644
--- a/tests/unit-tests/util/io.t.cpp
+++ b/tests/unit-tests/util/io.t.cpp
@@ -267,18 +267,14 @@
BOOST_FIXTURE_TEST_CASE(IdCert, IdCertFixture)
{
- Name identity("/TestIo/IdCert");
- identity.appendVersion();
- addIdentity(identity, RsaKeyParams());
- Name certName = m_keyChain.getDefaultCertificateNameForIdentity(identity);
- shared_ptr<security::v1::IdentityCertificate> idCert;
- BOOST_REQUIRE_NO_THROW(idCert = m_keyChain.getCertificate(certName));
+ auto identity = addIdentity("/TestIo/IdCert", RsaKeyParams());
+ const auto& cert = identity.getDefaultKey().getDefaultCertificate();
+ io::save(cert, filename);
- io::save(*idCert, filename);
- shared_ptr<security::v1::IdentityCertificate> readCert = io::load<security::v1::IdentityCertificate>(filename);
+ auto readCert = io::load<security::v2::Certificate>(filename);
BOOST_REQUIRE(readCert != nullptr);
- BOOST_CHECK_EQUAL(idCert->getName(), readCert->getName());
+ BOOST_CHECK_EQUAL(cert.getName(), readCert->getName());
}
BOOST_AUTO_TEST_SUITE_END() // TestIo