From 229f295232e3abd3679bbb4ed258b81fc68a1931 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Mon, 25 Nov 2019 16:45:50 -0500 Subject: email-print-mime-structure: Change pipe_decrypt to pipe_transform I plan to use the same harness to try to transform other leaf subparts that might be extractable into a MIME subtree, not just decryption. So give it a more generic name. No functional change. Signed-off-by: Daniel Kahn Gillmor Acked-by: Sean Whitton --- email-print-mime-structure | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/email-print-mime-structure b/email-print-mime-structure index 4de0789..6d7b0af 100755 --- a/email-print-mime-structure +++ b/email-print-mime-structure @@ -114,16 +114,16 @@ class MimePrinter(object): if self.args.pgpkey: cryptopayload = self.pgpy_decrypt(self.args.pgpkey, ciphertext) if cryptopayload is None and self.args.use_gpg_agent: - cryptopayload = self.pipe_decrypt(ciphertext, ['gpg', '--batch', '--decrypt']) + cryptopayload = self.pipe_transform(ciphertext, ['gpg', '--batch', '--decrypt']) elif flavor == EncType.SMIME: if self.args.cmskey: for keyname in self.args.cmskey: cmd = ['openssl', 'smime', '-decrypt', '-inform', 'DER', '-inkey', keyname] - cryptopayload = self.pipe_decrypt(ciphertext, cmd) + cryptopayload = self.pipe_transform(ciphertext, cmd) if cryptopayload: return cryptopayload if self.args.use_gpg_agent: - cryptopayload = self.pipe_decrypt(ciphertext, ['gpgsm', '--batch', '--decrypt']) + cryptopayload = self.pipe_transform(ciphertext, ['gpgsm', '--batch', '--decrypt']) if cryptopayload is None: logging.warning(f'Unable to decrypt') return cryptopayload @@ -145,7 +145,7 @@ class MimePrinter(object): pass return None - def pipe_decrypt(self, ciphertext:bytes, cmd:List[str]) -> Optional[Message]: + def pipe_transform(self, ciphertext:bytes, cmd:List[str]) -> Optional[Message]: inp:int outp:int inp, outp = os.pipe() -- cgit v1.2.3