From 6ca5f5fc39650de55c9d93ceef5f275b80a100d1 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Mon, 24 Feb 2014 20:23:39 +0000 Subject: [PATCH] Use bigger random one-time keys in timing_safe_compare. fixes #2165 Follows this advice from Marsh Ray and Solar Designer: https://twitter.com/zooko/status/431105294777597952 Signed-off-by: Daira Hopwood --- src/allmydata/util/hashutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/allmydata/util/hashutil.py b/src/allmydata/util/hashutil.py index 546dc0b0..81522ad5 100644 --- a/src/allmydata/util/hashutil.py +++ b/src/allmydata/util/hashutil.py @@ -203,7 +203,7 @@ def ssk_storage_index_hash(readkey): return tagged_hash(MUTABLE_STORAGEINDEX_TAG, readkey, KEYLEN) def timing_safe_compare(a, b): - n = os.urandom(8) + n = os.urandom(32) return bool(tagged_hash(n, a) == tagged_hash(n, b)) BACKUPDB_DIRHASH_TAG = "allmydata_backupdb_dirhash_v1" -- 2.45.2