[git] GpgOL - branch, master, updated. gpgol-1.1.3-59-g94e0c02
by Andre Heinecke
cvs at cvs.gnupg.org
Thu Aug 8 19:51:06 CEST 2013
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 94e0c024ce44bb6a6c62647c806b55f4c26cf9a6 (commit)
via b867c7a12fc2e8436f358d02dcdfbc38dada710d (commit)
via 82c9d671ed9dc56c04ceb56eb7ebb44884da4698 (commit)
from c607ce5551ec261b0c51daf10c32142cd7c60eb2 (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 94e0c024ce44bb6a6c62647c806b55f4c26cf9a6
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Thu Aug 8 17:18:33 2013 +0000
Add verify action for opaque signatures
This is at least minimal signature support and the most
robust way because we can avoid data sanitizing.
* src/verify-48.png: New.
* src/Makefile.am (EXTRA_DIST): Add verify png
* src/dialogs.h, src/dialogs.rc: Add verify png
* src/gpgoladdin.cpp (GetIDsOfNames, Invoke, GetCustomUI):
Add and handle verify action to the reader.
* src/ribbon-callbacks.cpp (decryptInspector, do_reader_action):
Renamed. Do reader action now works similar to the
do_composer_action.
(do_composer_action): Add support for verify
(verifyBody): New.
* src/ribbon-callbacks.h: Update accordingly.
diff --git a/src/Makefile.am b/src/Makefile.am
index c61a5d6..76d1dc6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,7 +34,7 @@ EXTRA_DIST = \
key-manager-64.png \
decrypt-16.png decrypt-48.png \
encrypt-sign-file-48.png \
- sign-48.png \
+ sign-48.png verify-48.png \
logo.bmp README.icons
EXEEXT = .dll
diff --git a/src/dialogs.h b/src/dialogs.h
index 7da915a..aec411c 100644
--- a/src/dialogs.h
+++ b/src/dialogs.h
@@ -142,5 +142,6 @@
#define IDI_KEY_MANAGER_64_PNG 6020
#define IDI_ENCSIGN_FILE_48_PNG 6030
#define IDI_SIGN_48_PNG 6040
+#define IDI_VERIFY_48_PNG 6050
#endif /*DIALOGS_H*/
diff --git a/src/dialogs.rc b/src/dialogs.rc
index 48ab013..dc88866 100644
--- a/src/dialogs.rc
+++ b/src/dialogs.rc
@@ -55,6 +55,7 @@ IDB_VERIFY_16 BITMAP DISCARDABLE "verify-16.bmp"
IDB_VERIFY_16M BITMAP DISCARDABLE "verify-16m.bmp"
IDB_VERIFY_32 BITMAP DISCARDABLE "verify-32.bmp"
IDB_VERIFY_32M BITMAP DISCARDABLE "verify-32m.bmp"
+IDI_VERIFY_48_PNG RCDATA "verify-48.png"
IDB_DECRYPT_VERIFY_16 BITMAP DISCARDABLE "decrypt-verify-16.bmp"
IDB_DECRYPT_VERIFY_16M BITMAP DISCARDABLE "decrypt-verify-16m.bmp"
diff --git a/src/gpgoladdin.cpp b/src/gpgoladdin.cpp
index 9a01221..4bb6e22 100644
--- a/src/gpgoladdin.cpp
+++ b/src/gpgoladdin.cpp
@@ -452,11 +452,13 @@ GpgolRibbonExtender::GetIDsOfNames (REFIID riid, LPOLESTR *rgszNames,
ID_MAPPER (L"btnEncryptLarge", ID_BTN_ENCRYPT_LARGE)
ID_MAPPER (L"btnEncryptFileLarge", ID_BTN_ENCSIGN_LARGE)
ID_MAPPER (L"btnSignLarge", ID_BTN_SIGN_LARGE)
+ ID_MAPPER (L"btnVerifyLarge", ID_BTN_VERIFY_LARGE)
ID_MAPPER (L"encryptBody", ID_CMD_ENCRYPT_BODY)
ID_MAPPER (L"decryptBody", ID_CMD_DECRYPT_BODY)
ID_MAPPER (L"addEncSignedAttachment", ID_CMD_ATT_ENCSIGN_FILE)
ID_MAPPER (L"addEncAttachment", ID_CMD_ATT_ENC_FILE)
ID_MAPPER (L"signBody", ID_CMD_SIGN_BODY)
+ ID_MAPPER (L"verifyBody", ID_CMD_VERIFY_BODY)
}
if (cNames > 1)
@@ -504,6 +506,8 @@ GpgolRibbonExtender::Invoke (DISPID dispid, REFIID riid, LCID lcid,
return addEncAttachment (parms->rgvarg[0].pdispVal);
case ID_CMD_SIGN_BODY:
return signBody (parms->rgvarg[0].pdispVal);
+ case ID_CMD_VERIFY_BODY:
+ return verifyBody (parms->rgvarg[0].pdispVal);
case ID_BTN_CERTMANAGER:
case ID_BTN_ENCRYPT:
case ID_BTN_DECRYPT:
@@ -511,6 +515,7 @@ GpgolRibbonExtender::Invoke (DISPID dispid, REFIID riid, LCID lcid,
case ID_BTN_ENCRYPT_LARGE:
case ID_BTN_ENCSIGN_LARGE:
case ID_BTN_SIGN_LARGE:
+ case ID_BTN_VERIFY_LARGE:
return getIcon (dispid, result);
}
@@ -637,6 +642,11 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
L" size=\"large\""
L" label=\"%S\""
L" onAction=\"decryptBody\"/>"
+ L" <button id=\"fullTextVerify\""
+ L" getImage=\"btnVerifyLarge\""
+ L" size=\"large\""
+ L" label=\"%S\""
+ L" onAction=\"verifyBody\"/>"
L" </group>"
L" </tab>"
L" </tabs>"
@@ -671,6 +681,7 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
L"</customUI>",
_("GpgOL"), _("General"), _("Start Certificate Manager"),
_("Textbody"), _("Decrypt"),
+ _("Verify"),
_("GpgOL"), _("Save and decrypt"),
_("Decrypt"),
_("Decrypt"));
diff --git a/src/ribbon-callbacks.cpp b/src/ribbon-callbacks.cpp
index 8b02ece..8fe2715 100644
--- a/src/ribbon-callbacks.cpp
+++ b/src/ribbon-callbacks.cpp
@@ -58,6 +58,8 @@ HRESULT getContext (LPDISPATCH ctrl, LPDISPATCH *context)
#define OP_ENCRYPT 1 /* Encrypt the data */
#define OP_SIGN 2 /* Sign the data */
+#define OP_DECRYPT 1 /* Decrypt the data */
+#define OP_VERIFY 2 /* Verify the data */
#define DATA_BODY 4 /* Use text body as data */
#define DATA_SELECTION 8 /* Use selection as data */
@@ -557,16 +559,13 @@ decryptAttachments (LPDISPATCH ctrl)
callback function failed in an ugly window. */
}
-#define DECRYPT_INSPECTOR_SELECTION 1
-#define DECRYPT_INSPECTOR_BODY 2
-
-/* decryptInspector
+/* do_reader_action
decrypts the content of an inspector. Controled by flags
similary to the do_composer_action.
*/
HRESULT
-decryptInspector (LPDISPATCH ctrl, int flags)
+do_reader_action (LPDISPATCH ctrl, int flags)
{
LPDISPATCH context = NULL;
LPDISPATCH selection = NULL;
@@ -602,7 +601,7 @@ decryptInspector (LPDISPATCH ctrl, int flags)
curWindow = get_oom_context_window (context);
- if (!(flags & DECRYPT_INSPECTOR_BODY))
+ if (!(flags & DATA_BODY))
{
wordEditor = get_oom_object (context, "WordEditor");
wordApplication = get_oom_object (wordEditor, "get_Application");
@@ -611,7 +610,7 @@ decryptInspector (LPDISPATCH ctrl, int flags)
mailItem = get_oom_object (context, "CurrentItem");
if ((!wordEditor || !wordApplication || !selection || !mailItem) &&
- !(flags & DECRYPT_INSPECTOR_BODY))
+ !(flags & DATA_BODY))
{
MessageBox (NULL,
"Internal error in GpgOL.\n"
@@ -639,7 +638,7 @@ decryptInspector (LPDISPATCH ctrl, int flags)
}
}
- if (flags & DECRYPT_INSPECTOR_SELECTION)
+ if (flags & DATA_SELECTION)
{
encData = get_oom_string (selection, "Text");
@@ -652,7 +651,7 @@ decryptInspector (LPDISPATCH ctrl, int flags)
goto failure;
}
}
- else if (flags & DECRYPT_INSPECTOR_BODY)
+ else if (flags & DATA_BODY)
{
encData = get_oom_string (mailItem, "Body");
@@ -701,13 +700,27 @@ decryptInspector (LPDISPATCH ctrl, int flags)
engine_set_session_number (filter, session_number);
engine_set_session_title (filter, subject ? subject : _("GpgOL"));
- if ((rc=engine_decrypt_start (filter, curWindow,
- protocol,
- 1, NULL)))
+ if (flags & OP_DECRYPT)
{
- log_error ("%s:%s: engine decrypt start failed: %s",
- SRCNAME, __func__, gpg_strerror (rc));
- goto failure;
+ if ((rc=engine_decrypt_start (filter, curWindow,
+ protocol,
+ 1, NULL)))
+ {
+ log_error ("%s:%s: engine decrypt start failed: %s",
+ SRCNAME, __func__, gpg_strerror (rc));
+ goto failure;
+ }
+ }
+ else if (flags & OP_VERIFY)
+ {
+ log_debug ("Starting verify");
+ if ((rc=engine_verify_start (filter, curWindow,
+ NULL, 0, protocol, senderAddr)))
+ {
+ log_error ("%s:%s: engine verify start failed: %s",
+ SRCNAME, __func__, gpg_strerror (rc));
+ goto failure;
+ }
}
/* Write the text in the decryption sink. */
@@ -768,11 +781,11 @@ decryptInspector (LPDISPATCH ctrl, int flags)
/* Now replace the crypto data with the decrypted data or show it
somehow.*/
int err = 0;
- if (flags & DECRYPT_INSPECTOR_SELECTION)
+ if (flags & DATA_SELECTION)
{
err = put_oom_string (selection, "Text", buffer);
}
- else if (flags & DECRYPT_INSPECTOR_BODY)
+ else if (flags & DATA_BODY)
{
err = put_oom_string (mailItem, "Body", buffer);
}
@@ -780,7 +793,8 @@ decryptInspector (LPDISPATCH ctrl, int flags)
if (err)
{
MessageBox (NULL, buffer,
- _("Plain text"),
+ flags & OP_DECRYPT ? _("Plain text") :
+ _("Signed text"),
MB_ICONINFORMATION|MB_OK);
}
}
@@ -1138,13 +1152,13 @@ startCertManager (LPDISPATCH ctrl)
HRESULT
decryptBody (LPDISPATCH ctrl)
{
- return decryptInspector (ctrl, DECRYPT_INSPECTOR_BODY);
+ return do_reader_action (ctrl, OP_DECRYPT | DATA_BODY);
}
HRESULT
decryptSelection (LPDISPATCH ctrl)
{
- return decryptInspector (ctrl, DECRYPT_INSPECTOR_SELECTION);
+ return do_reader_action (ctrl, OP_DECRYPT | DATA_SELECTION);
}
HRESULT
@@ -1175,3 +1189,8 @@ HRESULT signBody (LPDISPATCH ctrl)
{
return do_composer_action (ctrl, DATA_BODY | OP_SIGN);
}
+
+HRESULT verifyBody (LPDISPATCH ctrl)
+{
+ return do_reader_action (ctrl, DATA_BODY | OP_VERIFY);
+}
diff --git a/src/ribbon-callbacks.h b/src/ribbon-callbacks.h
index ed5961e..0f46af4 100644
--- a/src/ribbon-callbacks.h
+++ b/src/ribbon-callbacks.h
@@ -35,6 +35,7 @@
#define ID_CMD_ATT_ENCSIGN_FILE 9
#define ID_CMD_SIGN_BODY 10
#define ID_CMD_ATT_ENC_FILE 11
+#define ID_CMD_VERIFY_BODY 12
#define ID_BTN_CERTMANAGER IDI_KEY_MANAGER_64_PNG
#define ID_BTN_DECRYPT IDI_DECRYPT_16_PNG
@@ -43,6 +44,7 @@
#define ID_BTN_ENCRYPT_LARGE IDI_ENCRYPT_48_PNG
#define ID_BTN_ENCSIGN_LARGE IDI_ENCSIGN_FILE_48_PNG
#define ID_BTN_SIGN_LARGE IDI_SIGN_48_PNG
+#define ID_BTN_VERIFY_LARGE IDI_VERIFY_48_PNG
HRESULT decryptAttachments (LPDISPATCH ctrl);
HRESULT encryptSelection (LPDISPATCH ctrl);
@@ -54,4 +56,5 @@ HRESULT addEncAttachment (LPDISPATCH ctrl);
HRESULT getIcon (int id, VARIANT* result);
HRESULT startCertManager (LPDISPATCH ctrl);
HRESULT signBody (LPDISPATCH ctrl);
+HRESULT verifyBody (LPDISPATCH ctrl);
#endif
diff --git a/src/verify-48.png b/src/verify-48.png
new file mode 100644
index 0000000..304df7f
Binary files /dev/null and b/src/verify-48.png differ
commit b867c7a12fc2e8436f358d02dcdfbc38dada710d
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Thu Aug 8 16:21:06 2013 +0000
Add Action to add encrypted attachment without sig
Adds a new Action to add an encrypted attachment
without the signature.
* src/gpgoladdin.cpp (GetIDsOfNames, Invoke): Add callback
handling.
(GetCustomUI): Add new UI for action.
* src/ribbon-callbacks.cpp, src/ribbon-callbacks.h
(addEncAttachment): New.
diff --git a/src/gpgoladdin.cpp b/src/gpgoladdin.cpp
index 35e1f72..9a01221 100644
--- a/src/gpgoladdin.cpp
+++ b/src/gpgoladdin.cpp
@@ -455,6 +455,7 @@ GpgolRibbonExtender::GetIDsOfNames (REFIID riid, LPOLESTR *rgszNames,
ID_MAPPER (L"encryptBody", ID_CMD_ENCRYPT_BODY)
ID_MAPPER (L"decryptBody", ID_CMD_DECRYPT_BODY)
ID_MAPPER (L"addEncSignedAttachment", ID_CMD_ATT_ENCSIGN_FILE)
+ ID_MAPPER (L"addEncAttachment", ID_CMD_ATT_ENC_FILE)
ID_MAPPER (L"signBody", ID_CMD_SIGN_BODY)
}
@@ -499,6 +500,8 @@ GpgolRibbonExtender::Invoke (DISPID dispid, REFIID riid, LCID lcid,
return decryptBody (parms->rgvarg[0].pdispVal);
case ID_CMD_ATT_ENCSIGN_FILE:
return addEncSignedAttachment (parms->rgvarg[0].pdispVal);
+ case ID_CMD_ATT_ENC_FILE:
+ return addEncAttachment (parms->rgvarg[0].pdispVal);
case ID_CMD_SIGN_BODY:
return signBody (parms->rgvarg[0].pdispVal);
case ID_BTN_CERTMANAGER:
@@ -573,6 +576,11 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
L" </group>"
L" <group id=\"attachmentGroup\""
L" label=\"%S\">"
+ L" <button id=\"encryptedFile\""
+ L" getImage=\"btnEncryptLarge\""
+ L" size=\"large\""
+ L" label=\"%S\""
+ L" onAction=\"addEncAttachment\"/>"
L" <button id=\"encryptSignFile\""
L" getImage=\"btnEncryptFileLarge\""
L" size=\"large\""
@@ -601,6 +609,7 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
_("Decrypt"),
_("Sign"),
_("Attachments"),
+ _("Encrypted file"),
_("Encrypted file and Signature"),
_("Encrypt"), _("Decrypt")
);
diff --git a/src/ribbon-callbacks.cpp b/src/ribbon-callbacks.cpp
index 9884a29..8b02ece 100644
--- a/src/ribbon-callbacks.cpp
+++ b/src/ribbon-callbacks.cpp
@@ -1165,6 +1165,12 @@ addEncSignedAttachment (LPDISPATCH ctrl)
return attachEncryptedFile (ctrl, OP_SIGN);
}
+HRESULT
+addEncAttachment (LPDISPATCH ctrl)
+{
+ return attachEncryptedFile (ctrl, 0);
+}
+
HRESULT signBody (LPDISPATCH ctrl)
{
return do_composer_action (ctrl, DATA_BODY | OP_SIGN);
diff --git a/src/ribbon-callbacks.h b/src/ribbon-callbacks.h
index fa6d63c..ed5961e 100644
--- a/src/ribbon-callbacks.h
+++ b/src/ribbon-callbacks.h
@@ -34,6 +34,7 @@
#define ID_CMD_DECRYPT_BODY 8
#define ID_CMD_ATT_ENCSIGN_FILE 9
#define ID_CMD_SIGN_BODY 10
+#define ID_CMD_ATT_ENC_FILE 11
#define ID_BTN_CERTMANAGER IDI_KEY_MANAGER_64_PNG
#define ID_BTN_DECRYPT IDI_DECRYPT_16_PNG
@@ -49,6 +50,7 @@ HRESULT decryptSelection (LPDISPATCH ctrl);
HRESULT decryptBody (LPDISPATCH ctrl);
HRESULT encryptBody (LPDISPATCH ctrl);
HRESULT addEncSignedAttachment (LPDISPATCH ctrl);
+HRESULT addEncAttachment (LPDISPATCH ctrl);
HRESULT getIcon (int id, VARIANT* result);
HRESULT startCertManager (LPDISPATCH ctrl);
HRESULT signBody (LPDISPATCH ctrl);
commit 82c9d671ed9dc56c04ceb56eb7ebb44884da4698
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Thu Aug 8 16:17:53 2013 +0000
Use correct filename for the signature
This uses the name of the encrypted file as the basename
for the signature and not the name of the original file.
* src/ribbon-callbacks.cpp (attachSignature, attachEncryptedFile):
Use correct filename for signature.
diff --git a/src/ribbon-callbacks.cpp b/src/ribbon-callbacks.cpp
index 9ebc1d2..9884a29 100644
--- a/src/ribbon-callbacks.cpp
+++ b/src/ribbon-callbacks.cpp
@@ -89,7 +89,7 @@ copyFileToSink (HANDLE hFile, sink_t sink)
static int
attachSignature (LPDISPATCH mailItem, char *subject, HANDLE hFileToSign,
protocol_t protocol, unsigned int session_number,
- HWND curWindow, wchar_t *originalFilename, char *sender)
+ HWND curWindow, wchar_t *fileNameToSign, char *sender)
{
wchar_t *sigName = NULL;
wchar_t *sigFileName = NULL;
@@ -117,7 +117,7 @@ attachSignature (LPDISPATCH mailItem, char *subject, HANDLE hFileToSign,
if (engine_sign_start (filter, curWindow, protocol, sender, &protocol))
goto failure;
- sigName = get_pretty_attachment_name (originalFilename, protocol, 1);
+ sigName = get_pretty_attachment_name (fileNameToSign, protocol, 1);
/* If we are unlucky the number of temporary file artifacts might
differ for the signature and the encrypted file but we have
@@ -1085,7 +1085,7 @@ attachEncryptedFile (LPDISPATCH ctrl, int flags)
if (flags & OP_SIGN)
{
attachSignature (mailItem, subject, hEncFile, protocol, session_number,
- curWindow, fileToEncryptW, senderAddr);
+ curWindow, encryptedFile, senderAddr);
}
failure:
-----------------------------------------------------------------------
Summary of changes:
src/Makefile.am | 2 +-
src/dialogs.h | 1 +
src/dialogs.rc | 1 +
src/gpgoladdin.cpp | 20 +++++++++++++
src/ribbon-callbacks.cpp | 71 +++++++++++++++++++++++++++++++---------------
src/ribbon-callbacks.h | 5 +++
src/verify-48.png | Bin 0 -> 3465 bytes
7 files changed, 76 insertions(+), 24 deletions(-)
create mode 100644 src/verify-48.png
hooks/post-receive
--
GnuPG extension for MS Outlook
http://git.gnupg.org
More information about the Gnupg-commits
mailing list