security: remove dead code in KeyChain::setDefaultCertificate
Change-Id: Ic38e5337a4d9526863dcb728f96f1c19f036182d
Refs: #4273
diff --git a/src/security/v2/key-chain.cpp b/src/security/v2/key-chain.cpp
index b63287d..9f14402 100644
--- a/src/security/v2/key-chain.cpp
+++ b/src/security/v2/key-chain.cpp
@@ -341,13 +341,7 @@
{
BOOST_ASSERT(static_cast<bool>(key));
- try {
- addCertificate(key, cert);
- }
- catch (const Pib::Error&) { // force to overwrite the existing certificates
- key.removeCertificate(cert.getName());
- addCertificate(key, cert);
- }
+ addCertificate(key, cert);
key.setDefaultCertificate(cert.getName());
}