Use pysequoia for decryption
This commit is contained in:
parent
9d47de4979
commit
eef301c863
|
@ -197,8 +197,11 @@ class GPGDecryptor:
|
|||
def decrypt(self):
|
||||
"""Decrypt the message."""
|
||||
p = subprocess.Popen(self._command(), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
decdata = p.communicate(input=self._message)[0]
|
||||
return (decdata, p.returncode)
|
||||
try:
|
||||
decrypted = pysequoia.decrypt(bytes = self._message)
|
||||
return (decrypted.bytes.decode("utf8"), 0)
|
||||
except:
|
||||
return ("", 1)
|
||||
|
||||
def _command(self):
|
||||
return _build_command(self._keyhome, "--trust-model", "always", "--batch", "--yes", "--no-secmem-warning", "-a", "-d")
|
||||
|
|
Loading…
Reference in New Issue