Bug 444848 - kgpg fails two tests with gnupg >= 2.3.0
Summary: kgpg fails two tests with gnupg >= 2.3.0
Status: RESOLVED FIXED
Alias: None
Product: kgpg
Classification: Applications
Component: general (other bugs)
Version First Reported In: 21.08.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Rolf Eike Beer
URL:
Keywords:
: 447582 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-11-02 17:44 UTC by Heiko Becker
Modified: 2022-02-08 09:00 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 21.12.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Becker 2021-11-02 17:44:31 UTC
SUMMARY
kgpg-encrypt and kgpg-decrypt fail with gnupg >= 2.3.0 (2.3.3 at the moment) while the same tests pass fine with gnupg-2.2.32

STEPS TO REPRODUCE
1. cmake .. && make && make test

OBSERVED RESULT
6: Test command: /var/tmp/paludis/build/kde-kgpg-21.08.3/work/build/bin/kgpg-encrypt
6: Test timeout computed to be: 1500
6: QStandardPaths: wrong permissions on runtime directory /var/tmp/paludis/build/kde-kgpg-21.08.3/temp/, 0755 instead of 0700
6: ********* Start testing of KGpgEncryptTest *********
6: Config: Using QtTest library 5.15.2, Qt 5.15.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 11.2.0), exherbo unknown
6: PASS   : KGpgEncryptTest::initTestCase()
6: gpg: keybox '/var/tmp/paludis/build/kde-kgpg-21.08.3/temp/kgpg-encrypt-FsWxYG/.gnupg/pubring.kbx' created
6: gpg: /var/tmp/paludis/build/kde-kgpg-21.08.3/temp/kgpg-encrypt-FsWxYG/.gnupg/trustdb.gpg: trustdb created
6: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
6: gpg: key BA7695F3C550DF14: public key "Test KGpg" imported
6: [GNUPG:] IMPORTED BA7695F3C550DF14 Test KGpg
6: [GNUPG:] IMPORT_OK 1 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
6: gpg: Total number processed: 1
6: gpg:               imported: 1
6: [GNUPG:] IMPORT_RES 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
6: [GNUPG:] IMPORT_OK 0 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
6: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
6: gpg: key BA7695F3C550DF14: "Test KGpg" not changed
6: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
6: gpg: key BA7695F3C550DF14: secret key imported
6: [GNUPG:] IMPORT_OK 17 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
6: gpg: Total number processed: 1
6: gpg:              unchanged: 1
6: gpg:       secret keys read: 1
6: gpg:   secret keys imported: 1
6: [GNUPG:] IMPORT_RES 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0
6: gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
6: gpg: It is only intended for test purposes and should NOT be
6: gpg: used in a production environment or with production keys!
6: gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
6: gpg: It is only intended for test purposes and should NOT be
6: gpg: used in a production environment or with production keys!
6: gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
6: gpg: It is only intended for test purposes and should NOT be
6: gpg: used in a production environment or with production keys!
6: FAIL!  : KGpgEncryptTest::testAsciiArmoredEncryption() 'spy2.wait()' returned FALSE. ()
6:    Loc: [/var/tmp/paludis/build/kde-kgpg-21.08.3/work/kgpg-21.08.3/tests/kgpgencrypt.cpp(64)]
6: gpg: keybox '/var/tmp/paludis/build/kde-kgpg-21.08.3/temp/kgpg-encrypt-FsWxYG/.gnupg/pubring.kbx' created
6: gpg: /var/tmp/paludis/build/kde-kgpg-21.08.3/temp/kgpg-encrypt-FsWxYG/.gnupg/trustdb.gpg: trustdb created
6: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
6: gpg: key BA7695F3C550DF14: public key "Test KGpg" imported
6: [GNUPG:] IMPORTED BA7695F3C550DF14 Test KGpg
6: [GNUPG:] IMPORT_OK 1 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
6: gpg: Total number processed: 1
6: gpg:               imported: 1
6: [GNUPG:] IMPORT_RES 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
6: [GNUPG:] IMPORT_OK 0 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
6: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
6: gpg: key BA7695F3C550DF14: "Test KGpg" not changed
6: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
6: gpg: key BA7695F3C550DF14: secret key imported
6: [GNUPG:] IMPORT_OK 17 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
6: gpg: Total number processed: 1
6: gpg:              unchanged: 1
6: gpg:       secret keys read: 1
6: gpg:   secret keys imported: 1
6: [GNUPG:] IMPORT_RES 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0
6: gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
6: gpg: It is only intended for test purposes and should NOT be
6: gpg: used in a production environment or with production keys!
6: gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
6: gpg: It is only intended for test purposes and should NOT be
6: gpg: used in a production environment or with production keys!
6: FAIL!  : KGpgEncryptTest::testHideKeyIdEncryption() 'spy2.wait()' returned FALSE. ()
6:    Loc: [/var/tmp/paludis/build/kde-kgpg-21.08.3/work/kgpg-21.08.3/tests/kgpgencrypt.cpp(106)]
6: gpg: keybox '/var/tmp/paludis/build/kde-kgpg-21.08.3/temp/kgpg-encrypt-FsWxYG/.gnupg/pubring.kbx' created
6: gpg: can't connect to the gpg-agent: IPC connect call failed
6: gpg: problem with the agent: No agent running
6: FAIL!  : KGpgEncryptTest::testSymmetricEncryption() Compared values are not the same
6:    Actual   (result)                                  : 2
6:    Expected (static_cast<int>(KGpgTransaction::TS_OK)): 0
6:    Loc: [/var/tmp/paludis/build/kde-kgpg-21.08.3/work/kgpg-21.08.3/tests/kgpgencrypt.cpp(123)]
6: PASS   : KGpgEncryptTest::cleanupTestCase()
6: Totals: 2 passed, 3 failed, 0 skipped, 0 blacklisted, 16419ms
6: ********* Finished testing of KGpgEncryptTest *********
6: QProcess: Destroyed while process ("gpg") is still running.
6: QProcess: Destroyed while process ("gpg") is still running.
 6/11 Test  #6: kgpg-encrypt .....................***Failed   16.45 sec

7: Test command: /var/tmp/paludis/build/kde-kgpg-21.08.3/work/build/bin/kgpg-decrypt
7: Test timeout computed to be: 1500
7: QStandardPaths: wrong permissions on runtime directory /var/tmp/paludis/build/kde-kgpg-21.08.3/temp/, 0755 instead of 0700
7: ********* Start testing of KGpgDecryptTest *********
7: Config: Using QtTest library 5.15.2, Qt 5.15.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 11.2.0), exherbo unknown
7: PASS   : KGpgDecryptTest::initTestCase()
7: gpg: keybox '/var/tmp/paludis/build/kde-kgpg-21.08.3/temp/kgpg-decrypt-TuyrrI/.gnupg/pubring.kbx' created
7: gpg: /var/tmp/paludis/build/kde-kgpg-21.08.3/temp/kgpg-decrypt-TuyrrI/.gnupg/trustdb.gpg: trustdb created
7: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
7: gpg: key BA7695F3C550DF14: public key "Test KGpg" imported
7: [GNUPG:] IMPORTED BA7695F3C550DF14 Test KGpg
7: [GNUPG:] IMPORT_OK 1 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
7: gpg: Total number processed: 1
7: gpg:               imported: 1
7: [GNUPG:] IMPORT_RES 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
7: [GNUPG:] IMPORT_OK 0 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
7: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
7: gpg: key BA7695F3C550DF14: "Test KGpg" not changed
7: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
7: gpg: key BA7695F3C550DF14: secret key imported
7: [GNUPG:] IMPORT_OK 17 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
7: gpg: Total number processed: 1
7: gpg:              unchanged: 1
7: gpg:       secret keys read: 1
7: gpg:   secret keys imported: 1
7: [GNUPG:] IMPORT_RES 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0
7: gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
7: gpg: It is only intended for test purposes and should NOT be
7: gpg: used in a production environment or with production keys!
7: FAIL!  : KGpgDecryptTest::testDecrypt(AsciiArmored) 'spy.wait(10000)' returned FALSE. ()
7:    Loc: [/var/tmp/paludis/build/kde-kgpg-21.08.3/work/kgpg-21.08.3/tests/kgpgdecrypt.cpp(26)]
7: gpg: keybox '/var/tmp/paludis/build/kde-kgpg-21.08.3/temp/kgpg-decrypt-TuyrrI/.gnupg/pubring.kbx' created
7: gpg: /var/tmp/paludis/build/kde-kgpg-21.08.3/temp/kgpg-decrypt-TuyrrI/.gnupg/trustdb.gpg: trustdb created
7: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
7: gpg: key BA7695F3C550DF14: public key "Test KGpg" imported
7: [GNUPG:] IMPORTED BA7695F3C550DF14 Test KGpg
7: [GNUPG:] IMPORT_OK 1 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
7: gpg: Total number processed: 1
7: gpg:               imported: 1
7: [GNUPG:] IMPORT_RES 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
7: [GNUPG:] IMPORT_OK 0 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
7: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
7: gpg: key BA7695F3C550DF14: "Test KGpg" not changed
7: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
7: gpg: key BA7695F3C550DF14: secret key imported
7: [GNUPG:] IMPORT_OK 17 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
7: gpg: Total number processed: 1
7: gpg:              unchanged: 1
7: gpg:       secret keys read: 1
7: gpg:   secret keys imported: 1
7: [GNUPG:] IMPORT_RES 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0
7: FAIL!  : KGpgDecryptTest::testDecrypt(HideKeyId) 'spy.wait(10000)' returned FALSE. ()
7:    Loc: [/var/tmp/paludis/build/kde-kgpg-21.08.3/work/kgpg-21.08.3/tests/kgpgdecrypt.cpp(26)]
7: gpg: keybox '/var/tmp/paludis/build/kde-kgpg-21.08.3/temp/kgpg-decrypt-TuyrrI/.gnupg/pubring.kbx' created
7: gpg: /var/tmp/paludis/build/kde-kgpg-21.08.3/temp/kgpg-decrypt-TuyrrI/.gnupg/trustdb.gpg: trustdb created
7: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
7: gpg: key BA7695F3C550DF14: public key "Test KGpg" imported
7: [GNUPG:] IMPORTED BA7695F3C550DF14 Test KGpg
7: [GNUPG:] IMPORT_OK 1 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
7: gpg: Total number processed: 1
7: gpg:               imported: 1
7: [GNUPG:] IMPORT_RES 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
7: [GNUPG:] IMPORT_OK 0 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
7: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
7: gpg: key BA7695F3C550DF14: "Test KGpg" not changed
7: [GNUPG:] KEY_CONSIDERED FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14 0
7: gpg: key BA7695F3C550DF14: secret key imported
7: [GNUPG:] IMPORT_OK 17 FBAF08DD7D9D0921C15DDA9FBA7695F3C550DF14
7: gpg: Total number processed: 1
7: gpg:              unchanged: 1
7: gpg:       secret keys read: 1
7: gpg:   secret keys imported: 1
7: [GNUPG:] IMPORT_RES 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0
7: FAIL!  : KGpgDecryptTest::testDecrypt(Symmetrical) 'spy.wait(10000)' returned FALSE. ()
7:    Loc: [/var/tmp/paludis/build/kde-kgpg-21.08.3/work/kgpg-21.08.3/tests/kgpgdecrypt.cpp(26)]
7: PASS   : KGpgDecryptTest::cleanupTestCase()
7: Totals: 2 passed, 3 failed, 0 skipped, 0 blacklisted, 29966ms
7: ********* Finished testing of KGpgDecryptTest *********
7: QProcess: Destroyed while process ("gpg") is still running.
7: QProcess: Destroyed while process ("gpg") is still running.
7: QProcess: Destroyed while process ("gpg") is still running.
 7/11 Test  #7: kgpg-decrypt .....................***Failed   30.00 sec

SOFTWARE/OS VERSIONS
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Comment 1 Rolf Eike Beer 2021-11-19 07:11:09 UTC
In both cases a signal spy says it has not got the expected signal in the given timeframe. Can you increase these timeouts and see if that helps (scan for the first "Loc:" line in both outputs). It could be that gpg is just slower, because of some changes or just because it is a debug version.
Comment 2 Bug Janitor Service 2021-12-04 04:38:32 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Bug Janitor Service 2021-12-19 04:35:26 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 4 Rolf Eike Beer 2022-01-07 12:30:37 UTC
*** Bug 447582 has been marked as a duplicate of this bug. ***
Comment 5 Rolf Eike Beer 2022-01-07 12:35:09 UTC
Git commit b328227cdd4dc227c1df8ba6bb5e4a133e551656 by Rolf Eike Beer.
Committed on 07/01/2022 at 12:34.
Pushed by dakon into branch 'master'.

always close the input channel of a text decryption

Otherwise the decryption never starts with GnuPG 2.3.

M  +7    -0    transactions/kgpgdecrypt.cpp
M  +1    -1    transactions/kgpgdecrypt.h
M  +8    -3    transactions/kgpgtextorfiletransaction.cpp
M  +12   -0    transactions/kgpgtextorfiletransaction.h

https://invent.kde.org/utilities/kgpg/commit/b328227cdd4dc227c1df8ba6bb5e4a133e551656
Comment 6 Rigo Wenning 2022-02-08 09:00:00 UTC
Thanks a ton for fixing. It works perfectly in KGPG 21.12.2 on tumbleweed 2022-02-04