security: change enum to enum class in security-common.hpp
Change-Id: I5565c845cd57f3457c8120b11399a105fa83418d
Refs: #3083
diff --git a/src/security/transform/digest-filter.cpp b/src/security/transform/digest-filter.cpp
index 9fed4d2..c984b8c 100644
--- a/src/security/transform/digest-filter.cpp
+++ b/src/security/transform/digest-filter.cpp
@@ -23,6 +23,8 @@
#include "../../encoding/buffer.hpp"
#include "../detail/openssl-helper.hpp"
+#include <boost/lexical_cast.hpp>
+
namespace ndn {
namespace security {
namespace transform {
@@ -56,13 +58,13 @@
{
const EVP_MD* md = detail::toDigestEvpMd(algo);
if (md == nullptr) {
- // @todo Add digest algorithm to the error message
- BOOST_THROW_EXCEPTION(Error(getIndex(), "Unsupported digest algorithm"));
+ BOOST_THROW_EXCEPTION(Error(getIndex(), "Unsupported digest algorithm " +
+ boost::lexical_cast<std::string>(algo)));
}
if (!BIO_set_md(m_impl->m_md, md)) {
- // @todo Add digest algorithm to the error message
- BOOST_THROW_EXCEPTION(Error(getIndex(), "Cannot set digest"));
+ BOOST_THROW_EXCEPTION(Error(getIndex(), "Cannot set digest"+
+ boost::lexical_cast<std::string>(algo)));
}
}
diff --git a/src/security/transform/digest-filter.hpp b/src/security/transform/digest-filter.hpp
index fdd9c5b..935899f 100644
--- a/src/security/transform/digest-filter.hpp
+++ b/src/security/transform/digest-filter.hpp
@@ -62,7 +62,7 @@
};
unique_ptr<Transform>
-digestFilter(DigestAlgorithm algo = DIGEST_ALGORITHM_SHA256);
+digestFilter(DigestAlgorithm algo = DigestAlgorithm::SHA256);
} // namespace transform
} // namespace security