From c646e7283225443d92712c3d559304b56085198f Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 7 Mar 2014 12:55:46 -0800 Subject: [PATCH] Fix some Py2-isms in constant_time_bytes_eq --- paramiko/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paramiko/util.py b/paramiko/util.py index acd3fc6..0e582dc 100644 --- a/paramiko/util.py +++ b/paramiko/util.py @@ -307,6 +307,6 @@ def constant_time_bytes_eq(a, b): if len(a) != len(b): return False res = 0 - for i in xrange(len(a)): - res |= ord(a[i]) ^ ord(b[i]) + for i in (xrange if PY2 else range)(len(a)): + res |= byte_ord(a[i]) ^ byte_ord(b[i]) return res == 0