Page MenuHome GnuPG

GPGME / QGpgME Extend Archivejobs to accept input / output from a filename
Closed, ResolvedPublic

Description

As discussed, for more comparable performance results in T6351 we would like to bypass the Data IO altogether and just provide a filename for the input archive when decrypting and the output archive when encrypting.

Discussed this with werner, this might need a low level adaptation in GPGME because it itself expects a gpgme_data_t and not a filename but otherwise there should be no reason against this. When the output parameter is given it might even clean up a temporary file on error, but it might also not so we should make sure on a higher level that we check for that and remove it when gpgtar crashes or something like that.

Event Timeline

aheinecke created this task.
ikloecker moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
ikloecker changed the task status from Open to Testing.Jun 21 2023, 4:59 PM
ikloecker moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.

When the output parameter is given it might even clean up a temporary file on error, but it might also not so we should make sure on a higher level that we check for that and remove it when gpgtar crashes or something like that.

This is handled by Kleopatra. I couldn't test this on Linux because I failed to provoke the encrypt archive job to fail resp. Kleopatra didn't notice that it failed/was killed (T6554: Kleopatra: Reports success when gpgtar is kill with SIGTERM or SIGKILL while folder is encrypted). The fix may fail on Windows, if gpgtar/gpg still access the file. So, this needs to be tested on Windows.

On Windows the process is stopped but you end up with a too small archive.
If you cancel immediately (presumably as long as the file still has size 0) it is removed, though.

Debugview shows:

[1688] org.kde.pim.kleopatra: Task: "Creating signed and encrypted archive ..." has no total progress set.
[1688] org.kde.pim.kleopatra:
[1688] org.kde.pim.kleopatra: 0xb790cf8 slotWizardCanceled
[1688] org.kde.pim.kleopatra: Kleo::Crypto::SignEncryptFilesController(0xb7aa338) cancel
[1688] org.kde.pim.kleopatra: Kleo::Crypto::SignEncryptTask(0x646bfd8) cancel
[1688] org.kde.pim.kleopatra: Error: "Abbruch durch Benutzer"
[1688] org.kde.pim.kleopatra:
[1688] org.kde.pim.kleopatra:
[1688] org.kde.pim.kleopatra: UiServer: connection 0xb7b9aa0 closed

I'm wondering why I don't see something like

org.kde.pim.kleopatra: slotResult Removing output file ... after error or cancel

in the debug output. It should be output whenever the signing and/or encryption job ended with a non-zero error code and the output file exists. (See commit on 22 June).

On the command line:

gpgtar -v --status-fd 2 -er Ted -s -o tt.tar.gpg tiefer_test

leaves a .tar.gpg file behind, too, if

  • you kill it with CTRL-C
  • if you call it without -s and stop the gpgtar.exe process in the task manager
  • if you call it with -s and give the correct password

If you call it with -s and cancel the pinentry, the file is removed.

ebo moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.

as this task is for a technical restructuring task, which is obviously done and works, closing this ticket.

For the not-removal of the archive file see T6584