Project

General

Profile

Actions

Task #4273

closed

Remove unused catch in KeyChain::setDefaultCertificate

Added by Anonymous about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Low
Category:
Security
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

Description

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

But addCertificate never throws Pib::Error because it replaces a certificate if it exists, as stated in the doc comment:
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 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.)

Actions #1

Updated by Davide Pesavento about 7 years ago

  • Category set to Security
  • Status changed from New to Code review
  • Assignee set to Davide Pesavento
  • Start date deleted (09/06/2017)
  • % Done changed from 0 to 100
Actions #2

Updated by Davide Pesavento about 7 years ago

  • Description updated (diff)
Actions #3

Updated by Davide Pesavento about 7 years ago

  • Status changed from Code review to Closed
  • Target version set to v0.6
Actions

Also available in: Atom PDF