Changeset de94a0f in trunk
- Timestamp:
- 2019-06-24T18:29:01Z (6 years ago)
- Branches:
- master
- Children:
- e5b892d
- Parents:
- 74705ba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/allmydata/test/test_introducer.py ¶
r74705ba rde94a0f 15 15 from foolscap.api import Tub, Referenceable, fireEventually, flushEventualQueue 16 16 from twisted.application import service 17 from allmydata import crypto18 17 from allmydata.crypto import ed25519 18 from allmydata.crypto.util import remove_prefix 19 from allmydata.crypto.error import BadSignature 19 20 from allmydata.interfaces import InsufficientVersionError 20 21 from allmydata.introducer.client import IntroducerClient … … 205 206 private_key, public_key = ed25519.create_signing_keypair() 206 207 public_key_str = ed25519.string_from_verifying_key(public_key) 207 pubkey_s = crypto.remove_prefix(public_key_str, "pub-")208 pubkey_s = remove_prefix(public_key_str, "pub-") 208 209 209 210 # ann1: ic1, furl1 … … 762 763 763 764 private_key, public_key = ed25519.create_signing_keypair() 764 public_key_str = crypto.remove_prefix(ed25519.string_from_verifying_key(public_key), "pub-")765 public_key_str = remove_prefix(ed25519.string_from_verifying_key(public_key), "pub-") 765 766 766 767 ann_t0 = make_ann_t(client_v2, furl1, private_key, 10) … … 801 802 ic = c.introducer_clients[0] 802 803 private_key, public_key = ed25519.create_signing_keypair() 803 public_key_str = crypto.remove_prefix(ed25519.string_from_verifying_key(public_key), "pub-")804 public_key_str = remove_prefix(ed25519.string_from_verifying_key(public_key), "pub-") 804 805 furl1 = "pb://onug64tu@127.0.0.1:123/short" # base32("short") 805 806 ann_t = make_ann_t(ic, furl1, private_key, 1) … … 832 833 # cache 833 834 private_key2, public_key2 = ed25519.create_signing_keypair() 834 public_key_str2 = crypto.remove_prefix(ed25519.string_from_verifying_key(public_key2), "pub-")835 public_key_str2 = remove_prefix(ed25519.string_from_verifying_key(public_key2), "pub-") 835 836 furl3 = "pb://onug64tu@127.0.0.1:456/short" 836 837 ann_t3 = make_ann_t(ic, furl3, private_key2, 1) … … 1004 1005 bad_ann = {"key1": "value2"} 1005 1006 bad_msg = json.dumps(bad_ann).encode("utf-8") 1006 self.failUnlessRaises( crypto.BadSignature,1007 self.failUnlessRaises(BadSignature, 1007 1008 unsign_from_foolscap, (bad_msg, sig, key)) 1008 1009
Note: See TracChangeset
for help on using the changeset viewer.