In the new version the gpg encryption management does not appear. Unable to insert keys. It happens in ubuntu and Microsoft Windows SUMMARY STEPS TO REPRODUCE 1. 2. 3. OBSERVED RESULT EXPECTED RESULT SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
Same for me on Windows 10. GPG option does appear on version 5.0 but does NOT on version 5.1. I couldn't make it to work...
This looks like a duplicate to bug 399230 to me. Please confirm by using a newer version than 5.1.2 or update here that it still does not work.
Forgot to update state
I'm trying with Version 5.1.2-0af86e098, and I confirm it does not work on this version compared to Version 5.0.6.
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!
Updating state
I just tried to duplicate this with current master. Intalled GPG4Win with all default settings (incl. installation of Kleopatra for key management), created a keypair and started KMyMoney. GPG was available and is working. I consider this fixed in 5.2.
Well, that was a bit too quick. I need to re-open because saving the data somehow does not work because no file is created - also no error is shown. Back to debugging mode.
With current master, I see the following line using dbgviewpp when writing encrypted: Invalid parameter passed to C runtime function. This message does not get written (and the file gets created and written to disk) when saving unencrypted as .kmy file. I am running out of ideas how to debug this further. Any help appreciated.
Can you identify where that message is written? I don't generally use encryption myself, but hopefully later in the week I can make some time to run under a debugger. Am I correct this is true in both 5.1.3 and git master?
Git commit 433179af8ff4a812731c291a2d40c58a40dbe0c3 by Thomas Baumgart. Committed on 29/07/2024 at 06:31. Pushed by tbaumgart into branch 'master'. Add trace messages to figure out encryption failure on Windows This is to figure out what triggers the message "Invalid parameter passed to C runtime function." which we see in the debug output when writing using the encryption method. M +15 -0 kmymoney/plugins/xml/xmlstorage.cpp https://invent.kde.org/office/kmymoney/-/commit/433179af8ff4a812731c291a2d40c58a40dbe0c3
Output of the trace messages: 1 0.000000 8760 kmymoney.exe saveToLocalFile(1) 2 3.125127 8760 kmymoney.exe saveToLocalFile(2) 3 3.125275 8760 kmymoney.exe saveToLocalFile(3) 4 3.125373 8760 kmymoney.exe saveToLocalFile(4) 5 3.226704 8760 kmymoney.exe saveToLocalFile(5) 6 3.226765 8760 kmymoney.exe saveToLocalFile(6) addRecipient "0x40097792" 7 3.307992 8760 kmymoney.exe saveToLocalFile(6) addRecipient "xxx@kde.org" 8 3.387963 8760 kmymoney.exe saveToLocalFile(8) 9 3.388486 8760 kmymoney.exe saveToLocalFile(9) 10 3.388518 8760 kmymoney.exe saveToLocalFile(10) 11 3.389217 8760 kmymoney.exe saveToLocalFile(11) 12 3.525290 8760 kmymoney.exe "The currency pair BYR->BYN is invalid. Omitting from storage." 13 3.526784 8760 kmymoney.exe saveToLocalFile(12) 14 3.701225 8760 kmymoney.exe Invalid parameter passed to C runtime function. 15 3.728223 8760 kmymoney.exe saveToLocalFile(13) 16 3.728271 8760 kmymoney.exe saveToLocalFile(14) 17 3.728383 8760 kmymoney.exe saveToLocalFile(15)
A kmymoney 5.2 snapshot using MinGW has been added recently to https://kmymoney.org/snapshots.php. With the embedded gpg2 package I checked saving and loading a gpg encrypted kmymoney file without any issue.
Located the culprit: 2694 20.426516 8316 kmymoney.exe KGPGFile::close(5) 2695 20.605514 8316 kmymoney.exe Invalid parameter passed to C runtime function. 2696 20.638710 8316 kmymoney.exe KGPGFile::close(6) which is generated by qDebug() << "KGPGFile::close(5)"; d->m_lastError = d->m_ctx->encrypt(d->m_recipients, d->m_data, dcipher, GpgME::Context::AlwaysTrust).error(); qDebug() << "KGPGFile::close(6)"; but I still have no idea why it does not work on MSVC compiled code, but is said to be working on Linux and MinGW.
Could this be of any help here to find out what is going on? https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler?view=msvc-170&viewFallbackFrom=vs-2017
Gpg4win (and the simple installer for GnuPG) includes the gpgme C library. Check if gpgme++ tries to use gpgme from the installed GnuPG instead of gpgme provided by KMyMoney. Or delete/rename the gpgme library included in Gpg4win/GnuPG and check if this fixes the problem.
Using "C:\Windows\System32\perfmon.exe /res" the associated modules list on the CPU tab shows that it uses libgpgme-11.dll from the kmymoney/bin directory and none of the GPG4Win installation which provides/uses libgpgme-14.dll.
If you start kmymoney.exe from a console after doing ``` set GPGME_DEBUG=9;c:\temp\gpgme.log ``` you'll get a verbose debug log of gpgme written to c:\temp\gpgme.log.
Now fixed completely and verified to work on Windows to encrypt and decrypt files as expected.
(In reply to Thomas Baumgart from comment #19) > Now fixed completely and verified to work on Windows to encrypt and decrypt > files as expected. Since it worked before with the MinGW builds, I'm wondering if MSVC builds behave differently at this point and if GPG support still works with this change.
It should, because I tested the fix also with gcc. The problem is not so much Windows but the compiler and runtime environment as it seems.