Ticket #2329: xpra-1.0.13.fips-md5-sha256.patch
File xpra-1.0.13.fips-md5-sha256.patch, 6.3 KB (added by , 22 months ago) |
---|
-
xpra/client/gtk2/client.py
a b 70 70 color_str = color_str.replace(":off", "") 71 71 if color_str=="auto" or color_str=="": 72 72 try: 73 from hashlib import md5 73 74 try: 74 from hashlib import md575 except ImportError:76 from md5 import md577 m = md5()75 m = md5() 76 except ValueError: 77 from hashlib import sha1 78 m = sha1() 78 79 for x in extra_args: 79 80 m.update(str(x)) 80 81 color_str = "#%s" % m.hexdigest()[:6] -
xpra/client/window_backing_base.py
a b 468 468 l = options.get("z.len") 469 469 if l: 470 470 assert l==len(img_data), "compressed pixel data failed length integrity check: expected %i bytes but got %i" % (l, len(img_data)) 471 md5 = options.get("z.md5") 472 if md5: 473 h = hashlib.md5(img_data) 471 try: 472 chksum = options.get("z.md5") 473 if chksum: 474 h = hashlib.md5(img_data) 475 except ValueError: 476 chksum = options.get("z.sha1") 477 if chksum: 478 h = hashlib.sha1(img_data) 479 if h: 474 480 hd = h.hexdigest() 475 assert md5==hd, "pixel data failed compressed md5 integrity check: expected %s but got %s" % (md5, hd)476 deltalog("passed compressed data integrity checks: len=%s, md5=%s (type=%s)", l, md5, type(img_data))481 assert chksum==hd, "pixel data failed compressed chksum integrity check: expected %s but got %s" % (chksum, hd) 482 deltalog("passed compressed data integrity checks: len=%s, chksum=%s (type=%s)", l, chksum, type(img_data)) 477 483 if coding == "mmap": 478 484 self.idle_add(self.paint_mmap, img_data, x, y, width, height, rowstride, options, callbacks) 479 485 elif coding == "rgb24" or coding == "rgb32": -
xpra/server/auth/file_auth.py
a b 29 29 log.error("Error: authentication failed") 30 30 log.error(" no password for '%s' in '%s'", self.username, self.password_filename) 31 31 return False 32 verify = hmac.HMAC(strtobytes(password), strtobytes(salt), digestmod=hashlib. md5).hexdigest()32 verify = hmac.HMAC(strtobytes(password), strtobytes(salt), digestmod=hashlib.sha256).hexdigest() 33 33 log("authenticate(%s) password='%s', hex(salt)=%s, hash=%s", challenge_response, nonl(password), binascii.hexlify(strtobytes(salt)), verify) 34 34 if hasattr(hmac, "compare_digest"): 35 35 eq = hmac.compare_digest(verify, challenge_response) -
xpra/server/auth/multifile_auth.py
a b 132 132 log.error(" no password for '%s' in '%s'", self.username, self.password_filename) 133 133 return None 134 134 fpassword, uid, gid, displays, env_options, session_options = entry 135 verify = hmac.HMAC(strtobytes(fpassword), strtobytes(salt), digestmod=hashlib. md5).hexdigest()135 verify = hmac.HMAC(strtobytes(fpassword), strtobytes(salt), digestmod=hashlib.sha1).hexdigest() 136 136 log("authenticate(%s) password='%s', hex(salt)=%s, hash=%s", challenge_response, fpassword, binascii.hexlify(strtobytes(salt)), verify) 137 137 if hasattr(hmac, "compare_digest"): 138 138 eq = hmac.compare_digest(verify, challenge_response) -
xpra/server/auth/sys_auth_base.py
a b 115 115 log.error("Error: %s authentication failed", self) 116 116 log.error(" no password defined for '%s'", self.username) 117 117 return False 118 verify = hmac.HMAC(strtobytes(password), strtobytes(salt), digestmod=hashlib. md5).hexdigest()118 verify = hmac.HMAC(strtobytes(password), strtobytes(salt), digestmod=hashlib.sha256).hexdigest() 119 119 log("authenticate(%s) password=%s, hex(salt)=%s, hash=%s", challenge_response, password, hexstr(strtobytes(salt)), verify) 120 120 if hasattr(hmac, "compare_digest"): 121 121 eq = hmac.compare_digest(verify, challenge_response) -
xpra/server/proxy/proxy_instance_process.py
a b 652 652 import hmac, hashlib 653 653 password = strtobytes(password) 654 654 salt = strtobytes(salt) 655 challenge_response = hmac.HMAC(password, salt, digestmod=hashlib. md5).hexdigest()655 challenge_response = hmac.HMAC(password, salt, digestmod=hashlib.sha1).hexdigest() 656 656 log.info("sending %s challenge response", digest) 657 657 self.send_hello(challenge_response, client_salt) 658 658 return -
xpra/server/window/window_source.py
a b 1872 1872 v = data.data 1873 1873 except: 1874 1874 v = data 1875 md5 = hashlib.md5(v).hexdigest() 1876 client_options["z.md5"] = md5 1875 try: 1876 chksum = hashlib.md5(v).hexdigest() 1877 client_options["z.md5"] = chksum 1878 except ValueError: 1879 chksum = hashlib.sha1().hexdigest() 1880 client_options["z.sha1"] = chksum 1877 1881 client_options["z.len"] = len(data) 1878 log("added len and hash of compressed data integrity %19s: %8i / %s", type(v), len(v), md5)1882 log("added len and hash of compressed data integrity %19s: %8i / %s", type(v), len(v), chksum) 1879 1883 #actual network packet: 1880 1884 if self.supports_flush and flush not in (None, 0): 1881 1885 client_options["flush"] = flush