Project

General

Profile

Actions

Bug #3365

closed

SigningInfo(std::string) does not set DigestAlgorithm

Added by Junxiao Shi over 8 years ago. Updated over 8 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 #1

Updated by Junxiao Shi over 8 years ago

  • Blocked by Feature #3281: Represent SigningInfo as string added
Actions #2

Updated by Junxiao Shi over 8 years ago

  • Assignee set to Spencer Lee

This is assigned to Spencer, author of SigningInfo(const std::string&) constructor.

Actions #3

Updated by Spencer Lee over 8 years ago

  • Status changed from New to Code review
Actions #4

Updated by Alex Afanasyev over 8 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF