BIND 10 trac781, updated. 231b29911894b0f5ddbd0d1444d9dfdf9cb5abb3 [trac781] some mostly editorial cleanups: remove redudant whites, catch exception by reference, indentation fixes.
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Apr 15 09:34:04 UTC 2011
The branch, trac781 has been updated
via 231b29911894b0f5ddbd0d1444d9dfdf9cb5abb3 (commit)
from 4d55533790df1992aee5c088d4f91593d055c080 (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 231b29911894b0f5ddbd0d1444d9dfdf9cb5abb3
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Fri Apr 15 02:33:26 2011 -0700
[trac781] some mostly editorial cleanups: remove redudant whites, catch
exception by reference, indentation fixes.
-----------------------------------------------------------------------
Summary of changes:
src/lib/crypto/crypto.cc | 17 +++++++++--------
src/lib/crypto/crypto.h | 2 +-
src/lib/dns/tsigkey.cc | 2 +-
3 files changed, 11 insertions(+), 10 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/crypto/crypto.cc b/src/lib/crypto/crypto.cc
index 1e5cecb..214eddf 100644
--- a/src/lib/crypto/crypto.cc
+++ b/src/lib/crypto/crypto.cc
@@ -33,13 +33,14 @@ using namespace std;
using namespace isc::dns;
namespace {
-Botan::HashFunction* getHash(const Name& hash_name) {
+Botan::HashFunction*
+getHash(const Name& hash_name) {
if (hash_name == TSIGKey::HMACMD5_NAME()) {
- return Botan::get_hash("MD5");
+ return (Botan::get_hash("MD5"));
} else if (hash_name == TSIGKey::HMACSHA1_NAME()) {
- return Botan::get_hash("SHA-1");
+ return (Botan::get_hash("SHA-1"));
} else if (hash_name == TSIGKey::HMACSHA256_NAME()) {
- return Botan::get_hash("SHA-256");
+ return (Botan::get_hash("SHA-256"));
} else {
isc_throw(isc::crypto::UnsupportedAlgorithm,
"Unknown Hash type " + hash_name.toText());
@@ -73,9 +74,9 @@ public:
hmac_->set_key(hashed_key.begin(), hashed_key.size());
} else {
hmac_->set_key(static_cast<const Botan::byte*>(key.getSecret()),
- key.getSecretLength());
+ key.getSecretLength());
}
- } catch (Botan::Invalid_Key_Length ikl) {
+ } catch (const Botan::Invalid_Key_Length& ikl) {
isc_throw(BadKey, ikl.what());
}
}
@@ -90,11 +91,11 @@ public:
void sign(isc::dns::OutputBuffer& result) const {
// And generate the mac
Botan::SecureVector<Botan::byte> b_result(hmac_->final());
-
+
// write mac to result
result.writeData(b_result.begin(), b_result.size());
}
-
+
bool verify(const void* sig, const size_t len) const {
return (hmac_->verify_mac(static_cast<const Botan::byte*>(sig), len));
}
diff --git a/src/lib/crypto/crypto.h b/src/lib/crypto/crypto.h
index 8597c23..3f32615 100644
--- a/src/lib/crypto/crypto.h
+++ b/src/lib/crypto/crypto.h
@@ -66,7 +66,7 @@ public:
/// Notes: if the key is longer than the block size of its
/// algorithm, the constructor will run it through the hash
/// algorithm, and use the digest as a key for this HMAC operation
- ///
+ ///
/// \param key The key to use
explicit HMAC(const isc::dns::TSIGKey& key);
diff --git a/src/lib/dns/tsigkey.cc b/src/lib/dns/tsigkey.cc
index 550c2a2..d35fde3 100644
--- a/src/lib/dns/tsigkey.cc
+++ b/src/lib/dns/tsigkey.cc
@@ -99,7 +99,7 @@ TSIGKey::TSIGKey(const std::string& str) : impl_(NULL) {
impl_ = new TSIGKeyImpl(key_name, algo_name, secret_b,
secret.size());
- } catch (Exception e) {
+ } catch (const Exception& e) {
// 'reduce' the several types of exceptions name parsing and
// Base64 decoding can throw to just the InvalidParameter
isc_throw(InvalidParameter, e.what());
More information about the bind10-changes
mailing list