[Cryptech-Commits] [sw/libhal] 01/02: None is more Pythonic than "" as indicator for "no key"

git at cryptech.is git at cryptech.is
Sun Jun 11 21:45:32 UTC 2017


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch master
in repository sw/libhal.

commit c6b438e30990b92fe502493a3f3dba5b38b23ee4
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Sun Jun 11 17:44:32 2017 -0400

    None is more Pythonic than "" as indicator for "no key"
---
 cryptech/libhal.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cryptech/libhal.py b/cryptech/libhal.py
index 39fa826..8666d15 100644
--- a/cryptech/libhal.py
+++ b/cryptech/libhal.py
@@ -534,7 +534,9 @@ class HSM(object):
         with self.rpc(RPC_FUNC_HASH_GET_ALGORITHM, handle) as r:
             return HALDigestAlgorithm.index[r.unpack_uint()]
 
-    def hash_initialize(self, alg, key = "", client = 0, session = 0, mixed_mode = None):
+    def hash_initialize(self, alg, key = None, client = 0, session = 0, mixed_mode = None):
+        if key is None:
+            key = ""
         if mixed_mode is None:
             mixed_mode = self.mixed_mode
         if mixed_mode:



More information about the Commits mailing list