From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.96.157.163 with SMTP id wn3csp11122qdb; Sat, 10 May 2014 01:55:59 -0700 (PDT) X-Received: by 10.182.107.232 with SMTP id hf8mr848098obb.75.1399712159542; Sat, 10 May 2014 01:55:59 -0700 (PDT) Return-Path: Received: from rubyforge.org ([50.56.192.79]) by mx.google.com with ESMTP id wi8si4780739obc.56.2014.05.10.01.55.59 for ; Sat, 10 May 2014 01:55:59 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 50.56.192.79 as permitted sender) client-ip=50.56.192.79; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 50.56.192.79 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 806ED2E1BD; Sat, 10 May 2014 08:55:59 +0000 (UTC) X-Greylist: delayed 1710 seconds by postgrey-1.31 at rubyforge; Sat, 10 May 2014 08:51:48 UTC Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by rubyforge.org (Postfix) with ESMTP id B67FB2E18C for ; Sat, 10 May 2014 08:51:48 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id ld10so5473880pab.3 for ; Sat, 10 May 2014 01:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent :content-transfer-encoding:mime-version:content-type; bh=lYV4memYmLHL0lsbxkJqQ1FwLQPONgbgDsGMl63SaAA=; b=gbA8eeyGTNz1ftJ47UsSmGR2vBppP8oo9jBgQw4DacybiPNvd7d+3QseOwJX6NeWEw AwHgLR8iFMNUIwMDQjXFyQmfT9gM2FcbKmRv1zAFNxHOSMerdiDU5FyxgjKVmSlt7G0p in9ZaBwfq4ZQCibqX4n2Tf36oCzd8050c5/G40dtDL0ilzyMUl8QiJDFW6W472bHfLJT Lsn3yDApFW6cLTp/RS/tWBtErXtp+41X3W8x7PqTMvMF6kVQh2MUSAXM46cxiFCyIU8M xpRpt8nNS1PYqc+4j8E8JzTcXQ2QWfF1xNtqJsLWOurq/k7Pwhmr+ckp6rIU5+BVp+GY kQrA== X-Received: by 10.66.219.6 with SMTP id pk6mr30130764pac.9.1399710193602; Sat, 10 May 2014 01:23:13 -0700 (PDT) Received: from localhost (cpe-75-85-58-98.socal.res.rr.com. [75.85.58.98]) by mx.google.com with ESMTPSA id pr4sm11537683pbb.53.2014.05.10.01.23.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 May 2014 01:23:12 -0700 (PDT) From: Troy Sankey To: sup-devel Date: Sat, 10 May 2014 01:23:11 -0700 Message-Id: <1399708417-sup-4178@ultralap.site> User-Agent: Sup/0.17.0 MIME-Version: 1.0 Subject: [sup-devel] check keys before sending 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: multipart/mixed; boundary="===============0812392901499217787==" Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org --===============0812392901499217787== Content-Transfer-Encoding: 8bit Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=-1399710191-353983-3522-1042-4-=" --=-1399710191-353983-3522-1042-4-= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi sup developers, Recently I sent an encrypted message to a group of recipients, thinking that all their keys were still valid. However, one of them had an expired key, so the message was not encrypted to that recipient and he could not read it. I want sup to prompt the user about potentially invalid keys before sending a message. I think the code will look something like this: diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb index fd8f824..88ae3cc 100644 --- a/lib/sup/crypto.rb +++ b/lib/sup/crypto.rb @@ -167,6 +167,14 @@ EOS {:operation =3D> "encrypt", :options =3D>= gpg_opts}) || gpg_opts recipients =3D to + [from] recipients =3D HookManager.run("gpg-expand-keys", { :recipients =3D>= recipients }) || recipients + + # make sure all recipients can be encrypted-to + recipients.each do |recipient| + if GPGME::Key.find(:public, recipient).length =3D=3D 0 and !Buffer= Manager.ask_yes_or_no("Could not encrypt to #{recipient}. Really send?") + raise Error, "Send message cancelled." + end + end + begin if GPGME.respond_to?('encrypt') cipher =3D GPGME.encrypt(recipients, format_payload(payload), gp= g_opts) I have not tested this patch, so if it looks wrong then it probably is! Does anybody have any thoughts on this feature? Troy --=-1399710191-353983-3522-1042-4-= Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJTbeHvAAoJEILOu+6H2FfCEvAP/0VOZOdXOecXvOop935WQ9ND 88Xrc8SdWzeV9EkvKM1IMoTi+iFPGW2lOE/eVVVpoFcDrS7I0s0J8TTD+xjBr487 OJMnR5NO0F15iTjTrjQbgoDXtXLjctQhu15kdcKKuHCU5V+4ITss5xxMrOjwi1YM BvccwKjt5bi+paEiIPelHvTPB1GXkV8X1afv639tMYJIDLK7qaMnd8bdWvrN4XRs pkpNpV7kTrAYrG4YsOcpNyjR5EJFzfuQmhSb8Unj22Q3lIc0s1henmuKCX9eidbj iOVA8zs+OsnkpUds0mFMl54kWrgeN7sxN0j+stv6blHGodCbQdiJRVXuMVLu8jpW 398Y20c6Fx4zio8al3FalI4h02ZnRC3qmNecfhfKAhRz++IZRyCsiCJf1hLy7zvZ Ln4ViohVQVLRm9VFUYxLpzAK/nB+CmOTsTLh0+lNWvkqLlvtbcS42Xxe36v9OFw+ ZiXCcaS66LhDq1UnCm9PtewmbEWsGYZ73HryDqU3tgbg28ptw92OCwCjtWndESi9 Br3zQe6/7B490OF/02JeE+SELVBJof6ys2mSsfe3/ay4dnTZOXfbRtjQxZYVx+kk upyauFKWCuwQBrFy0RSDuWZFg1W0TYUL/QSQO7ouYwpTQNCWQymugWFw2JFGVD80 V3hZsIwpYUIY/5czkJib =Aq5b -----END PGP SIGNATURE----- --=-1399710191-353983-3522-1042-4-=-- --===============0812392901499217787== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel --===============0812392901499217787==--