diff options
author | Simon Warta <[email protected]> | 2017-05-01 16:40:22 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2017-05-04 00:19:47 +0200 |
commit | cf5a80e57362763b035fab1f7dda1294b84a23e0 (patch) | |
tree | eab01ab0e9247f838d05c0c5d52099678f4c8dcd /src | |
parent | e3e4cd7052b4081c792e65b0970d77c34f3c61eb (diff) |
Avoid redefining build-in name "hash"
this breaks applications using a parameter labels, e.g.
pubkey.fingerprint(hash='SHA-512')
Diffstat (limited to 'src')
-rwxr-xr-x | src/python/botan2.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/python/botan2.py b/src/python/botan2.py index 8c7259f4f..1a140a8c9 100755 --- a/src/python/botan2.py +++ b/src/python/botan2.py @@ -384,15 +384,15 @@ class public_key(object): # pylint: disable=invalid-name flag = 1 if pem else 0 return _call_fn_returning_vec(0, lambda b, bl: botan.botan_pubkey_export(self.pubkey, b, bl, flag)) - def fingerprint(self, hash='SHA-256'): + def fingerprint(self, hash_algorithm='SHA-256'): botan.botan_pubkey_fingerprint.argtypes = [c_void_p, c_char_p, POINTER(c_char), POINTER(c_size_t)] - n = hash_function(hash).output_length() + n = hash_function(hash_algorithm).output_length() buf = create_string_buffer(n) buf_len = c_size_t(n) - botan.botan_pubkey_fingerprint(self.pubkey, _ctype_str(hash), buf, byref(buf_len)) + botan.botan_pubkey_fingerprint(self.pubkey, _ctype_str(hash_algorithm), buf, byref(buf_len)) return hex_encode(buf[0:buf_len.value]) class private_key(object): # pylint: disable=invalid-name |