[git] GPGME - branch, ben/howto-dita, updated. gpgme-1.11.1-14-gdea1ccb
by Ben McGinnes
cvs at cvs.gnupg.org
Wed May 23 07:11:30 CEST 2018
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 Made Easy".
The branch, ben/howto-dita has been updated
via dea1ccbc02cafe1c85c8945605d9bb9f46cc5790 (commit)
from 27ae87c7cf2c3de0ddb3a541dd582972717cc307 (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 dea1ccbc02cafe1c85c8945605d9bb9f46cc5790
Author: Ben McGinnes <ben at adversary.org>
Date: Wed May 23 15:08:03 2018 +1000
docs: python bindings howto DITA
* Updated the decryption example code to include the changes needed to
gracefully handle a decryption failure due to MDC-less ciphertext
and/or deprecated algorithms.
* See also: https://dev.gnupg.org/T3981
diff --git a/lang/python/docs/dita/howto/part04/decryption.dita b/lang/python/docs/dita/howto/part04/decryption.dita
index 4261e69..41a4650 100644
--- a/lang/python/docs/dita/howto/part04/decryption.dita
+++ b/lang/python/docs/dita/howto/part04/decryption.dita
@@ -17,10 +17,17 @@ ciphertext = input("Enter path and filename of encrypted file: ")
newfile = input("Enter path and filename of file to save decrypted data to: ")
with open(ciphertext, "rb") as cfile:
- plaintext, result, verify_result = gpg.Context().decrypt(cfile)
+ try:
+ plaintext, result, verify_result = gpg.Context().decrypt(cfile)
+ except gpg.errors.GPGMEError as e:
+ plaintext = None
+ print(e)
-with open(newfile, "wb") as nfile:
- nfile.write(plaintext)
+if plaintext is not None:
+ with open(newfile, "wb") as nfile:
+ nfile.write(plaintext)
+else:
+ pass
</codeblock>
</p>
<p>The data available in <codeph>plaintext</codeph> in this example is the decrypted content
-----------------------------------------------------------------------
Summary of changes:
lang/python/docs/dita/howto/part04/decryption.dita | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
hooks/post-receive
--
GnuPG Made Easy
http://git.gnupg.org
More information about the Gnupg-commits
mailing list