From 32a8996fe82dda3a865204bf370ed3606ebf2f83 Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Tue, 11 Aug 2015 16:40:44 -0400 Subject: [PATCH] don't complain about missing signatures the emailselfdefence guide asks users to encrypt messages without a signature first. it would be confusing to get a message about a missing signature before a user knows what a signature is. --- edward | 6 +++++- tests/flatten-4.out | 2 -- tests/flatten-5.out | 2 -- tests/flatten-6.out | 2 -- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/edward b/edward index 2ac1e61..35312c8 100755 --- a/edward +++ b/edward @@ -192,6 +192,8 @@ class ReplyInfo (object): 'sig_success' is set to True if edward could to some extent verify the signature of a signed part of the message to edward. + 'sig_failure' is set to True if edward could not verify a siganture. + 'pubkey_success' is set to True if edward successfully imported a public key. @@ -213,6 +215,7 @@ class ReplyInfo (object): sig_success = False pubkey_success = False + sig_failure = False sigkey_missing = False have_reply_key = False @@ -793,6 +796,7 @@ def prepare_for_reply_sig (piece, replyinfo_obj): """ if piece.gpg_data == None or piece.gpg_data.sigs == []: + replyinfo_obj.sig_failure = True if piece.gpg_data.sigkey_missing == True: replyinfo_obj.sigkey_missing = True @@ -936,7 +940,7 @@ def write_reply (replyinfo_obj): reply_plain += replyinfo_obj.replies['sig_success'] reply_plain += "\n\n" - else: + elif replyinfo_obj.sig_failure == True: debug('signature failure') reply_plain += replyinfo_obj.replies['sig_failure'] reply_plain += "\n\n" diff --git a/tests/flatten-4.out b/tests/flatten-4.out index 9374801..95c79bf 100644 --- a/tests/flatten-4.out +++ b/tests/flatten-4.out @@ -1,7 +1,5 @@ I'm sorry, I was not able to decrypt your message. Are you sure you encrypted it with my public key? -Your signature could not be verified. - - Edward, the friendly GnuPG bot The Free Software Foundation created me. diff --git a/tests/flatten-5.out b/tests/flatten-5.out index 9374801..95c79bf 100644 --- a/tests/flatten-5.out +++ b/tests/flatten-5.out @@ -1,7 +1,5 @@ I'm sorry, I was not able to decrypt your message. Are you sure you encrypted it with my public key? -Your signature could not be verified. - - Edward, the friendly GnuPG bot The Free Software Foundation created me. diff --git a/tests/flatten-6.out b/tests/flatten-6.out index 9374801..95c79bf 100644 --- a/tests/flatten-6.out +++ b/tests/flatten-6.out @@ -1,7 +1,5 @@ I'm sorry, I was not able to decrypt your message. Are you sure you encrypted it with my public key? -Your signature could not be verified. - - Edward, the friendly GnuPG bot The Free Software Foundation created me. -- 2.25.1