gpgol.git
4 months agoAdd code to print out keycache inserts
Andre Heinecke [Wed, 27 Feb 2019 10:10:18 +0000 (11:10 +0100)]
Add code to print out keycache inserts

* src/keycache.cpp: Add default off code to print keycache inserts.

4 months agoAdd decrypt permanently feature
Andre Heinecke [Fri, 22 Feb 2019 05:47:18 +0000 (06:47 +0100)]
Add decrypt permanently feature

* src/gpgoladdin.cpp (GpgolRibbonExtender::GetIDsOfNames),
(GpgolRibbonExtender::Invoke),
(GetCustomUI_MIME): Add decrypt permanently.
* src/mail.cpp (Mail::decryptPermanently_o): New.
* src/ribbon-callbacks.cpp (decrypt_permanently): Wire up.

4 months agoAdd new mapi helpers for decrypt permanently
Andre Heinecke [Fri, 22 Feb 2019 05:46:02 +0000 (06:46 +0100)]
Add new mapi helpers for decrypt permanently

* src/mapihelp.cpp (mapi_delete_gpgol_tags): New. delete
our tags.
(mapi_set_message_class): Explicitly set a message class.

4 months agoFix encoding of protected header subject
Andre Heinecke [Fri, 22 Feb 2019 05:45:13 +0000 (06:45 +0100)]
Fix encoding of protected header subject

* src/mimedataprovider.cpp (MimeDataProvider::finalize): Parse
the subject through rfc2047

4 months agoAdd minimalistic protected-headers support
Andre Heinecke [Thu, 21 Feb 2019 14:16:49 +0000 (15:16 +0100)]
Add minimalistic protected-headers support

* src/mail.cpp (Mail::parsing_done): Update subject if one
was taken from a protected header.
* src/mailitem-events.cpp (prop_blacklist): Ignore subject related
changes.
* src/mimedataprovider.cpp (t2body): Handle protected headers.
(MimeDataProvider::finalize): Convert subject to a string.
(MimeDataProvider::get_internal_subject): New.
* src/parsecontroller.cpp (ParseController::get_internal_subject):
New accessor.
* src/parsecontroller.h, src/mimedataprovider.h: Update accordingly.

--
This is still bad but a little less bad then it was before.
We still ignore to and from from the protected headers but at
least we show the subject now.1

4 months agoRead autocrypt header for autoimport
Andre Heinecke [Thu, 21 Feb 2019 12:09:50 +0000 (13:09 +0100)]
Read autocrypt header for autoimport

* src/common_indep.h (autocrypt_s): Data transfer struct.
* src/keycache.cpp (KeyCache::import_pgp_key_data): Fix and
add more debugging.
* src/mail.cpp (Mail::preProcessMessage_m): Check for autocrypt
headers even on non crypto mails.
(Mail::decryptVerify_o): Parse autocrypt header for crypto mails.
* src/mapihelp.cpp (get_message_content_type_cb): Renamed
to parse_headers_cb.
(ac_get_value): New helper.
(prepare_key_data): New helper.
(mapi_get_header_info): General function for additional header info.
* src/mapihelp.h: Update accordingly.
* src/parsecontroller.cpp (handle_autocrypt_info): New helper.
(ParseController::parse): Handle autocrypt info on demand.
* src/parsecontroller.h: Update accordingly.

--
Ideally we want to do the import in the parse step as it is
then in the background thread. But for unencrypted mails we
have to do in in the pre processing because afterwards we no
longer look at the unencrypted mail.

mapi_get_header_info is intended as a new one time parse function
to get some more info from the headers. For now it only supports
autocrypt header.

4 months agoAdd cast to MAKE_SHARED macro
Andre Heinecke [Thu, 21 Feb 2019 12:08:40 +0000 (13:08 +0100)]
Add cast to MAKE_SHARED macro

* src/oomhelp.h (MAKE_SHARED): Cast to IDispatch.

--
This allows to make shared stuff like IMessage.

4 months agoAdd whitespace removal helper to cpphelp
Andre Heinecke [Thu, 21 Feb 2019 12:07:15 +0000 (13:07 +0100)]
Add whitespace removal helper to cpphelp

* src/cpphelp.cpp, src/cpphelp.h (remove_whitespace): New.

4 months agoMinor string fix
Andre Heinecke [Thu, 21 Feb 2019 12:06:37 +0000 (13:06 +0100)]
Minor string fix

* src/addin-options.cpp: Remove period at the end of an option.

4 months agoFix crash when sending encrypted mail
Andre Heinecke [Thu, 21 Feb 2019 11:38:00 +0000 (12:38 +0100)]
Fix crash when sending encrypted mail

* src/cryptcontroller.cpp (CryptController::update_mail_mapi):
Check if att_table exists before accessing it.

--
This was a regression caused by cf221afd which never made
it into a release.

4 months agoCleanly remove gpgol_sigstatus
Andre Heinecke [Thu, 21 Feb 2019 09:18:53 +0000 (10:18 +0100)]
Cleanly remove gpgol_sigstatus

* src/mapihelp.cpp (get_gpgolsigstatus_tag),
(mapi_has_sig_status, mapi_test_sig_status, mapi_get_sig_status)
(mapi_set_sig_status): Removed.
(mapi_change_message_class): Dont mark non crypto messages.
* src/mimemaker.cpp (finalize_message restore_msg_from_moss):
Do not set sigstatus.

--
The sigstatus is not used by current code and is never
read. The save changes caused by the property required
a modification and additional sync for unencrypted messages. So
we need to remove setting it.

5 months agoHandle autoimport for attached pgp keys
Andre Heinecke [Mon, 11 Feb 2019 14:48:05 +0000 (15:48 +0100)]
Handle autoimport for attached pgp keys

* src/keycache.cpp (KeyCache::import_pgp_key_data): New.
* src/keycache.h: Update accordingly.
* src/parsecontroller.cpp (ParseController::parse): Check for
pgp-keys attachments and import them.

5 months agoImplement auto encrypt untrusted
Andre Heinecke [Mon, 11 Feb 2019 14:46:00 +0000 (15:46 +0100)]
Implement auto encrypt untrusted

* src/keycache.cpp (getEncryptionKeys): Handle new option.

--
This allows opportunistic encryption to any key in the
keyring. As this is problematic it is off by default.

5 months agoAdd / parse new automation options
Andre Heinecke [Mon, 11 Feb 2019 14:45:22 +0000 (15:45 +0100)]
Add / parse new automation options

* src/common_indep.h (opt): Add new fields.
* src/main.c (read_options): Read them.

5 months agoStore content-type for attachments
Andre Heinecke [Mon, 11 Feb 2019 14:44:15 +0000 (15:44 +0100)]
Store content-type for attachments

* src/attachment.cpp (get_content_type, set_content_type): New.
* src/mimedataprovider.cpp (create_attachment): Set it.
* src/attachment.h: Update accordingly.

5 months agoFix syntax error
Andre Heinecke [Mon, 11 Feb 2019 13:36:45 +0000 (14:36 +0100)]
Fix syntax error

* src/addin-options.cpp: Fix syntax.

5 months agoFix implicit fallthrough warnings
Andre Heinecke [Mon, 11 Feb 2019 13:35:52 +0000 (14:35 +0100)]
Fix implicit fallthrough warnings

* src/application-events.cpp: Fix unintentional fallthrough from
QUIT.
* src/mailitem-events.cpp: Mark reply fallthrough as intentional.

5 months agoUse better names for our own attachments
Andre Heinecke [Mon, 11 Feb 2019 13:26:48 +0000 (14:26 +0100)]
Use better names for our own attachments

* src/mapihelp.h (MIMEATTACHFILENAME, PGPBODYFILENAME): Use
better file names.

--
This helps users to understand / analyze issues when they
introspect or see the hidden attachments due to some bug.

5 months agoAdd strings for new config options
Andre Heinecke [Mon, 11 Feb 2019 13:26:22 +0000 (14:26 +0100)]
Add strings for new config options

* src/addin-options.cpp: Add new strings.

6 months agoFix forwarding of sent mails
Andre Heinecke [Mon, 14 Jan 2019 09:15:25 +0000 (10:15 +0100)]
Fix forwarding of sent mails

* src/cryptcontroller.cpp (CryptController::update_mail_mapi):
Remove an existing MOSSTMPL if available.

--
Without this the MOSSTMPL was kept and we then had two
or more MOSSTMPLs. This resulted in undefined / buggy
behavior.

GnuPG-Bug-Id: T4321

6 months agoFix minor typo
Andre Heinecke [Mon, 14 Jan 2019 09:15:14 +0000 (10:15 +0100)]
Fix minor typo

--

6 months agoFix tooltip for bad signature
Andre Heinecke [Wed, 9 Jan 2019 09:07:26 +0000 (10:07 +0100)]
Fix tooltip for bad signature

* src/mail.cpp (Mail::getCryptoDetails_o): Handle bad signature
explicitly.

--
Otherwise the code would run into the key error checks and
would note wrongls that the UID does not match.

GnuPG-Bug-Id: T4299

6 months agopo: Auto update po files
Andre Heinecke [Mon, 7 Jan 2019 07:44:07 +0000 (08:44 +0100)]
po: Auto update po files

--

6 months agoMerge remote-tracking branch 'dutch-l10n/dutch'
Andre Heinecke [Mon, 7 Jan 2019 07:43:12 +0000 (08:43 +0100)]
Merge remote-tracking branch 'dutch-l10n/dutch'

6 months agoAdd translators comment
Andre Heinecke [Mon, 7 Jan 2019 07:41:59 +0000 (08:41 +0100)]
Add translators comment

* src/mail.cpp (Mail::updateCategories_o): Add comment to clarify
string.

--
The placeholders there need some explanation.

6 months agoUpdate Dutch translation
Erwin Bronkhorst [Thu, 3 Jan 2019 22:16:54 +0000 (23:16 +0100)]
Update Dutch translation

7 months agoFix two memdbg refcount errors
Andre Heinecke [Mon, 26 Nov 2018 13:41:24 +0000 (14:41 +0100)]
Fix two memdbg refcount errors

* src/mapihelp.cpp (is_really_cms_encrypted): Fix references.

--
This code is almost never run so that did not happen before.

7 months agoAvoid use of error msg class "IPM.Note.GpgOL"
Andre Heinecke [Mon, 26 Nov 2018 13:15:45 +0000 (14:15 +0100)]
Avoid use of error msg class "IPM.Note.GpgOL"

* src/mapihelp.cpp (change_message_class_ipm_note_secure_cex),
(change_message_class_ipm_note_smime): Use OpaqueEncrypted
rather then IPM.Note.GpgOL.
(mapi_change_message_class): Change old IPM.Note.GpgOL mails.

--
This should help debugging
GnuPG-Bug-Id: T4267

And in any case IPM.Note.GpgOL should never be used as
we do not handle it in decryption.

7 months agoInitalize pointer in mapi_get_header
Andre Heinecke [Mon, 19 Nov 2018 10:05:16 +0000 (11:05 +0100)]
Initalize pointer in mapi_get_header

* src/mapihelp.cpp (mapi_get_header): Initialize stream.

--
This would probably have avoided:

GnuPG-Bug-Id: T4262

7 months agoCheck for error in dbg decrated oom funcs
Andre Heinecke [Mon, 19 Nov 2018 09:58:20 +0000 (10:58 +0100)]
Check for error in dbg decrated oom funcs

* src/oomhelp.cpp (gpgol_openProperty, gpgol_queryInterface):
Check result before calling memdbg_addRef.

--
Calling something on the pointer on error is undefined
so we may not do it. memdbg_addRef tries to get the
name of the interface. That might then crash.
Usually the returned pointer should be NULL so
on error so it does not happen much.

GnuPG-Bug-Id: T4262

8 months agoFix log_addins and use it to log all addins
Andre Heinecke [Tue, 13 Nov 2018 09:56:58 +0000 (10:56 +0100)]
Fix log_addins and use it to log all addins

* src/mailitem-events.cpp (Read): call log_addins once.
* src/oomhelp.cpp (log_addins): Fix by invoking directly.

8 months agoPost release Version bump
Andre Heinecke [Mon, 12 Nov 2018 12:44:59 +0000 (13:44 +0100)]
Post release Version bump

--

8 months agoUpdate NEWS for todays release gpgol-2.3.2
Andre Heinecke [Mon, 12 Nov 2018 12:14:32 +0000 (13:14 +0100)]
Update NEWS for todays release

--

8 months agoFix l10n encoding in category manager
Andre Heinecke [Mon, 12 Nov 2018 12:09:45 +0000 (13:09 +0100)]
Fix l10n encoding in category manager

* src/categorymanager.cpp: Use utf8 gettext.

8 months agoUpdate german translation
Andre Heinecke [Mon, 12 Nov 2018 12:01:25 +0000 (13:01 +0100)]
Update german translation

* po/de.po: Translate new S/MIME warning.

8 months agoAuto update po files
Andre Heinecke [Mon, 12 Nov 2018 11:53:06 +0000 (12:53 +0100)]
Auto update po files

--

8 months agoImprove string for unsigned S/MIME reply
Andre Heinecke [Mon, 12 Nov 2018 11:51:28 +0000 (12:51 +0100)]
Improve string for unsigned S/MIME reply

* src/mailitem-events.cpp: Improve string for unsigned
S/MIME reply.

8 months agoDisable async crypt for mails without subject
Andre Heinecke [Fri, 9 Nov 2018 17:36:12 +0000 (18:36 +0100)]
Disable async crypt for mails without subject

* src/mail.cpp (Mail::check_inline_response): Disable also
for empty subject.
--
For mails with an empty subject Outlook asks if the mail
should be sent anyway. If we do async crypto it also asks
on our triggered send event. In that case the overlay
blocks it. So better just disable async in that case so
that there are no two questions.

GnuPG-Bug-Id: T4150

8 months agoAdd explicit decrypt as WindowMessage handler
Andre Heinecke [Fri, 9 Nov 2018 17:17:36 +0000 (18:17 +0100)]
Add explicit decrypt as WindowMessage handler

* src/mail.cpp (decryptVerify_o): Remove obsolete safeguard
against double decryption.
* src/windowmessages.cpp (EXT_API_DECRYPT): Add new command.

--
This is nice to have a close -> do something with the encrypted
mail -> decrypt again workflow.

GnuPG-Bug-Id: T4241

8 months agoPass write for closed mails
Andre Heinecke [Fri, 9 Nov 2018 14:44:21 +0000 (15:44 +0100)]
Pass write for closed mails

* src/folder-events.cpp (Invoke): Set is now implicit in close.
* src/mail.cpp: Change isAboutToBeMoved to passWrite.
(decryptVerify_o): Stop passing write when processing.
* src/mailitem-events.cpp (Write): Pass it when a mail was closed
by us.

--
After closing with discard changes it should be ok to write
as long as we are not decrypted again. This can be helpful
after an external close was triggered and is basically
the same as what we do for a move.

GnuPG-Bug-Id: T4241

8 months agoOverride file close cmd to trigger shutdown
Andre Heinecke [Fri, 9 Nov 2018 10:20:05 +0000 (11:20 +0100)]
Override file close cmd to trigger shutdown

* src/gpgoladdin.cpp (GpgolRibbonExtender::GetIDsOfNames)
(GpgolRibbonExtender::Invoke): Hookup override.
(GetCustomUI_MIME): Override File->Close command.
* src/ribbon-callbacks.cpp (override_file_close): New.
* src/ribbon-callbacks.h: Update accordingly.

--
There are two ways Outlook can be closed. Either through
a Windowmessage (which wie handled already) or through
the FileClose Command. We now also handle the FileClose
to shutdown.
Doing the shutdown later does not work for us because before
we get any events or shutdown notifications we already have
to close / discard our decrypted contents.

GnuPG-Bug-Id: T4236

8 months agoMinor debug output improvements
Andre Heinecke [Thu, 8 Nov 2018 14:43:36 +0000 (15:43 +0100)]
Minor debug output improvements

--

8 months agoRevert "Add InspectorEvents experiment"
Andre Heinecke [Thu, 8 Nov 2018 14:43:21 +0000 (15:43 +0100)]
Revert "Add InspectorEvents experiment"

This reverts commit db8f468e0462f2a4d600b41f8dd0e6b4135d38fa.

8 months agoAdd InspectorEvents experiment
Andre Heinecke [Thu, 8 Nov 2018 14:42:25 +0000 (15:42 +0100)]
Add InspectorEvents experiment

--
This commit is just an experiment to check the order
of events when closing.

8 months agoAdd some NEWS
Andre Heinecke [Thu, 8 Nov 2018 13:04:23 +0000 (14:04 +0100)]
Add some NEWS

--

8 months agoUse WM_USER without offset for ext messages
Andre Heinecke [Thu, 8 Nov 2018 13:01:40 +0000 (14:01 +0100)]
Use WM_USER without offset for ext messages

* src/windowmessages.cpp,
tests/run-messanger.cpp: Use WM_USER without offset.

--
Some documentation like the wine windowmessages list documents
that above WM_USER messages are still system defined.

8 months agoAdd tracing in shutdown
Andre Heinecke [Thu, 8 Nov 2018 13:01:06 +0000 (14:01 +0100)]
Add tracing in shutdown

* src/gpgoladdin.cpp (GpgolAddin::shutdown): Add tracing.

8 months agoSet validate keylist mode for keycache
Andre Heinecke [Thu, 8 Nov 2018 12:40:30 +0000 (13:40 +0100)]
Set validate keylist mode for keycache

* src/keycache.cpp (do_populate_protocol): Add validate option.

--
This fixes S/MIME keys for verfied signatures to have trust
level 2 (because their trust was unknown) before the key
is first updated.

8 months agoFix 64bit format error
Andre Heinecke [Thu, 8 Nov 2018 12:38:27 +0000 (13:38 +0100)]
Fix 64bit format error

* src/windowmessages.cpp (gpgol_window_proc): Fix message id.

8 months agoAdd external API with WindowMessages
Andre Heinecke [Thu, 8 Nov 2018 12:13:06 +0000 (13:13 +0100)]
Add external API with WindowMessages

* src/windowmessages.cpp: Handle new messages.
* src/windowmessagees.h: Add new codes.
* tests/Makefile.am: Update accordingly.
* tests/run-messenger.cpp: New.

--
The run-messenger can be used as an example how to use
this API. As we block saves while decrypted data is open
we add API to close the mails now. Either all or a specific
uuid.

e.g.:

run-messenger.exe 1301 1147d7ed-22fb-48d2-8678-a814df5009eb

GnuPG-Bug-Id: T4241

8 months agoUpdate POTFILES and po files and de.po
Andre Heinecke [Tue, 6 Nov 2018 10:51:28 +0000 (11:51 +0100)]
Update POTFILES and po files and de.po

--

8 months agoFix infographic url
Andre Heinecke [Tue, 6 Nov 2018 07:56:27 +0000 (08:56 +0100)]
Fix infographic url

* src/ribbon-callbacks.cpp (launch_cert_details): Fix url.

--
The old redirect redirects to 404 :-( Maybe time to
change the infographic.

8 months agoAdd junk mail handling
Andre Heinecke [Tue, 6 Nov 2018 07:54:26 +0000 (08:54 +0100)]
Add junk mail handling

* src/categorymanager.cpp (getJunkMailCategory): New.
* src/mail.cpp (Mail::decryptVerify_o): Handle junk.
* src/mail.h (Mail::m_is_junk): New.

--
Junk mails are special. An addon can't access the attachments
so we can't decrypt PGP-MIME. We just add a marker to let
the user now and register our folder event handler so
that the mail can be moved out of junk.

GnuPG-Bug-Id: T4188

8 months agoAdd junk/spam mail folder detection
Andre Heinecke [Mon, 5 Nov 2018 15:44:00 +0000 (16:44 +0100)]
Add junk/spam mail folder detection

* src/oomhelp.cpp, src/oomhelp.h (is_junk_mail): New.

--
We can't access attachments in junk so we need some special
handling. As there is no "Junk" property we do this by
comparing the entryid of the accounts junk folder with
the actual folder of the mail.

GnuPG-Bug-Id: T4188

8 months agoFix tests build for different gpgmepp prefix
Andre Heinecke [Mon, 5 Nov 2018 08:11:14 +0000 (09:11 +0100)]
Fix tests build for different gpgmepp prefix

* tests/Makefile.am: Add GPGME_CXXFLAGS to CXXFLAGS.

8 months agoFix Linux build of tests
Andre Heinecke [Tue, 30 Oct 2018 08:18:35 +0000 (09:18 +0100)]
Fix Linux build of tests

* src/common_indep.c: Include wchar.h
* src/cpphelp.cpp (in_de_vs_mode): use strcasecm
(get_registry_subkeys): Make conditional.
* src/cpphelp.h: Update accordinlgy.
* src/debug.cpp: Fix unused errors and do locking.
* src/parsecontroller.cpp (ParseController::parse): Remove unused
warning.
* tests/Makefile.am: Add definitions for linux

8 months agoMinor style improvement in run-parser output
Andre Heinecke [Tue, 30 Oct 2018 08:16:22 +0000 (09:16 +0100)]
Minor style improvement in run-parser output

* tests/run-parser.cpp (main): Add some newlines.

8 months agotests: Add repeats option to parser runner
Andre Heinecke [Mon, 29 Oct 2018 12:49:15 +0000 (13:49 +0100)]
tests: Add repeats option to parser runner

* tests/run-parser.cpp: Add repeats option.

8 months agoInitialize memory to X on trace + memdbg
Andre Heinecke [Mon, 29 Oct 2018 10:53:27 +0000 (11:53 +0100)]
Initialize memory to X on trace + memdbg

* src/xmalloc.h (xmalloc): Initialize memory to X on debug
level.

--
This is intended to better find memory errors.

8 months agoFix off by one in iconv_to_utf8
Andre Heinecke [Mon, 29 Oct 2018 10:52:23 +0000 (11:52 +0100)]
Fix off by one in iconv_to_utf8

* src/mlang-charset.cpp (iconv_to_utf8): Inlen needed
to include the zero.

--
This fixes a crash when this function is used for conversion.

8 months agoEnable building tests for windows
Andre Heinecke [Mon, 29 Oct 2018 10:13:08 +0000 (11:13 +0100)]
Enable building tests for windows

* src/debug.cpp: Use platform indepentent gpgrt_locks.
* src/main.c (initialize_main): Drop mutex init.

8 months agoPopulate keycache on startup
Andre Heinecke [Thu, 25 Oct 2018 12:03:36 +0000 (14:03 +0200)]
Populate keycache on startup

* src/gpgoladdin.cpp (GpgolAddin::OnStartupComplete): Populate
keycache.
* src/keycache.cpp (KeyCache::populate, do_populate)
(do_populate_protocol): New.
(KeyCache::getUltimateKeys): New.
* src/mail.cpp (level_4_check): Use getUltimateKeys from cache.
* src/parsecontroller.cpp, src/parsecontroller.h (get_ultimate_keys):
Removed.

--
This moves the ultimate keys cache into the keycache where it
belongs and should fix problems not finding signing keys when
sign always is set. It should also speed up the first verify
operation as keylistings are no longer required.

GnuPG-Bug-Id: T4218

8 months agoRevert "Explicitly set real access key for reg too"
Andre Heinecke [Thu, 25 Oct 2018 10:29:56 +0000 (12:29 +0200)]
Revert "Explicitly set real access key for reg too"

This reverts commit bf4ab9a6d16869aa6083b10b54a77fc9b8b95b41.

8 months agoExplicitly set real access key for reg too
Andre Heinecke [Thu, 25 Oct 2018 10:23:42 +0000 (12:23 +0200)]
Explicitly set real access key for reg too

* src/common.cpp (REAL_ACCESS): Define.

--
We have to make sure that we try both registry views.

8 months agoRead HKLM fallback from cross registry view
Andre Heinecke [Thu, 25 Oct 2018 09:50:58 +0000 (11:50 +0200)]
Read HKLM fallback from cross registry view

* src/addin-options.cpp (open-gpgolconfig): Do not pass w64 again.
* src/common.cpp (CROSS_ACCESS): New define.
(_readRegStr): Helper for readRegStr.
(readRegStr): More explicit fallbacks.

--
This should be more robust to handle cases where either
HKLM is set up as 32 bit registry key or as 64 bit registry
key.

8 months agoUse gpgrt_w32_iconv as fallback for mlang-charset
Andre Heinecke [Thu, 25 Oct 2018 07:15:18 +0000 (09:15 +0200)]
Use gpgrt_w32_iconv as fallback for mlang-charset

* src/mlan-charset.cpp (ansi_charset_to_uf8): Use gpgrt
as a fallback.

--
We only use it as a fallback as the old code is known to work
and we want to avoid regressions in case the charset names
differ between gpgrt and getcharsetinfo.

GnuPG-Bug-Id: T4156

8 months agoPass --w64 parameter to gpgolconfig
Andre Heinecke [Wed, 24 Oct 2018 12:45:33 +0000 (14:45 +0200)]
Pass --w64 parameter to gpgolconfig

* src/addin-options.cpp (open_gpgolconfig): Pass --64 on
64 bit systems.

8 months agoRevert "Add temporary logging to readRegStr"
Andre Heinecke [Wed, 24 Oct 2018 11:16:06 +0000 (13:16 +0200)]
Revert "Add temporary logging to readRegStr"

This reverts commit 0ab051af6406cb877200f651ca23ebf1ead6482a.

8 months agoRevert "Addionally add outputdebugstring debugs"
Andre Heinecke [Wed, 24 Oct 2018 11:15:57 +0000 (13:15 +0200)]
Revert "Addionally add outputdebugstring debugs"

This reverts commit 56ea58e405b57dcc46f6e8a02dd8dca5a619ef31.

8 months agoAddionally add outputdebugstring debugs
Andre Heinecke [Wed, 24 Oct 2018 11:04:39 +0000 (13:04 +0200)]
Addionally add outputdebugstring debugs

--
This commit is also temporary.

8 months agoAdd temporary logging to readRegStr
Andre Heinecke [Wed, 24 Oct 2018 10:53:05 +0000 (12:53 +0200)]
Add temporary logging to readRegStr

* src/common.cpp (readRegStr): Add temporary verbose logging.

--
This will be reverted after a little beta release to debug
an on site issue.

8 months agoPseudonym some more without DBG_DATA
Andre Heinecke [Wed, 24 Oct 2018 10:51:26 +0000 (12:51 +0200)]
Pseudonym some more without DBG_DATA

* src/oomhelp.cpp (get_sender_SentRepresentingAddress):
anonstr.
* src/mimemaker.cpp (write_part): Anonstr filename.

8 months agoOnly log raw crypto data if DBG_DATA is enabled
Andre Heinecke [Tue, 23 Oct 2018 08:55:07 +0000 (10:55 +0200)]
Only log raw crypto data if DBG_DATA is enabled

* src/mimedataprovider.cpp (MimeDataProvider::collect_input_lines):
Change a log_debug to log_data.

--
This can be signed data so it might be a data leak.

8 months agoFix check for debug levels for string debug
Andre Heinecke [Mon, 22 Oct 2018 10:13:48 +0000 (12:13 +0200)]
Fix check for debug levels for string debug

* src/w32-gettext.h (wchar_to_utf8, utf8_to_wchar): Fix enable_debug
check.

--
The broken logic caused the string debugging to be active if one
of the debug levels required was enabled. This caused data
leak even if debug data was disabled.

GnuPG-Bug-Id: T4193

8 months agoFix HKLM fallback for config values
Andre Heinecke [Mon, 22 Oct 2018 09:56:28 +0000 (11:56 +0200)]
Fix HKLM fallback for config values

* src/common.cpp (load_extension_value): Use read_w32_registry_string.
(load_config_value, expand_path): Removed.

--
We don't need two ways to access the registry. And the
load_config_value codepath did not fallback to HKLM.

GnuPG-Bug-Id: T4204

8 months agoPass lang correctly to config dialog
Andre Heinecke [Tue, 16 Oct 2018 12:14:29 +0000 (14:14 +0200)]
Pass lang correctly to config dialog

* src/addin-options.cpp (open_gpgolconfig): Pass lang.

8 months agoPost release version bump
Andre Heinecke [Tue, 16 Oct 2018 10:28:40 +0000 (12:28 +0200)]
Post release version bump

--

8 months agoAuto update po files gpgol-2.3.1
Andre Heinecke [Tue, 16 Oct 2018 10:25:20 +0000 (12:25 +0200)]
Auto update po files

--

8 months agoUpdate NEWS for todays release
Andre Heinecke [Tue, 16 Oct 2018 10:24:35 +0000 (12:24 +0200)]
Update NEWS for todays release

--

8 months agoDo not try to import empty key data from addrbook
Andre Heinecke [Tue, 16 Oct 2018 10:22:47 +0000 (12:22 +0200)]
Do not try to import empty key data from addrbook

* src/keycache.cpp (importFromAddrBook): Check if data
is empty.

8 months agoMake address book lookup more robust
Andre Heinecke [Tue, 16 Oct 2018 10:21:42 +0000 (12:21 +0200)]
Make address book lookup more robust

* src/addressbook.cpp (Addressbook::update_key_o): Clear checked
entries after update.
(Addressbook::check_o): Only mark resolved contacts as checked.
:xa

8 months agoFix memleaks in new category code
Andre Heinecke [Tue, 16 Oct 2018 08:52:57 +0000 (10:52 +0200)]
Fix memleaks in new category code

* src/categorymanager.cpp,
src/oomhelp.cpp (get_store_for_id, delete_category): Fix leaks.

8 months agoFix string alloc tracing
Andre Heinecke [Tue, 16 Oct 2018 08:52:32 +0000 (10:52 +0200)]
Fix string alloc tracing

* src/w32-gettext.h: Fix string alloc trace check

8 months agoUpdate po files and translate german
Andre Heinecke [Tue, 16 Oct 2018 08:38:06 +0000 (10:38 +0200)]
Update po files and translate german

--

8 months agoAdd signature info to verify category
Andre Heinecke [Tue, 16 Oct 2018 08:24:05 +0000 (10:24 +0200)]
Add signature info to verify category

* src/categorymanager.cpp, src/categorymanager.h: New.
* src/Makefile.am: Add it.
* src/cpphelp.cpp, src/cpphelp.h (join): New.
* src/gpgoladdin.cpp, src/gpgoladdin.h
(Gpgoladdin::get_category_mngr): New.
* src/mail.cpp (Mail::~Mail): Remove categories.
(Mail::updateCategories_o): Use new code for categories.
(Mail::storeID): New carry store info.
* src/oomhelp.cpp (create_category): Fix dbg.
(get_store_for_id): New helper.
(ensure_category_exists): Remove need for appl.
(remove_category): Rewrite to allow partial matches.
(_delete_category): New helper.
(delete_category): New. Delete a category.
(delete_all_categories_starting_with): New.
* src/oomhelp.h: Update accordingly.

--
On startup we delete all old categories to cleanup e.g. after
we crashed and a category was left over. The categories
are only created on the stores where they are required and
only temporary as long as the mail is loaded.

As several mails can share the same category we need the
categorymanager to do some ref counting and help a bit.

GnuPG-Bug-Id: T4183

8 months agoMinor indentation fix
Andre Heinecke [Tue, 16 Oct 2018 08:14:21 +0000 (10:14 +0200)]
Minor indentation fix

--

9 months agoPass address book overrides to keyresolver
Andre Heinecke [Mon, 15 Oct 2018 06:59:05 +0000 (08:59 +0200)]
Pass address book overrides to keyresolver

* src/cryptcontroller.cpp (CryptController::resolve_keys): Pass
overrides.
* src/keycache.cpp, src/keycache.h (KeyCache::getOverrides): Expose
overrides directly.

--

GnuPG-Bug-Id: T4122

9 months agoAdd some new strings from the config dialog
Andre Heinecke [Mon, 15 Oct 2018 06:58:33 +0000 (08:58 +0200)]
Add some new strings from the config dialog

* src/addin-options.cpp (i18n_noops): Add / update
config dlg strings.

9 months agoPass preferred protocol to keyresolver
Andre Heinecke [Mon, 15 Oct 2018 06:55:38 +0000 (08:55 +0200)]
Pass preferred protocol to keyresolver

* src/cryptcontroller.cpp (CryptController::resolve_keys): Pass
preferred protocol.

--
GnuPG-Bug-Id: T4178

9 months agoUpdate pt translation
Andre Heinecke [Wed, 10 Oct 2018 06:52:30 +0000 (08:52 +0200)]
Update pt translation

* po/pt.po: Update

--
Thanks Marco A.G.Pinto

9 months agoMake auto import from S/MIME keyserver default off
Andre Heinecke [Tue, 9 Oct 2018 12:23:26 +0000 (14:23 +0200)]
Make auto import from S/MIME keyserver default off

* src/common_indep.h (opt.search_smime_servers): New.
* src/main.c (read_options): Read it.
* src/keycache.cpp (do_locate): Respect it.

--
This also does not do an external search if there
was an OpenPGP certificate found for the recipient and
prefer_smime is not set.

9 months agoImport certs for s/mime autoresolve from keyserver
Andre Heinecke [Tue, 9 Oct 2018 11:58:23 +0000 (13:58 +0200)]
Import certs for s/mime autoresolve from keyserver

* src/keycache.cpp (do_locate): Factor out S/MIME lookup.
(get_extern_smime_keys): New.
(get_local_smime_keys, get_most_valid_key_simple): Factored
out from do_locate.

--
This implements the feature that X509 Certificates are
automatically searched and imported from the keyserver if
they are not available locally or if all local certs
are expired / revoked etc.

GnuPG-Bug-Id: T4174

9 months agoUpdate german translation
Andre Heinecke [Mon, 8 Oct 2018 16:10:00 +0000 (18:10 +0200)]
Update german translation

* po/de.po: Update.

9 months agoAuto update po files
Andre Heinecke [Mon, 8 Oct 2018 16:06:55 +0000 (18:06 +0200)]
Auto update po files

* po/*: Update.

9 months agoTrace parsing some more
Andre Heinecke [Mon, 8 Oct 2018 16:02:26 +0000 (18:02 +0200)]
Trace parsing some more

* src/parsecontroller.cpp (ParseController::parse): Trace
some more.

--
We especially want to know when GpgME calls are finished.

9 months agoTune down an error to an info
Andre Heinecke [Mon, 8 Oct 2018 16:01:09 +0000 (18:01 +0200)]
Tune down an error to an info

* src/keycache.cpp (onUpdateJobDone): Tune down error to
debug.

--
This happens regularly enough if you switch quickly between two mails.

9 months agoAdd new strings for config dialog debug page
Andre Heinecke [Mon, 8 Oct 2018 16:00:29 +0000 (18:00 +0200)]
Add new strings for config dialog debug page

* src/addin-options.cpp (i18n_noops): Add new strings.

9 months agoAdd lock tracing
Andre Heinecke [Mon, 8 Oct 2018 14:13:34 +0000 (16:13 +0200)]
Add lock tracing

* src/debug.h (gpgol_lock, gpgol_unlock): Add tracing makros.
* src/*.cpp: Use them.

--
This adds lock tracing everywhere except memdbg as tracing
there would be too verbose.

Because deadlocks from race conditions are so hard to
debug it's better if we have the capabilities to anylyse them.

9 months agoRevert "Show signer KeyID and UserID for valid mails"
Andre Heinecke [Mon, 8 Oct 2018 13:28:38 +0000 (15:28 +0200)]
Revert "Show signer KeyID and UserID for valid mails"

This reverts commit c186f2832294737ada9de6d23e466c106537676f.

--
This only worked with contacts from the Address book for
other contacts outlook shows:

To help protect your security, the Follow Up flag text has
been hidden. Follow up. Click here to see hidden text.

9 months agoUse mail_map copies for all complex ops
Andre Heinecke [Mon, 8 Oct 2018 13:23:16 +0000 (15:23 +0200)]
Use mail_map copies for all complex ops

* src/mail.cpp (Mail::revertAllMails_o, Mail::wipeAllMails_o),
(Mail::closeAllMails_o): Use copy of the mail map.

--
For any complex operation we can't hold the lock of the
map for the operation as the map might be modified / accessed
from a different thread to complete the operation.

It should not be a big problem with these functions.