all: rename Tlv namespace to tlv for consistency
This commit renames the Tlv namespace defined in
tlv.hpp to tlv to be more consistent with tlv::security
and tlv::nfd. A Tlv namespace alias is provided for
backwards compatibility.
Change-Id: I21278d6a077afe7776802c3296997d4c1c44c6c6
diff --git a/src/security/conf/checker.hpp b/src/security/conf/checker.hpp
index 9284191..040d343 100644
--- a/src/security/conf/checker.hpp
+++ b/src/security/conf/checker.hpp
@@ -99,15 +99,15 @@
{
switch (sigType)
{
- case Tlv::SignatureSha256WithRsa:
- case Tlv::SignatureSha256WithEcdsa:
+ case tlv::SignatureSha256WithRsa:
+ case tlv::SignatureSha256WithEcdsa:
{
if (!static_cast<bool>(m_keyLocatorChecker))
throw Error("Strong signature requires KeyLocatorChecker");
return;
}
- case Tlv::DigestSha256:
+ case tlv::DigestSha256:
return;
default:
throw Error("Unsupported signature type");
@@ -139,7 +139,7 @@
onValidationFailed(interest.shared_from_this(), "Invalid signature");
return -1;
}
- catch (Tlv::Error& e)
+ catch (tlv::Error& e)
{
onValidationFailed(interest.shared_from_this(), "Cannot decode signature related TLVs");
return -1;
@@ -163,15 +163,15 @@
return -1;
}
- if (signature.getType() == Tlv::DigestSha256)
+ if (signature.getType() == tlv::DigestSha256)
return 0;
try
{
switch (signature.getType())
{
- case Tlv::SignatureSha256WithRsa:
- case Tlv::SignatureSha256WithEcdsa:
+ case tlv::SignatureSha256WithRsa:
+ case tlv::SignatureSha256WithEcdsa:
{
if (!signature.hasKeyLocator()) {
onValidationFailed(packet.shared_from_this(),
@@ -188,7 +188,7 @@
}
}
}
- catch (Tlv::Error& e)
+ catch (tlv::Error& e)
{
onValidationFailed(packet.shared_from_this(),
"Cannot decode signature");
@@ -241,8 +241,8 @@
it != signers.end(); it++)
m_signers[(*it)->getName().getPrefix(-1)] = (*it);
- if (sigType != Tlv::SignatureSha256WithRsa &&
- sigType != Tlv::SignatureSha256WithEcdsa)
+ if (sigType != tlv::SignatureSha256WithRsa &&
+ sigType != tlv::SignatureSha256WithEcdsa)
{
throw Error("FixedSigner is only meaningful for strong signature type");
}
@@ -274,7 +274,7 @@
onValidationFailed(interest.shared_from_this(), "Invalid signature");
return -1;
}
- catch (Tlv::Error& e)
+ catch (tlv::Error& e)
{
onValidationFailed(interest.shared_from_this(), "Cannot decode signature related TLVs");
return -1;
@@ -298,7 +298,7 @@
return -1;
}
- if (signature.getType() == Tlv::DigestSha256)
+ if (signature.getType() == tlv::DigestSha256)
{
onValidationFailed(packet.shared_from_this(),
"FixedSigner does not allow Sha256 signature type");
@@ -309,8 +309,8 @@
{
switch (signature.getType())
{
- case Tlv::SignatureSha256WithRsa:
- case Tlv::SignatureSha256WithEcdsa:
+ case tlv::SignatureSha256WithRsa:
+ case tlv::SignatureSha256WithEcdsa:
{
if (!signature.hasKeyLocator()) {
onValidationFailed(packet.shared_from_this(),
@@ -356,7 +356,7 @@
"KeyLocator does not have name");
return -1;
}
- catch (Tlv::Error& e)
+ catch (tlv::Error& e)
{
onValidationFailed(packet.shared_from_this(),
"Cannot decode signature");
@@ -546,11 +546,11 @@
getSigType(const std::string& sigType)
{
if (boost::iequals(sigType, "rsa-sha256"))
- return Tlv::SignatureSha256WithRsa;
+ return tlv::SignatureSha256WithRsa;
else if (boost::iequals(sigType, "ecdsa-sha256"))
- return Tlv::SignatureSha256WithEcdsa;
+ return tlv::SignatureSha256WithEcdsa;
else if (boost::iequals(sigType, "sha256"))
- return Tlv::DigestSha256;
+ return tlv::DigestSha256;
else
throw Error("Unsupported signature type");
}