From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62441 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.gnus.general Subject: Re: PGG: byte length problem in pass-phrase Date: Thu, 30 Mar 2006 09:41:54 +0900 Message-ID: <4c86db1f-f127-4f7d-a98d-f41bf479a465@well-done.deisui.org> References: <87ek0lqo19.fsf@latte.josefsson.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Thu_Mar_30_09:41:54_2006-1" X-Trace: sea.gmane.org 1143679495 2866 80.91.229.2 (30 Mar 2006 00:44:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 30 Mar 2006 00:44:55 +0000 (UTC) Cc: Simon Josefsson , ding@gnus.org Original-X-From: ding-owner+m10968@lists.math.uh.edu Thu Mar 30 02:44:51 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FOlHF-0001ux-Vm for ding-account@gmane.org; Thu, 30 Mar 2006 02:44:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1FOlHB-0007fu-00; Wed, 29 Mar 2006 18:44:37 -0600 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FOlEL-0007fo-00 for ding@lists.math.uh.edu; Wed, 29 Mar 2006 18:41:41 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1FOlEJ-0003GA-0e for ding@lists.math.uh.edu; Wed, 29 Mar 2006 18:41:40 -0600 Original-Received: from 221x255x76x220.ap221.ftth.ucom.ne.jp ([221.255.76.220] helo=localhost) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FOlEH-0003Kj-00 for ; Thu, 30 Mar 2006 02:41:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=well-done.deisui.org ident=ueno) by localhost with esmtp (Exim 4.60) (envelope-from ) id 1FOlEY-0001Ny-Mu; Thu, 30 Mar 2006 09:41:54 +0900 Original-To: Reiner Steib X-Attribution: DU In-Reply-To: (Reiner Steib's message of "Wed, 29 Mar 2006 21:59:41 +0200") User-Agent: T-gnus/6.17.3 (based on No Gnus v0.3) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 XEmacs/21.4.16 (i686-pc-linux) MULE X-Spam-Score: -2.6 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:62441 Archived-At: --Multipart_Thu_Mar_30_09:41:54_2006-1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable >>>>> In =20 >>>>> Reiner Steib wrote: > On Wed, Mar 29 2006, Simon Josefsson wrote: > > Reiner Steib writes: > >> For testing, I changed my pass-phrase to start with `=E4' (#x8e4, > >> U+00E4, LATIN SMALL LETTER A DIAERESIS) [...] > >> Debugger entered--Lisp error: (error "Attempt to change byte length > >> of a string") > >> fillarray("\x8e4[...]" 0) > >> pgg-gpg-status-BAD_PASSPHRASE(#> > >> "BAD_PASSPHRASE E222255A3C6B854E") I wonder why this does not happen in the read-passwd function since it clears string in similar way. Anyway, the primary issue (i.e. your passphrase string is not supplied to gpg as it is) might be fixed by the attached patch. However I think this is not a right fix. --Multipart_Thu_Mar_30_09:41:54_2006-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="pgg-gpg.el.diff" Content-Transfer-Encoding: 7bit Index: lisp/pgg-gpg.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/pgg-gpg.el,v retrieving revision 7.17 diff -w -u -r7.17 pgg-gpg.el --- lisp/pgg-gpg.el 29 Mar 2006 07:51:17 -0000 7.17 +++ lisp/pgg-gpg.el 30 Mar 2006 00:30:30 -0000 @@ -210,7 +210,7 @@ (defun pgg-gpg-status-GET_HIDDEN (process line) (let ((entry (assoc pgg-gpg-key-id pgg-gpg-user-id-alist))) - (if (setq pgg-gpg-passphrase + (when (setq pgg-gpg-passphrase (if (eq pgg-gpg-key-id 'SYM) (pgg-read-passphrase "GnuPG passphrase for symmetric encryption: ") @@ -222,6 +222,8 @@ (if (eq pgg-gpg-key-id 'PIN) "PIN" pgg-gpg-key-id)))) + (if (fboundp 'string-as-unibyte) + (setq pgg-gpg-passphrase (string-as-unibyte pgg-gpg-passphrase))) (process-send-string process (concat pgg-gpg-passphrase "\n"))))) (defun pgg-gpg-status-GOOD_PASSPHRASE (process line) --Multipart_Thu_Mar_30_09:41:54_2006-1 Content-Type: text/plain; charset=US-ASCII Regards, -- Daiki Ueno --Multipart_Thu_Mar_30_09:41:54_2006-1--