diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2018-06-19 22:48:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-19 22:48:03 +0100 |
commit | c30afc72150e30770da6fc1e5f6e68dce2b9a6bb (patch) | |
tree | 6e574a7f79b97c444f8a684ac17da0d45863025e /alot/commands/envelope.py | |
parent | c86623d9c7daaa2f9a832135a11870a0d91110a3 (diff) | |
parent | aadba603f877536ed0a1b0e12ede527baec98475 (diff) |
Merge pull request #1228 from dcbaker/auto-encrypt-new
envelope: Update encryption keys when CC, To, or From is changed
Diffstat (limited to 'alot/commands/envelope.py')
-rw-r--r-- | alot/commands/envelope.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py index cbff2808..535ce06c 100644 --- a/alot/commands/envelope.py +++ b/alot/commands/envelope.py @@ -416,12 +416,19 @@ class SetCommand(Command): self.reset = not append Command.__init__(self, **kwargs) + @inlineCallbacks def apply(self, ui): envelope = ui.current_buffer.envelope if self.reset: if self.key in envelope: del envelope[self.key] envelope.add(self.key, self.value) + # FIXME: handle BCC as well + # Currently we don't handle bcc because it creates a side channel leak, + # as the key of the person BCC'd will be available to other recievers, + # defeating the purpose of BCCing them + if self.key.lower() in ['to', 'from', 'cc']: + yield utils.set_encrypt(ui, ui.current_buffer.envelope) ui.current_buffer.rebuild() @@ -437,8 +444,15 @@ class UnsetCommand(Command): self.key = key Command.__init__(self, **kwargs) + @inlineCallbacks def apply(self, ui): del ui.current_buffer.envelope[self.key] + # FIXME: handle BCC as well + # Currently we don't handle bcc because it creates a side channel leak, + # as the key of the person BCC'd will be available to other recievers, + # defeating the purpose of BCCing them + if self.key.lower() in ['to', 'from', 'cc']: + yield utils.set_encrypt(ui, ui.current_buffer.envelope) ui.current_buffer.rebuild() |