From: Hamish D <dmishd@gmail.com>
To: Sup developer discussion <sup-devel@rubyforge.org>
Subject: [sup-devel] couple more gpg related patches
Date: Thu, 3 Feb 2011 23:27:18 +0000 [thread overview]
Message-ID: <AANLkTiki8LbxGaCLO0m8ENTF_0bMdJfwWyhDTBscrDLq@mail.gmail.com> (raw)
I've uploaded a couple more patches to the gpgme branch and merged
them into next:
* one fixes the fingerprint of untrusted keys
* the other adds "untrusted" to the signature summary line when the
key is untrusted - ie when there is no web of trust from you to that
key.
Patches below for your reading pleasure. Someone tell me if you'd
rather have less detail from me.
Hamish Downer
commit 6f1b9d7e94496543eacc63807b99fa29059ed300
Author: Hamish Downer <dmishd@gmail.com>
Date: Wed Feb 2 21:06:22 2011 +0000
show the FULL key fingerprint, not just the first half
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index 967c09e..978e145 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -313,7 +313,7 @@ private
if signature.validity != GPGME::GPGME_VALIDITY_FULL &&
signature.validity != GPGME::GPGME_VALIDITY_MARGINAL
output_lines << "WARNING: This key is not certified with a
trusted signature!"
output_lines << "There is no indication that the signature
belongs to the owner"
- output_lines << "Full fingerprint is: " + (0..9).map {|i|
signature.fpr[(i*2),2]}.join(":")
+ output_lines << "Full fingerprint is: " + (0..9).map {|i|
signature.fpr[(i*4),4]}.join(":")
else
trusted = true
end
commit 0e1f5e56dc7063104c52f1b2d03a3fd85573bc47
Author: Hamish Downer <dmishd@gmail.com>
Date: Wed Feb 2 21:02:05 2011 +0000
signature summary now states "untrusted" if the signing key is not trusted
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index 5a38f27..967c09e 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -153,16 +153,18 @@ EOS
end
end
+ summary_line =
simplify_sig_line(verify_result.signatures[0].to_s, all_trusted)
+
if all_output_lines.length == 0
Chunk::CryptoNotice.new :valid, "Encrypted message wasn't
signed", all_output_lines
elsif valid
if all_trusted
- Chunk::CryptoNotice.new(:valid,
simplify_sig_line(verify_result.signatures[0].to_s), all_output_lines)
+ Chunk::CryptoNotice.new(:valid, summary_line, all_output_lines)
else
- Chunk::CryptoNotice.new(:valid_untrusted,
simplify_sig_line(verify_result.signatures[0].to_s), all_output_lines)
+ Chunk::CryptoNotice.new(:valid_untrusted, summary_line,
all_output_lines)
end
elsif !unknown
- Chunk::CryptoNotice.new(:invalid,
simplify_sig_line(verify_result.signatures[0].to_s), all_output_lines)
+ Chunk::CryptoNotice.new(:invalid, summary_line, all_output_lines)
else
unknown_status all_output_lines
end
@@ -274,8 +276,12 @@ private
end
# remove the hex key_id and info in ()
- def simplify_sig_line sig_line
- sig_line.sub(/from [0-9A-F]{16} /, "from ")
+ def simplify_sig_line sig_line, trusted
+ sig_line.sub!(/from [0-9A-F]{16} /, "from ")
+ if !trusted
+ sig_line.sub!(/Good signature/, "Good (untrusted) signature")
+ end
+ sig_line
end
def sig_output_lines signature
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
reply other threads:[~2011-02-03 23:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTiki8LbxGaCLO0m8ENTF_0bMdJfwWyhDTBscrDLq@mail.gmail.com \
--to=dmishd@gmail.com \
--cc=sup-devel@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox