Mailing List Archive

[GPGME PATCH] python: simplify Context.decrypt()
In the course of trying to address https://dev.gnupg.org/T4271, i
discovered that gpg.Context.decrypt() has a bit of superfluous code.
This changeset is intended to simplify the code without making any
functional changes.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
---
lang/python/src/core.py | 29 ++---------------------------
1 file changed, 2 insertions(+), 27 deletions(-)

diff --git a/lang/python/src/core.py b/lang/python/src/core.py
index 6e925925..f7e843f1 100644
--- a/lang/python/src/core.py
+++ b/lang/python/src/core.py
@@ -386,13 +386,9 @@ class Context(GpgmeWrapper):
if verify is False:
verify = True
sink_result = True
- else:
- pass
elif isinstance(verify, list) is True:
if len(verify) > 0:
verify_sigs = True
- else:
- pass
else:
verify = True
self.op_decrypt_verify(ciphertext, plaintext)
@@ -447,29 +443,8 @@ class Context(GpgmeWrapper):
if not ok:
missing.append(key)
if missing:
- try:
- raise errors.MissingSignatures(verify_result, missing,
- results=results)
- except errors.MissingSignatures as e:
- raise e
- # mse = e
- # mserr = "gpg.errors.MissingSignatures:"
- # print(mserr, miss_e, "\n")
- # # The full details can then be found in mse.results,
- # # mse.result, mse.missing if necessary.
- # mse_list = []
- # msp = "Missing signatures from: \n".format()
- # print(msp)
- # for key in mse.missing:
- # mse_list.append(key.fpr)
- # msl = []
- # msl.append(key.fpr)
- # for user in key.uids:
- # msl.append(user.name)
- # msl.append(user.email)
- # # msl.append(user.uid)
- # print(" ".join(msl))
- # raise mse
+ raise errors.MissingSignatures(verify_result, missing,
+ results=results)

return results

--
2.19.2


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [GPGME PATCH] python: simplify Context.decrypt() [ In reply to ]
On Wed 2018-11-28 01:25:25 -0500, Daniel Kahn Gillmor wrote:
> In the course of trying to address https://dev.gnupg.org/T4271, i
> discovered that gpg.Context.decrypt() has a bit of superfluous code.
> This changeset is intended to simplify the code without making any
> functional changes.

this is now a part of the branch dkg/fix-T4271 on dev.gnupg.org, which
resolves issue T4271 completely, including adjusting the test suite to
catch it when something like this happens again.

it's a clarification/restructuring of the Context.decrypt() function, so
i'd appreciate review/oversight on the patches in that branch though.
Ben, can i get you take a look at it? and either merge it or tell me
what's wrong? I need to get this fixed in debian soon, because it's
breaking other packages.

Regards,

--dkg