Kleopatra: On Linux, creating S/MIME encrypted archive of multiple files for certificate with bad CRL fails with input/output error
Testing, NormalPublic

Assigned To
None
Authored By
ikloecker
Tue, Apr 21, 4:45 PM

Description

I ran into this problem while testing my changes for T6702: Kleopatra: Offer retry of S/MIME encryption if encryption failed with "not trusted". I'm pretty sure that this also happens with Gpg4win 5.0.2.

To reproduce:

  • Configure de-vs compliance for gpg and gpgsm and force beta compliance. (This step might be optional.)
  • Import the certificates from T6702#216065.
  • Try to encrypt multiple files with one of the Bob certificates.

Expected result:
Encryption fails with some CRL related error (e.g. "host not found"). (This could then be handled as in T6702: Kleopatra: Offer retry of S/MIME encryption if encryption failed with "not trusted".)

Actual result:
Encryption fails with "Input/output error".

Event Timeline

ebo triaged this task as Normal priority.Thu, Apr 23, 3:00 PM

I do not see this in Gpg4win 5.0.2. For me the result is "unknown host" without the beta compliance for one of the certificates, "invalid CRL object" for the other.

After setting compliance for gpg, the operation hangs (seemingly forever) at "C:\Program Files\GnuPG\bin\gpgtar.exe" --utf8-strings --cms --skip-crypto --output - --encrypt -T- --null -- for the the first invalid certificate. After aborting this, the gpgtar process is gone, but the gpgsm process remains.
This should be due to T8187: Kleopatra: File encryption with invalid S/MIME certificate hangs indefinitely. The other certificate again returns the expected "invalid CRL object"

This seems to happen only on Linux where tar is used for creating the archive. If I change pack-command-cms (in libkleopatrarc) to 0|gpgtar --utf8-strings --cms --skip-crypto --output - --encrypt -T- --null -- (which is basically the same as used on Windows) then the problem doesn't occur. Apparently, tar behaves differently than gpgtar.

I'll create a blocking ticket which proposes to use gpgtar also on Linux.

ikloecker renamed this task from Kleopatra: Creating S/MIME encrypted archive of multiple files for certificate with bad CRL fails with input/output error to Kleopatra: On Linux, creating S/MIME encrypted archive of multiple files for certificate with bad CRL fails with input/output error.Tue, May 5, 12:12 PM
ikloecker added a project: Linux.

Further tests show that this has nothing to do with tar vs. gpgtar. It turns out that the "Input/output error" does *not* occur if the archive file already exists and Kleopatra asks if the file should be overwritten. Further tests show that this seems to be a timing issue.

The current working hypothesis is:
If tar/gpgtar has finished archiving the input files before gpgsm exits with an error then tar/gpgtar don't "crash" and no "Input/output error" occurs. Otherwise, tar/gpgtar "crash" (according to QProcess) which might actually be a SIGPIPE because the stdout pipe is closed.

ikloecker changed the task status from Open to Testing.Thu, May 7, 5:45 PM
ikloecker moved this task from Backlog to WIP on the gpd5x board.

Fixed. This only occurred on Linux, i.e. it should be tested with the AppImage.

ikloecker mentioned this in Unknown Object (Maniphest Task).Mon, May 11, 9:54 AM