mirror of
https://github.com/chatmail/core.git
synced 2026-04-06 15:42:10 +03:00
add a failing test for Autocrypt Key Transfer failing to extract a private key from an incoming ASM message
This commit is contained in:
@@ -306,10 +306,17 @@ class Account(object):
|
||||
self._imex_completed.wait()
|
||||
|
||||
def initiate_key_transfer(self):
|
||||
"""initiate Autocrypt key transfer by sending a self-sent message.
|
||||
|
||||
"""return setup code after a Autocrypt setup message
|
||||
has been successfully sent to our own e-mail address ("self-sent message").
|
||||
If sending out was unsuccessful, a RuntimeError is raised.
|
||||
"""
|
||||
return from_dc_charpointer(lib.dc_initiate_key_transfer(self._dc_context))
|
||||
self.check_is_configured()
|
||||
if not self._threads.is_started():
|
||||
raise RuntimeError("threads not running, can not send out")
|
||||
res = lib.dc_initiate_key_transfer(self._dc_context)
|
||||
if res == ffi.NULL:
|
||||
raise RuntimeError("could not send out autocrypt setup message")
|
||||
return from_dc_charpointer(res)
|
||||
|
||||
def start_threads(self):
|
||||
""" start IMAP/SMTP threads (and configure account if it hasn't happened).
|
||||
|
||||
@@ -95,7 +95,11 @@ class Message(object):
|
||||
|
||||
def is_setup_message(self):
|
||||
""" return True if this message is a setup message. """
|
||||
return lib.dc_is_setupmessage(self._dc_msg)
|
||||
return lib.dc_msg_is_setupmessage(self._dc_msg)
|
||||
|
||||
def continue_key_transfer(self, setup_code):
|
||||
""" extract key and use it as primary key for this account. """
|
||||
lib.dc_continue_key_transfer(self._dc_context, self.id, as_dc_charpointer(setup_code))
|
||||
|
||||
@props.with_doc
|
||||
def time_sent(self):
|
||||
|
||||
Reference in New Issue
Block a user