Ticket #2329: xpra-2.5.2.fips-md5-sha256.patch
File xpra-2.5.2.fips-md5-sha256.patch, 4.8 KB (added by , 22 months ago) |
---|
-
unittests/unit/net/HMAC_test.py
a b 13 13 def test_hardcoded(self): 14 14 password = b"71051d81d27745b59c1c56c6e9046c19697e452453e04aa5abbd52c8edc8c232" 15 15 salt = b"99ea464f-7117-4e38-95b3-d3aa80e7b806" 16 hmac_hash = hmac.HMAC(password, salt, digestmod=hashlib.md5) 17 hd = hmac_hash.hexdigest() 18 ed = "dc26a074c9378b1b5735a27563320a26" 16 try: 17 hmac_hash = hmac.HMAC(password, salt, digestmod=hashlib.md5) 18 hd = hmac_hash.hexdigest() 19 ed = "dc26a074c9378b1b5735a27563320a26" 20 except ValueError: 21 hmac_hash = hmac.HMAC(password, salt, digestmod=hashlib.sha1) 22 hd = hmac_hash.hexdigest() 23 ed = "5529d27aef1b7420fb9d696f1c04eaad5dcc1515" 19 24 assert hd == ed, "expected digest %s but got %s" % (ed, hd) 20 25 21 26 def main(): -
xpra/client/gtk_base/gtk_client_base.py
a b 309 309 color_str = color_str.replace(":off", "") 310 310 if color_str in ("auto", ""): 311 311 from hashlib import md5 312 m = md5() 312 try: 313 m = md5() 314 except ValueError: 315 from hashlib import sha1 316 m = sha1() 313 317 for x in extra_args: 314 318 m.update(strtobytes(x)) 315 319 color_str = "#%s" % m.hexdigest()[:6] -
xpra/client/window_backing_base.py
a b 585 585 l = options.intget("z.len") 586 586 if l: 587 587 assert l==len(img_data), "compressed pixel data failed length integrity check: expected %i bytes but got %i" % (l, len(img_data)) 588 md5 = options.strget("z.md5") 589 if md5: 590 h = hashlib.md5(img_data) 588 try: 589 chksum = options.get("z.md5") 590 if chksum: 591 h = hashlib.md5(img_data) 592 except ValueError: 593 chksum = options.get("z.sha1") 594 if chksum: 595 h = hashlib.sha1(img_data) 596 if h: 591 597 hd = h.hexdigest() 592 assert md5==hd, "pixel data failed compressed md5 integrity check: expected %s but got %s" % (md5, hd)593 deltalog("passed compressed data integrity checks: len=%s, md5=%s (type=%s)", l, md5, type(img_data))598 assert chksum==hd, "pixel data failed compressed chksum integrity check: expected %s but got %s" % (chksum, hd) 599 deltalog("passed compressed data integrity checks: len=%s, chksum=%s (type=%s)", l, chksum, type(img_data)) 594 600 if coding == "mmap": 595 601 self.idle_add(self.paint_mmap, img_data, x, y, width, height, rowstride, options, callbacks) 596 602 elif coding in ("rgb24", "rgb32"): -
xpra/server/ssh.py
diff -r -u a/xpra/server/ssh.py b/xpra/server/ssh.py
a b 93 93 log("ignoring line '%s': %s", line, e) 94 94 continue 95 95 import hashlib 96 fp_plain = hashlib.md5(key).hexdigest() 96 try: 97 fp_plain = hashlib.md5(key).hexdigest() 98 except ValueError: 99 fp_plain = hashlib.sha1(key).hexdigest() 97 100 log("key(%s)=%s", line, fp_plain) 98 101 if fp_plain==hex_fingerprint: 99 102 return paramiko.OPEN_SUCCEEDED -
xpra/server/window/window_source.py
a b 2329 2329 v = data.data 2330 2330 except AttributeError: 2331 2331 v = data 2332 md5 = hashlib.md5(v).hexdigest() 2333 client_options["z.md5"] = md5 2332 try: 2333 chksum = hashlib.md5(v).hexdigest() 2334 client_options["z.md5"] = chksum 2335 except ValueError: 2336 chksum = hashlib.sha1().hexdigest() 2337 client_options["z.sha1"] = chksum 2334 2338 client_options["z.len"] = len(data) 2335 log("added len and hash of compressed data integrity %19s: %8i / %s", type(v), len(v), md5)2339 log("added len and hash of compressed data integrity %19s: %8i / %s", type(v), len(v), chksum) 2336 2340 #actual network packet: 2337 2341 if self.supports_flush and flush not in (None, 0): 2338 2342 client_options["flush"] = flush