[git] GpgOL - branch, master, updated. gpgol-1.2.0-71-g4da36c8
by Andre Heinecke
cvs at cvs.gnupg.org
Wed Oct 21 15:11:47 CEST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".
The branch, master has been updated
via 4da36c8755eb25291c8e21b43e0d6005e45e1d41 (commit)
via 3ab33db5689818195f095bdae7a7509f96d67fce (commit)
from b5c358e535504d391651bb411eee24fd9a29698c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4da36c8755eb25291c8e21b43e0d6005e45e1d41
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Wed Oct 21 15:08:53 2015 +0200
Make old decrypt / verify buttons work with mime
* src/ribbon-callbacks.cpp (verify_mime): New. Force message handling
again.
(do_reader_action): Call verify_mime on action and print info
on decrypt.
--
I've tried to set the body to the plain text again and decrypt
the attachments in that case too. But It's no good. There are
several issues with it. We can't reliably detect if we need
to wipe the message as outlook sometimes does not give us the
MAPI Object in the write event. And Attachments are not properly
updated after decryption.
The Read event still appears the only place for us to correctly
insert the plain text.
diff --git a/src/ribbon-callbacks.cpp b/src/ribbon-callbacks.cpp
index dff6a74..8af2a30 100644
--- a/src/ribbon-callbacks.cpp
+++ b/src/ribbon-callbacks.cpp
@@ -46,6 +46,7 @@
#include "mimemaker.h"
#include "filetype.h"
#include "gpgolstr.h"
+#include "message.h"
/* Gets the context of a ribbon control. And prints some
useful debug output */
@@ -574,6 +575,26 @@ decryptAttachments (LPDISPATCH ctrl)
callback function failed in an ugly window. */
}
+/* MIME erify mail helper. Returns 0 if it
+ was not called with a MIME crypto message or on error. */
+static int
+verify_mime (LPDISPATCH mailitem)
+{
+ int ret = 0;
+
+ LPMESSAGE message = get_oom_base_message (mailitem);
+ if (!message)
+ {
+ log_error ("%s:%s: Failed to get the base message",
+ SRCNAME, __func__);
+ return 0;
+ }
+ ret = message_incoming_handler (message, NULL, true /*force */);
+ message->Release ();
+
+ return ret;
+}
+
/* do_reader_action
decrypts the content of an inspector. Controled by flags
similary to the do_composer_action.
@@ -653,6 +674,23 @@ do_reader_action (LPDISPATCH ctrl, int flags)
}
}
+ if (verify_mime (mailItem))
+ {
+ log_debug ("%s:%s: This was a mime message.",
+ SRCNAME, __func__);
+
+ if (flags & OP_DECRYPT)
+ {
+ MessageBox (NULL,
+ "This message is in MIME format. Due to technical restrictions "
+ "it can only be decrypted once per session. To decrypt it again "
+ "please restart Outlook and open the message.",
+ _("GpgOL"),
+ MB_ICONINFORMATION|MB_OK);
+ }
+ goto failure;
+ }
+
if (flags & DATA_SELECTION)
{
encData = get_oom_string (selection, "Text");
commit 3ab33db5689818195f095bdae7a7509f96d67fce
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Wed Oct 21 14:22:16 2015 +0200
Fix crash on attachment decryption
* src/attachment.cpp (do_crypt): Check return value of mapiobject.
--
It appears that sometimes a "Ghost" attachment is listed
by outlook. That attachment does not have a Mapiobject or
GpgOL properties attached to it. So we ignore it.
diff --git a/src/attachment.cpp b/src/attachment.cpp
index b7e7102..66588d5 100644
--- a/src/attachment.cpp
+++ b/src/attachment.cpp
@@ -294,6 +294,13 @@ do_crypt (LPDISPATCH mailitem, bool protect)
}
mapi_attachment = (LPATTACH) get_oom_iunknown (attachment,
"MapiObject");
+ if (!mapi_attachment)
+ {
+ log_debug ("%s:%s: Failed to get MapiObject of attachment: %p",
+ SRCNAME, __func__, attachment);
+ attachment->Release ();
+ continue;
+ }
att_type = get_gpgolattachtype (mapi_attachment, tag_id);
if ((protect && att_type == ATTACHTYPE_FROMMOSS_DEC) ||
-----------------------------------------------------------------------
Summary of changes:
src/attachment.cpp | 7 +++++++
src/ribbon-callbacks.cpp | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+)
hooks/post-receive
--
GnuPG extension for MS Outlook
http://git.gnupg.org
More information about the Gnupg-commits
mailing list