From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sascha Wilde Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Small patch to enable use of gpg-agent with pgg Date: Sat, 18 Mar 2006 22:17:02 +0100 Message-ID: References: <2cd46e7f0510031250u66ea1349yb437d539ce4027ef@mail.gmail.com> <2cd46e7f0510061541w73bb6a92wb6d22829b6e804ae@mail.gmail.com> <20051007100014.GB4850@kenny.sha-bang.local> <2cd46e7f0510071106k3d4d3e6agc36f16a37d8b6bc6@mail.gmail.com> <20051007214952.GA30235@kenny.sha-bang.local> <20051008103627.GA1218@kenny.sha-bang.local> <2cd46e7f0510081131h14e2bbeaga7f1a33ebd6347c8@mail.gmail.com> <2cd46e7f0510101415t76825ea7u9749fe23da54ce@mail.gmail.com> <2cd46e7f0510121647x3c51fb65pc883ed61f4e864ab@mail.gmail.com> <2cd46e7f0510200708x4640d1c2t50743cf439e52dd4@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1102585518==" X-Trace: sea.gmane.org 1142716667 8231 80.91.229.2 (18 Mar 2006 21:17:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 18 Mar 2006 21:17:47 +0000 (UTC) Cc: "Daiki Ueno \(pgg author\)" , ding@gnus.org, Simon Josefsson Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 18 22:17:44 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FKinv-000815-Pd for ged-emacs-devel@m.gmane.org; Sat, 18 Mar 2006 22:17:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FKinv-0003T7-5f for ged-emacs-devel@m.gmane.org; Sat, 18 Mar 2006 16:17:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FKine-0003So-K2 for emacs-devel@gnu.org; Sat, 18 Mar 2006 16:17:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FKinc-0003Sb-AL for emacs-devel@gnu.org; Sat, 18 Mar 2006 16:17:26 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FKinc-0003SY-3v for emacs-devel@gnu.org; Sat, 18 Mar 2006 16:17:24 -0500 Original-Received: from [62.141.58.119] (helo=km1136.keymachine.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FKisn-0001RI-AJ for emacs-devel@gnu.org; Sat, 18 Mar 2006 16:22:45 -0500 Original-Received: from kenny.sha-bang.de (xdslu030.osnanet.de [82.149.184.30]) (authenticated bits=0) by km1136.keymachine.de (8.12.11/8.12.10) with ESMTP id k2ILH59o008571; Sat, 18 Mar 2006 22:17:06 +0100 Original-Received: from wilde by kenny.sha-bang.de with local (Kenny MUA v.0409034.42) ID 1FKinO-000254-9v; Sat, 18 Mar 2006 22:17:10 +0100 Original-To: emacs-devel@gnu.org In-Reply-To: (Simon Josefsson's message of "Thu, 20 Oct 2005 16:12:58 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:51828 gmane.emacs.gnus.general:62296 Archived-At: --===============1102585518== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Transfer-Encoding: quoted-printable Hi, I wrote a small patch, which makes it possible to use the GnuPG agent (which is part of gpg 1.9 and considered ready to use by Werner) with the GnuPG backend of pgg. I have done very little testing yet, but it seems to work fine.[0] To test it:=20 set up your gpg-agent as usual and set pgg-gpg-use-agent to t. cheers sascha [0] I signed this Mail using it... ;-) --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable Content-Description: pgg-gpg-agent.patch *** pgg-gpg.el 11 Feb 2006 17:01:56 +0100 1.4 =2D-- pgg-gpg.el 18 M=E4r 2006 21:57:00 +0100=09 *************** *** 51,56 **** =2D-- 51,61 ---- :type '(choice (const :tag "New `--recipient' option" "--recipient") (const :tag "Old `--remote-user' option" "--remote-user"))) =20=20 + (defcustom pgg-gpg-use-agent nil + "Whether to use gnupg agent for key caching." + :group 'pgg-gpg + :type 'boolean) +=20 (defvar pgg-gpg-user-id nil "GnuPG ID of your default identity.") =20=20 *************** *** 58,64 **** (let* ((output-file-name (pgg-make-temp-file "pgg-output")) (args `("--status-fd" "2" ! ,@(if passphrase '("--passphrase-fd" "0")) "--yes" ; overwrite "--output" ,output-file-name ,@pgg-gpg-extra-args ,@args)) =2D-- 63,71 ---- (let* ((output-file-name (pgg-make-temp-file "pgg-output")) (args `("--status-fd" "2" ! ,@(if (and passphrase (not pgg-gpg-use-agent))=20 ! '("--passphrase-fd" "0")) ! ,(if pgg-gpg-use-agent "--use-agent") "--yes" ; overwrite "--output" ,output-file-name ,@pgg-gpg-extra-args ,@args)) *************** *** 77,83 **** (input (buffer-substring-no-properties start end)) (default-enable-multibyte-characters nil)) (with-temp-buffer ! (when passphrase (insert passphrase "\n")) (insert input) (setq exit-status =2D-- 84,90 ---- (input (buffer-substring-no-properties start end)) (default-enable-multibyte-characters nil)) (with-temp-buffer ! (when (and passphrase (not pgg-gpg-use-agent)) (insert passphrase "\n")) (insert input) (setq exit-status *************** *** 181,187 **** If optional PASSPHRASE is not specified, it will be obtained from the passphrase cache or user." (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) ! (passphrase (or passphrase (when sign (pgg-read-passphrase (format "GnuPG passphrase for %s: " =2D-- 188,195 ---- If optional PASSPHRASE is not specified, it will be obtained from the passphrase cache or user." (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) ! (passphrase (or pgg-gpg-use-agent ! passphrase (when sign (pgg-read-passphrase (format "GnuPG passphrase for %s: " *************** *** 213,219 **** =20=20 If optional PASSPHRASE is not specified, it will be obtained from the passphrase cache or user." ! (let* ((passphrase (or passphrase (pgg-read-passphrase "GnuPG passphrase for symmetric encryption: "))) (args =2D-- 221,228 ---- =20=20 If optional PASSPHRASE is not specified, it will be obtained from the passphrase cache or user." ! (let* ((passphrase (or pgg-gpg-use-agent ! passphrase (pgg-read-passphrase "GnuPG passphrase for symmetric encryption: "))) (args *************** *** 241,247 **** (key-id (pgg-gpg-key-id-from-key-owner key-owner)) (pgg-gpg-user-id (or key-id key pgg-gpg-user-id pgg-default-user-id)) ! (passphrase (or passphrase (pgg-read-passphrase (format (if (pgg-gpg-symmetric-key-p message-ke= ys) "Passphrase for symmetric decryptio= n: " =2D-- 250,257 ---- (key-id (pgg-gpg-key-id-from-key-owner key-owner)) (pgg-gpg-user-id (or key-id key pgg-gpg-user-id pgg-default-user-id)) ! (passphrase (or pgg-gpg-use-agent ! passphrase (pgg-read-passphrase (format (if (pgg-gpg-symmetric-key-p message-ke= ys) "Passphrase for symmetric decryptio= n: " *************** *** 276,282 **** (defun pgg-gpg-sign-region (start end &optional cleartext passphrase) "Make detached signature from text between START and END." (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) ! (passphrase (or passphrase (pgg-read-passphrase (format "GnuPG passphrase for %s: " pgg-gpg-use= r-id) pgg-gpg-user-id))) =2D-- 286,293 ---- (defun pgg-gpg-sign-region (start end &optional cleartext passphrase) "Make detached signature from text between START and END." (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) ! (passphrase (or pgg-gpg-use-agent ! passphrase (pgg-read-passphrase (format "GnuPG passphrase for %s: " pgg-gpg-use= r-id) pgg-gpg-user-id))) --=-=-= Content-Transfer-Encoding: quoted-printable =2D-=20 Sascha Wilde=20 Hi! I'm a .signature *virus*! Copy me into your ~/.signature to help me spr= ead! --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFEHHjWchutvmkRUCQRAlrPAKDeBH+NYFtM3uSKS0CFdSve+duUKQCfea8z sIwxBPzLnFTIuFVQoZicyJI= =WuXh -----END PGP SIGNATURE----- --==-=-=-- --===============1102585518== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============1102585518==--