You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Batch decryption fails because the decrypted file is overwriting the encrypted file that was downloaded. This works for small batch files, but causes decryption errors on larger batch files.
batch.py has two crypto.decryptFile calls.
Both calls set the encryptedFilepath and outputFilepath parameters to the same value.
This causes gpg to overwrite the downloaded/encrypted file and generate a decryption error which is returned as a File not found error (See #6Batch download decryption failure raises "Cannot find file" error...)
I've mitigated this issue locally as follows:
# Decrypt an encrypted file.
def decryptFile(self, passphrase, encryptedFilepath, outputFilepath):
# Call gpg command line to decrypt the file.
tmpFilepath = outfilepath + ".decrypted" # RGAC!!
try:
check_output(["gpg",
"--batch",
"--yes",
"--no-secmem-warning",
"--no-mdc-warning",
"--output", tmpFilepath,
"--passphrase", passphrase,
"--decrypt", encryptedFilepath])
# Check for error code.
os.replace(tmpFilepath, outputFilepath) # RGAC!!
print("\"%s\" has been decrypted to \"%s\"." % (encryptedFilepath, outputFilepath))
except CalledProcessError as err:
raise utils.VantivException("Decrypting the file has failed!\n%s" % err.output)
I'm running:
CentOS 7, Python 3.7.3, and SDK version 12.8.
My os.replace change only works on Python 3.5+
Note: Running gpg with from the command line returns a general error vs. the invalid radix64 errors documented in issue #6. Not sure why there is a difference. The command line error is much plainer.
$ gpg --batch --decrypt --no-secmem-warning --no-mdc-warning \
--output=original --passphrase-fd 0 original <key
gpg: encrypted with 4096-bit RSA key, ID B39F0BF9, created 2019-06-14
"Auric WorldPay Production Batch File (Auric production SFTP key for WorldPay.) <[email protected]>"
gpg: handle plaintext failed: General error
The text was updated successfully, but these errors were encountered:
Batch decryption fails because the decrypted file is overwriting the encrypted file that was downloaded. This works for small batch files, but causes decryption errors on larger batch files.
batch.py has two crypto.decryptFile calls.
Both calls set the encryptedFilepath and outputFilepath parameters to the same value.
This causes gpg to overwrite the downloaded/encrypted file and generate a decryption error which is returned as a File not found error (See #6 Batch download decryption failure raises "Cannot find file" error...)
I've mitigated this issue locally as follows:
I'm running:
CentOS 7, Python 3.7.3, and SDK version 12.8.
My os.replace change only works on Python 3.5+
Note: Running gpg with from the command line returns a general error vs. the
invalid radix64
errors documented in issue #6. Not sure why there is a difference. The command line error is much plainer.The text was updated successfully, but these errors were encountered: