Project

General

Profile

Task #4273

Updated by Davide Pesavento over 6 years ago

When `KeyChain::setDefaultCertificate` KeyChain::setDefaultCertificate first calls `addCertificate`, addCertificate, it catches `Pib::Error`, Pib::Error, presumably if the certificate already exists.<br> 
 https://github.com/named-data/ndn-cxx/blob/6938e3461bc7b64531403b05d18d492d4713c641/src/security/v2/key-chain.cpp#L346 

 But `addCertificate` addCertificate never throws `Pib::Error` Pib::Error because it replaces a certificate if it exists, as stated in the doc comment:<br> 
 https://github.com/named-data/ndn-cxx/blob/80782e06cd2589d3e3f9926dcdb1a70480eaf7fe/src/security/v2/key-chain.hpp#L205 
 "This method overwrites certificate with the same name, without considering the implicit digest." 

 This is not a bug because `setDefaultCertificate` setDefaultCertificate still works. It just never executes the catch clause, which can be removed. (Feel free to abandon this issue if it doesn't matter to you.)

Back