From 13dd359f9004b13e6957980f16c79cef61e0861b Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 6 Oct 2015 17:05:05 -0700 Subject: [PATCH] internal rename: appid -> _appid --- src/wormhole/blocking/transcribe.py | 6 +++--- src/wormhole/twisted/transcribe.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/wormhole/blocking/transcribe.py b/src/wormhole/blocking/transcribe.py index 38d0ac5..b2e9bc4 100644 --- a/src/wormhole/blocking/transcribe.py +++ b/src/wormhole/blocking/transcribe.py @@ -131,7 +131,7 @@ class Wormhole: def __init__(self, appid, relay_url): if not isinstance(appid, type(b"")): raise UsageError - self.appid = appid + self._appid = appid self._relay_url = relay_url if not self._relay_url.endswith("/"): raise UsageError side = hexlify(os.urandom(5)).decode("ascii") @@ -200,7 +200,7 @@ class Wormhole: def _start(self): # allocate the rest now too, so it can be serialized self.sp = SPAKE2_Symmetric(self.code.encode("ascii"), - idSymmetric=self.appid) + idSymmetric=self._appid) self.msg1 = self.sp.start() def derive_key(self, purpose, length=SecretBox.KEY_SIZE): @@ -229,7 +229,7 @@ class Wormhole: self.channel.send(u"pake", self.msg1) pake_msg = self.channel.get(u"pake") self.key = self.sp.finish(pake_msg) - self.verifier = self.derive_key(self.appid+b":Verifier") + self.verifier = self.derive_key(self._appid+b":Verifier") def get_verifier(self): if self.code is None: raise UsageError diff --git a/src/wormhole/twisted/transcribe.py b/src/wormhole/twisted/transcribe.py index 9dd427e..b00a606 100644 --- a/src/wormhole/twisted/transcribe.py +++ b/src/wormhole/twisted/transcribe.py @@ -145,7 +145,7 @@ class Wormhole: def __init__(self, appid, relay_url): if not isinstance(appid, type(b"")): raise UsageError - self.appid = appid + self._appid = appid self._relay_url = relay_url self._set_side(hexlify(os.urandom(5)).decode("ascii")) self.code = None @@ -215,7 +215,7 @@ class Wormhole: def _start(self): # allocate the rest now too, so it can be serialized self.sp = SPAKE2_Symmetric(self.code.encode("ascii"), - idSymmetric=self.appid) + idSymmetric=self._appid) self.msg1 = self.sp.start() def serialize(self): @@ -226,7 +226,7 @@ class Wormhole: if self._sent_data: raise UsageError if self._got_data: raise UsageError data = { - "appid": self.appid, + "appid": self._appid, "relay_url": self._relay_url, "code": self.code, "side": self._side, @@ -278,7 +278,7 @@ class Wormhole: def _got_pake(pake_msg): key = self.sp.finish(pake_msg) self.key = key - self.verifier = self.derive_key(self.appid+b":Verifier") + self.verifier = self.derive_key(self._appid+b":Verifier") return key d.addCallback(_got_pake) return d