BIND 10 trac782, updated. 75340e4d2906762ecd088180087c9229a253e4ed [trac782] Add more hash algorithm to tsigkey python binding and related unit test
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri May 13 01:37:19 UTC 2011
The branch, trac782 has been updated
via 75340e4d2906762ecd088180087c9229a253e4ed (commit)
from a1420dabc6ace739cb21044184654717a32604a5 (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 75340e4d2906762ecd088180087c9229a253e4ed
Author: feng <hanfeng at cnnic.cn>
Date: Fri May 13 09:37:04 2011 +0800
[trac782] Add more hash algorithm to tsigkey python binding and related unit test
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/python/tests/tsigkey_python_test.py | 3 +++
src/lib/dns/python/tsigkey_python.cc | 13 +++++++++++++
src/lib/dns/tsigkey.h | 3 +++
3 files changed, 19 insertions(+), 0 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/python/tests/tsigkey_python_test.py b/src/lib/dns/python/tests/tsigkey_python_test.py
index 97be501..72a1e01 100644
--- a/src/lib/dns/python/tests/tsigkey_python_test.py
+++ b/src/lib/dns/python/tests/tsigkey_python_test.py
@@ -25,6 +25,9 @@ class TSIGKeyTest(unittest.TestCase):
TSIGKey.HMACMD5_NAME)
self.assertEqual(Name('hmac-sha1'), TSIGKey.HMACSHA1_NAME)
self.assertEqual(Name('hmac-sha256'), TSIGKey.HMACSHA256_NAME)
+ self.assertEqual(Name('hmac-sha224'), TSIGKey.HMACSHA224_NAME)
+ self.assertEqual(Name('hmac-sha384'), TSIGKey.HMACSHA384_NAME)
+ self.assertEqual(Name('hmac-sha512'), TSIGKey.HMACSHA512_NAME)
def test_init(self):
key = TSIGKey(self.key_name, TSIGKey.HMACMD5_NAME, self.secret)
diff --git a/src/lib/dns/python/tsigkey_python.cc b/src/lib/dns/python/tsigkey_python.cc
index 906dfc0..ee2a2e4 100644
--- a/src/lib/dns/python/tsigkey_python.cc
+++ b/src/lib/dns/python/tsigkey_python.cc
@@ -244,6 +244,19 @@ initModulePart_TSIGKey(PyObject* mod) {
goto cleanup;
}
addClassVariable(tsigkey_type, "HMACSHA256_NAME", name);
+ if ((name = createNameObject(TSIGKey::HMACSHA224_NAME())) == NULL) {
+ goto cleanup;
+ }
+ addClassVariable(tsigkey_type, "HMACSHA224_NAME", name);
+ if ((name = createNameObject(TSIGKey::HMACSHA384_NAME())) == NULL) {
+ goto cleanup;
+ }
+ addClassVariable(tsigkey_type, "HMACSHA384_NAME", name);
+ if ((name = createNameObject(TSIGKey::HMACSHA512_NAME())) == NULL) {
+ goto cleanup;
+ }
+ addClassVariable(tsigkey_type, "HMACSHA512_NAME", name);
+
return (true);
diff --git a/src/lib/dns/tsigkey.h b/src/lib/dns/tsigkey.h
index 02dd423..e29e549 100644
--- a/src/lib/dns/tsigkey.h
+++ b/src/lib/dns/tsigkey.h
@@ -185,6 +185,9 @@ public:
static const Name& HMACMD5_NAME(); ///< HMAC-MD5 (RFC2845)
static const Name& HMACSHA1_NAME(); ///< HMAC-SHA1 (RFC4635)
static const Name& HMACSHA256_NAME(); ///< HMAC-SHA256 (RFC4635)
+ static const Name& HMACSHA224_NAME(); ///< HMAC-SHA256 (RFC4635)
+ static const Name& HMACSHA384_NAME(); ///< HMAC-SHA256 (RFC4635)
+ static const Name& HMACSHA512_NAME(); ///< HMAC-SHA256 (RFC4635)
//@}
private:
More information about the bind10-changes
mailing list