BIND 10 trac781, updated. fb7877b06ba873d4fb222409dd92b4701ae11ffb [trac781] minor editorial cleanup (basically along with the style guideline) and constify one thing

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Apr 20 18:27:01 UTC 2011


The branch, trac781 has been updated
       via  fb7877b06ba873d4fb222409dd92b4701ae11ffb (commit)
      from  246e56b3bb7792789b3aa891e21e580976d9e7be (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fb7877b06ba873d4fb222409dd92b4701ae11ffb
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed Apr 20 11:26:09 2011 -0700

    [trac781] minor editorial cleanup (basically along with the style guideline)
    and constify one thing

-----------------------------------------------------------------------

Summary of changes:
 src/lib/cryptolink/crypto.cc                 |   13 +++++++------
 src/lib/cryptolink/crypto.h                  |    2 +-
 src/lib/cryptolink/crypto_hmac.cc            |    2 +-
 src/lib/cryptolink/tests/crypto_unittests.cc |   13 ++++++-------
 4 files changed, 15 insertions(+), 15 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/cryptolink/crypto.cc b/src/lib/cryptolink/crypto.cc
index 64969e5..8cc8d00 100644
--- a/src/lib/cryptolink/crypto.cc
+++ b/src/lib/cryptolink/crypto.cc
@@ -39,7 +39,7 @@ namespace cryptolink {
 // For Botan, we use the CryptoLink class object in RAII style
 class CryptoLinkImpl {
 private:
-    Botan::LibraryInitializer _botan_init;
+    Botan::LibraryInitializer botan_init_;
 };
 
 CryptoLink::~CryptoLink() {
@@ -48,11 +48,11 @@ CryptoLink::~CryptoLink() {
 
 CryptoLink&
 CryptoLink::getCryptoLink() {
-    CryptoLink &c = getCryptoLinkInternal();
-    if (!c.impl_) {
+    CryptoLink& c = getCryptoLinkInternal();
+    if (c.impl_ == NULL) {
         c.initialize();
     }
-    return c;
+    return (c);
 }
 
 CryptoLink&
@@ -64,7 +64,7 @@ CryptoLink::getCryptoLinkInternal() {
 void
 CryptoLink::initialize() {
     CryptoLink& c = getCryptoLinkInternal();
-    if (!c.impl_) {
+    if (c.impl_ == NULL) {
         try {
             c.impl_ = new CryptoLinkImpl();
         } catch (const Botan::Exception& ex) {
@@ -75,7 +75,8 @@ CryptoLink::initialize() {
 
 HMAC*
 CryptoLink::createHMAC(const void* secret, size_t secret_len,
-                   const HMAC::HashAlgorithm hash_algorithm) {
+                       const HMAC::HashAlgorithm hash_algorithm)
+{
     return (new HMAC(secret, secret_len, hash_algorithm));
 }
 
diff --git a/src/lib/cryptolink/crypto.h b/src/lib/cryptolink/crypto.h
index 208d37a..eaeb300 100644
--- a/src/lib/cryptolink/crypto.h
+++ b/src/lib/cryptolink/crypto.h
@@ -153,7 +153,7 @@ private:
 
     // To prevent people constructing their own, we make the constructor
     // private too.
-    CryptoLink() : impl_(NULL) {};
+    CryptoLink() : impl_(NULL) {}
     ~CryptoLink();
 
     CryptoLinkImpl* impl_;
diff --git a/src/lib/cryptolink/crypto_hmac.cc b/src/lib/cryptolink/crypto_hmac.cc
index dea8571..48f3c35 100644
--- a/src/lib/cryptolink/crypto_hmac.cc
+++ b/src/lib/cryptolink/crypto_hmac.cc
@@ -89,7 +89,7 @@ public:
     void sign(isc::dns::OutputBuffer& result, size_t len) {
         try {
             Botan::SecureVector<Botan::byte> b_result(hmac_->final());
-    
+
             if (len == 0 || len > b_result.size()) {
                 len = b_result.size();
             }
diff --git a/src/lib/cryptolink/tests/crypto_unittests.cc b/src/lib/cryptolink/tests/crypto_unittests.cc
index 9b2a6af..e4c3693 100644
--- a/src/lib/cryptolink/tests/crypto_unittests.cc
+++ b/src/lib/cryptolink/tests/crypto_unittests.cc
@@ -107,7 +107,7 @@ namespace {
         // whether verification fails then
         hmac_sig.writeUint8At(~hmac_sig[0], 0);
         EXPECT_FALSE(hmac_verify->verify(hmac_sig.getData(),
-                                        hmac_sig.getLength()));
+                                         hmac_sig.getLength()));
     }
 
     void doHMACTestVector(const std::string& data,
@@ -428,7 +428,7 @@ namespace {
             CryptoLink::getCryptoLink().createHMAC("asdf", 4, alg));
         hmac_sign->update("asdf", 4);
         const std::vector<uint8_t> sig = hmac_sign->sign(len);
-        return sig.size();
+        return (sig.size());
     }
 
     size_t
@@ -438,12 +438,11 @@ namespace {
         hmac_sign->update("asdf", 4);
         OutputBuffer sig(0);
         hmac_sign->sign(sig, len);
-        return sig.getLength();
+        return (sig.getLength());
     }
 }
 
-TEST(CryptoLinkTest, HMACSigLengthArgument)
-{
+TEST(CryptoLinkTest, HMACSigLengthArgument) {
     std::vector<uint8_t> sig;
 
     EXPECT_EQ(16, sigVectorLength(HMAC::MD5, 0));
@@ -507,7 +506,7 @@ TEST(CryptoLinkTest, BadKey) {
 }
 
 TEST(CryptoLinkTest, Singleton) {
-    CryptoLink& c1 = CryptoLink::getCryptoLink();
-    CryptoLink& c2 = CryptoLink::getCryptoLink();
+    const CryptoLink& c1 = CryptoLink::getCryptoLink();
+    const CryptoLink& c2 = CryptoLink::getCryptoLink();
     ASSERT_EQ(&c1, &c2);
 }




More information about the bind10-changes mailing list