Project

General

Profile

Actions

Bug #3365

closed

SigningInfo(std::string) does not set DigestAlgorithm

Added by Junxiao Shi almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Security
Target version:
Start date:
12/20/2015
Due date:
% Done:

0%

Estimated time:
1.50 h

Description

Snippet to reproduce:

// g++ -o x -std=c++0x x.cpp $(pkg-config --cflags --libs libndn-cxx)
#include <ndn-cxx/data.hpp>
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/security/signing-info.hpp>
#include <ndn-cxx/security/signing-helpers.hpp>

int
main(int argc, char** argv)
{
  ndn::security::SigningInfo si("id:/my-identity");
  // auto si = ndn::security::signingByIdentity("ndn:/my-identity");
  auto data = std::make_shared<ndn::Data>("ndn:/my-data");
  ndn::KeyChain keyChain;
  keyChain.sign(*data, si);
  return 0;
}

Steps to reproduce:

  1. rm -rf $HOME/.ndn
  2. ndnsec-keygen /my-identity | ndnsec-install-cert -
  3. execute the snippet

Expected: no error

Actual: ndn::SecTpmFile::Error "Unsupported digest algorithm"

If SigningInfo is constructed with ndn::security::signingByIdentity instead of SigningInfo(const std::string&) constructor, there's no error.

Root cause: SigningInfo(const std::string&) does not set m_digestAlgorithm in the same way as the other constructor.


Related issues 1 (0 open1 closed)

Blocked by ndn-cxx - Feature #3281: Represent SigningInfo as stringClosedSpencer Lee

Actions
Actions

Also available in: Atom PDF