drop peer messages if we're closing
This should remove a few Unhandled Errors when the code was wrong.
This commit is contained in:
parent
a251e58967
commit
8b56892a76
|
@ -652,6 +652,8 @@ class _Wormhole:
|
||||||
|
|
||||||
def _API_derive_key(self, purpose, length):
|
def _API_derive_key(self, purpose, length):
|
||||||
if self._error: raise self._error
|
if self._error: raise self._error
|
||||||
|
if self._key is None:
|
||||||
|
raise UsageError # call derive_key after get_verifier() or get()
|
||||||
if not isinstance(purpose, type(u"")): raise TypeError(type(purpose))
|
if not isinstance(purpose, type(u"")): raise TypeError(type(purpose))
|
||||||
return self._derive_key(to_bytes(purpose), length)
|
return self._derive_key(to_bytes(purpose), length)
|
||||||
|
|
||||||
|
@ -674,6 +676,9 @@ class _Wormhole:
|
||||||
# any message in the mailbox means we no longer need the nameplate
|
# any message in the mailbox means we no longer need the nameplate
|
||||||
self._event_mailbox_used()
|
self._event_mailbox_used()
|
||||||
|
|
||||||
|
if self._closing:
|
||||||
|
log.msg("received peer message while closing '%s'" % phase)
|
||||||
|
|
||||||
if phase == u"pake":
|
if phase == u"pake":
|
||||||
return self._event_received_pake(body)
|
return self._event_received_pake(body)
|
||||||
if phase == u"confirm":
|
if phase == u"confirm":
|
||||||
|
|
Loading…
Reference in New Issue
Block a user