security: Consistent exception handling.
Change-Id: Ia29963e96028e591e9c4fc4a68a472f794b17e52
diff --git a/tests/security/test-signed-interest.cpp b/tests/security/test-signed-interest.cpp
index 80f55a4..3adb0a4 100644
--- a/tests/security/test-signed-interest.cpp
+++ b/tests/security/test-signed-interest.cpp
@@ -21,24 +21,25 @@
{
KeyChainImpl<SecPublicInfoSqlite3, SecTpmFile> keyChain;
- Name identityName("/TestSignedInterest/SignVerify");
+ Name identityName("/TestSignedInterest/SignVerify/" + boost::lexical_cast<string>(time::now()));
Name certificateName;
BOOST_REQUIRE_NO_THROW(certificateName = keyChain.createIdentity(identityName));
Interest interest("/TestSignedInterest/SignVerify/Interest1");
- keyChain.signByIdentity(interest, identityName);
+ BOOST_CHECK_NO_THROW(keyChain.signByIdentity(interest, identityName));
Block interestBlock(interest.wireEncode().wire(), interest.wireEncode().size());
Interest interest2;
interest2.wireDecode(interestBlock);
- shared_ptr<PublicKey> publicKey = keyChain.getPublicKeyFromTpm(keyChain.getDefaultKeyNameForIdentity(identityName));
+ shared_ptr<PublicKey> publicKey;
+ BOOST_REQUIRE_NO_THROW(publicKey = keyChain.getPublicKeyFromTpm(keyChain.getDefaultKeyNameForIdentity(identityName)));
bool result = Validator::verifySignature(interest2, *publicKey);
BOOST_CHECK_EQUAL(result, true);
- BOOST_CHECK_NO_THROW(keyChain.deleteIdentity(identityName));
+ keyChain.deleteIdentity(identityName);
}
class CommandInterestFixture