PY3: md5 related functions need to be passed bytes
authorNoel Power <noel.power@suse.com>
Tue, 31 Jul 2018 16:02:54 +0000 (17:02 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 26 Sep 2018 23:54:27 +0000 (01:54 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_utils.py

index fd61b8425d8d347e343459e8cdd89ba773f4801b..b4da3c5246f276c89f11b423d5e5d8422283d73b 100644 (file)
@@ -358,13 +358,13 @@ try:
     # Even if hashlib.md5 exists, it may be unusable.
     # Try to use MD5 function. In FIPS mode this will cause an exception
     # and we'll get to the replacement code
-    foo = md5('abcd')
+    foo = md5(b'abcd')
 except:
     try:
         import md5
         # repeat the same check here, mere success of import is not enough.
         # Try to use MD5 function. In FIPS mode this will cause an exception
-        foo = md5.md5('abcd')
+        foo = md5.md5(b'abcd')
     except:
         Context.SIG_NIL = hash('abcd')
         class replace_md5(object):