From a223f6bb60a9e9c3e7a25613c479c36d2d2ca74f Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 16 Dec 2020 17:31:06 -0500 Subject: [PATCH] More reliably corrupt the signature --- src/allmydata/test/test_introducer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/allmydata/test/test_introducer.py b/src/allmydata/test/test_introducer.py index 668d577db..1ba928257 100644 --- a/src/allmydata/test/test_introducer.py +++ b/src/allmydata/test/test_introducer.py @@ -1069,8 +1069,11 @@ class Signatures(SyncTestCase): # delivered to the subscriber. ann = {"service-name": "good-stuff", "payload": "bad stuff"} (msg, sig, key) = sign_to_foolscap(ann, private_key) - # Invalidate the signature a little - sig = sig.replace(b"2", b"3") + # Drop a base32 word from the middle of the key to invalidate the + # signature. + sig_l = list(sig) + sig_l[20:22] = [] + sig = b"".join(sig_l) ann_t = (msg, sig, key) ic.got_announcements([ann_t])