Gnus development mailing list
 help / color / mirror / Atom feed
From: Daiki Ueno <ueno@unixuser.org>
Cc: Simon Josefsson <jas@extundo.com>,  ding@gnus.org
Subject: Re: PGG: byte length problem in pass-phrase
Date: Thu, 30 Mar 2006 09:41:54 +0900	[thread overview]
Message-ID: <4c86db1f-f127-4f7d-a98d-f41bf479a465@well-done.deisui.org> (raw)
In-Reply-To: <v9bqvp58eq.fsf_-_@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Wed, 29 Mar 2006 21:59:41 +0200")

[-- Attachment #1: Type: text/plain, Size: 849 bytes --]

>>>>> In <v9bqvp58eq.fsf_-_@marauder.physik.uni-ulm.de> 
>>>>>	Reiner Steib <reinersteib+gmane@imap.cc> wrote:
> On Wed, Mar 29 2006, Simon Josefsson wrote:

> > Reiner Steib <reinersteib+gmane@imap.cc> writes:
> >> For testing, I changed my pass-phrase to start with `ä' (#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(#<process pgg-gpg<2>>
> >>   "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.


[-- Attachment #2: pgg-gpg.el.diff --]
[-- Type: application/octet-stream, Size: 942 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 25 bytes --]


Regards,
-- 
Daiki Ueno

  reply	other threads:[~2006-03-30  0:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-29  5:51 default-enable-multibyte-characters in pgg-gpg Daiki Ueno
2006-03-29 11:24 ` Reiner Steib
2006-03-29 11:59   ` Daiki Ueno
2006-03-29 13:31     ` Reiner Steib
2006-03-29 15:16       ` Simon Josefsson
2006-03-29 19:59         ` PGG: byte length problem in pass-phrase (was: default-enable-multibyte-characters in pgg-gpg) Reiner Steib
2006-03-30  0:41           ` Daiki Ueno [this message]
2006-03-30  8:59           ` PGG: byte length problem in pass-phrase Simon Josefsson

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=4c86db1f-f127-4f7d-a98d-f41bf479a465@well-done.deisui.org \
    --to=ueno@unixuser.org \
    --cc=ding@gnus.org \
    --cc=jas@extundo.com \
    /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;
as well as URLs for NNTP newsgroup(s).