Actions
Bug #3365
closedSigningInfo(std::string) does not set DigestAlgorithm
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:
rm -rf $HOME/.ndn
ndnsec-keygen /my-identity | ndnsec-install-cert -
- 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.
Actions