src: Improving consistency and correcting code style
As of this commit, all data structures can be directly constructed from
wire format.
This commit excludes full correction of code style in security/ and
tools/ndnsec*, which will be part of a different commit.
Change-Id: I121ac1f81948bc7468990df52cdefeb2988d91a1
Refs: #1403
diff --git a/src/security/sec-rule-specific.cpp b/src/security/sec-rule-specific.cpp
index 484a08e..a9fee4e 100644
--- a/src/security/sec-rule-specific.cpp
+++ b/src/security/sec-rule-specific.cpp
@@ -27,34 +27,36 @@
, m_signerRegex(rule.m_signerRegex)
{}
-bool
+bool
SecRuleSpecific::matchDataName(const Data& data)
{ return m_dataRegex->match(data.getName()); }
-bool
+bool
SecRuleSpecific::matchSignerName(const Data& data)
-{
- try{
+{
+ try {
SignatureSha256WithRsa sig(data.getSignature());
Name signerName = sig.getKeyLocator().getName ();
- return m_signerRegex->match(signerName);
- }catch(SignatureSha256WithRsa::Error &e){
+ return m_signerRegex->match(signerName);
+ }
+ catch (SignatureSha256WithRsa::Error& e) {
return false;
- }catch(KeyLocator::Error &e){
+ }
+ catch (KeyLocator::Error& e) {
return false;
}
}
bool
-SecRuleSpecific::satisfy(const Data & data)
-{
- return (matchDataName(data) && matchSignerName(data)) ? true : false ;
+SecRuleSpecific::satisfy(const Data& data)
+{
+ return (matchDataName(data) && matchSignerName(data)) ? true : false;
}
bool
-SecRuleSpecific::satisfy(const Name & dataName, const Name & signerName)
-{
- return (m_dataRegex->match(dataName) && m_signerRegex->match(signerName));
+SecRuleSpecific::satisfy(const Name& dataName, const Name& signerName)
+{
+ return (m_dataRegex->match(dataName) && m_signerRegex->match(signerName));
}
} // namespace ndn