From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.42.240.136 with SMTP id la8cs63860icb; Thu, 3 Feb 2011 15:53:37 -0800 (PST) Received: by 10.236.111.38 with SMTP id v26mr1427931yhg.18.1296777216831; Thu, 03 Feb 2011 15:53:36 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id y31si109961vcl.152.2011.02.03.15.53.36; Thu, 03 Feb 2011 15:53:36 -0800 (PST) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 445DA19782DC; Thu, 3 Feb 2011 18:53:36 -0500 (EST) Received: from mail-qy0-f171.google.com (mail-qy0-f171.google.com [209.85.216.171]) by rubyforge.org (Postfix) with ESMTP id 829A21858354 for ; Thu, 3 Feb 2011 18:27:18 -0500 (EST) Received: by qyk32 with SMTP id 32so7151493qyk.2 for ; Thu, 03 Feb 2011 15:27:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=DPJlchUPvcvnezrU/wNeTY9+UnMcW3eSbPsX/w2ZCwc=; b=lRNKtyt1WSp0hEmr8CIuOlXUDZXvg1eO9OHd9fIS0h6zKZfALVK0rF2hW//5r9C+0o e/oFIXpaxtfCsEA0liU3ccn0DZMbTg9FBUWEptTj3m2/8wqe1V+tdTNfVPzcgg8uDOTj QjYz12GWscU1yR2HYZ39OTjl314XK8b6s/NxQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=SeAxFXVFN/Yz0Yiv/NWa0IfGfGeh2BDXbHLsp7iPwS+m7wTh97CyhGvMagod7t/PLN 9q9rNf0XZc7j2BXNPrpMKXLfQ6cf+kQAX3P3UZziu+/3IkZRNVVoa4T7lJkt6/kmkxSq 9c8W22B9KlY7MdWBoEfdOZng+WXFjl9lSoeNY= MIME-Version: 1.0 Received: by 10.229.184.208 with SMTP id cl16mr9638280qcb.216.1296775638123; Thu, 03 Feb 2011 15:27:18 -0800 (PST) Received: by 10.229.218.79 with HTTP; Thu, 3 Feb 2011 15:27:18 -0800 (PST) Date: Thu, 3 Feb 2011 23:27:18 +0000 Message-ID: From: Hamish D To: Sup developer discussion Subject: [sup-devel] couple more gpg related patches X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org 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 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 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