Gnus development mailing list
 help / color / mirror / Atom feed
From: Manoj Srivastava <srivasta@debian.org>
Cc: ultrasoul@ultrasoul.com (David D. Smith),
	220521-forwarded@bugs.debian.org, ding@gnus.org
Subject: gnus: pgg-gpg-lookup-key uses wrong regular expression
Date: Fri, 14 Nov 2003 09:27:51 -0600	[thread overview]
Message-ID: <87oevfug08.fsf@glaurung.green-gryphon.com> (raw)

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

Gnus v5.10.2
GNU Emacs 21.3.1 (i386-pc-linux-gnu, X toolkit)
 of 2003-10-31 on raven, modified by Debian

Hi,

      [Please retain the CC to 220521-forwarded@bugs.debian.org, so
      that the Debian BTS has a record of your contribution]

	This was reported by a Debian user.

In pgg-gpg-kookup-key (line 113 of pgg-gpg.el), that re-search-forward
call places point at the end of "^\\(sec\\|pub\\):" Next, it splits
that string at point on ":" separation. The problem is that if the
string looks like this:

"sec::foo:bar", split string returns '("foo" "bar"), not what the code
actually expects it to return, '("" "foo" "bar"). The code wants to
extract the third element of that list return from the split which is
now unpredictable. This bug was provoked because when I'm signing, it
parses a string like the one given, but when I'm verifying, it parses
a string like "pub:u:foo:bar" which returns '("u" "foo" "bar") and the
third element of that list is indeed what we want.

From the documentation of the split-string function, "If there is
match for SEPARATORS at the beginning of STRING, we do not include a
null substring for that.  Likewise, if there is a match at the end of
STRING, we don't include a null substring for that.

Changing the regular expression to not include the first colon, so
"^\\(sec\\|pub\\)" produces the proper result every time. Another
option may be to search forward to the point found by the original
regular expression and back up one place, so we know every time that
the string to be split will begin with a separator.

	manoj


[-- Attachment #2: User settings --]
[-- Type: application/emacs-lisp, Size: 20835 bytes --]

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

-- 
I thought YOU silenced the guard!
Manoj Srivastava   <srivasta@debian.org>  <http://www.debian.org/%7Esrivasta/>
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C

             reply	other threads:[~2003-11-14 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-14 15:27 Manoj Srivastava [this message]
2003-11-14 22:13 ` Simon Josefsson
2003-11-15  0:50 ` 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=87oevfug08.fsf@glaurung.green-gryphon.com \
    --to=srivasta@debian.org \
    --cc=220521-forwarded@bugs.debian.org \
    --cc=ding@gnus.org \
    --cc=ultrasoul@ultrasoul.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).