diff --git a/src/wormhole/test/test_wormhole.py b/src/wormhole/test/test_wormhole.py index 9cf4fe2..590eaf6 100644 --- a/src/wormhole/test/test_wormhole.py +++ b/src/wormhole/test/test_wormhole.py @@ -232,15 +232,15 @@ class Basic(unittest.TestCase): out = ws.outbound() self.assertEqual(len(out), 2, out) self.check_out(out[0], type=u"release") - self.check_out(out[1], type=u"add", phase=u"confirm") + self.check_out(out[1], type=u"add", phase=u"version") self.assertNoResult(v) # hearing a valid confirmation message doesn't throw an error plaintext = json.dumps({}).encode("utf-8") - data_key = w._derive_phase_key(side2, u"confirm") + data_key = w._derive_phase_key(side2, u"version") confmsg = w._encrypt_data(data_key, plaintext) confirm2_hex = hexlify(confmsg).decode("ascii") - response(w, type=u"message", phase=u"confirm", body=confirm2_hex, + response(w, type=u"message", phase=u"version", body=confirm2_hex, side=side2) # and it releases the verifier @@ -532,7 +532,7 @@ class Basic(unittest.TestCase): else: w._key = b"wrongkey" plaintext = json.dumps({}).encode("utf-8") - data_key = w._derive_phase_key(side2, u"confirm") + data_key = w._derive_phase_key(side2, u"version") confmsg = w._encrypt_data(data_key, plaintext) w._key = None @@ -612,7 +612,7 @@ class Basic(unittest.TestCase): self.failureResultOf(w.verify(), WelcomeError) def test_confirm_error(self): - # we should only receive the "confirm" message after we receive the + # we should only receive the "version" message after we receive the # PAKE message, by which point we should know the key. If the # confirmation message doesn't decrypt, we signal an error. timing = DebugTiming() @@ -646,7 +646,7 @@ class Basic(unittest.TestCase): nonce = os.urandom(wormhole.CONFMSG_NONCE_LENGTH) badconfirm = wormhole.make_confmsg(confkey, nonce) badconfirm_hex = hexlify(badconfirm).decode("ascii") - response(w, type=u"message", phase=u"confirm", body=badconfirm_hex, + response(w, type=u"message", phase=u"version", body=badconfirm_hex, side=u"s2") self.failureResultOf(d1, WrongPasswordError) diff --git a/src/wormhole/wormhole.py b/src/wormhole/wormhole.py index 0182359..09055f6 100644 --- a/src/wormhole/wormhole.py +++ b/src/wormhole/wormhole.py @@ -558,7 +558,7 @@ class _Wormhole: # dictionary of version flags to let the other Wormhole know what # we're capable of (for future expansion) plaintext = json.dumps(self._my_versions).encode("utf-8") - phase = u"confirm" + phase = u"version" data_key = self._derive_phase_key(self._side, phase) encrypted = self._encrypt_data(data_key, plaintext) self._msg_send(phase, encrypted) @@ -588,7 +588,7 @@ class _Wormhole: def _event_received_confirm(self, side, body): # We ought to have the master key by now, because sensible peers - # should always send "pake" before sending "confirm". It might be + # should always send "pake" before sending "version". It might be # nice to relax this requirement, which means storing the received # confirmation message, and having _event_established_key call # _check_confirmation() @@ -603,7 +603,7 @@ class _Wormhole: self._confirmation_checked = True side, body = self._confirmation_message - data_key = self._derive_phase_key(side, u"confirm") + data_key = self._derive_phase_key(side, u"version") try: plaintext = self._decrypt_data(data_key, body) except CryptoError: @@ -717,7 +717,7 @@ class _Wormhole: if phase == u"pake": return self._event_received_pake(body) - if phase == u"confirm": + if phase == u"version": return self._event_received_confirm(side, body) if re.search(r'^\d+$', phase): return self._event_received_phase_message(side, phase, body)