PY3: md5 related functions need to be passed bytes
[gd/samba-autobuild/.git] / 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):