From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: Jay Berkenbilt <ejb@ql.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#6654: 23.2;
	mml-secure-message-encrypt-smime can't handle multiple recipients
Date: Fri, 16 Jul 2010 14:27:31 -0400
Message-ID: <20100716142731.0632953242.qww314159@motoko.argon.local>
NNTP-Posting-Host: lo.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: dough.gmane.org 1279305040 1975 80.91.229.12 (16 Jul 2010 18:30:40 GMT)
X-Complaints-To: usenet@dough.gmane.org
NNTP-Posting-Date: Fri, 16 Jul 2010 18:30:40 +0000 (UTC)
To: 6654@debbugs.gnu.org
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 16 20:30:38 2010
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([199.232.76.165])
	by lo.gmane.org with esmtp (Exim 4.69)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1OZpgD-0007g4-NA
	for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Jul 2010 20:30:38 +0200
Original-Received: from localhost ([127.0.0.1]:37703 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1OZpgC-0007a5-KJ
	for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Jul 2010 14:30:36 -0400
Original-Received: from [140.186.70.92] (port=57193 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1OZpg3-0007YO-0F
	for bug-gnu-emacs@gnu.org; Fri, 16 Jul 2010 14:30:28 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1OZpg1-00023c-7n
	for bug-gnu-emacs@gnu.org; Fri, 16 Jul 2010 14:30:26 -0400
Original-Received: from debbugs.gnu.org ([140.186.70.43]:48506)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1OZpg1-00023Y-6I
	for bug-gnu-emacs@gnu.org; Fri, 16 Jul 2010 14:30:25 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>)
	id 1OZpdh-0000hX-Ky; Fri, 16 Jul 2010 14:28:01 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Jay Berkenbilt <ejb@ql.org>
Original-Sender: debbugs-submit-bounces@debbugs.gnu.org
Resent-To: owner@debbugs.gnu.org
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Fri, 16 Jul 2010 18:28:01 +0000
Resent-Message-ID: <handler.6654.B.12793048502685@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: report 6654
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
X-Debbugs-Original-To: bug-gnu-emacs@gnu.org
Original-Received: via spool by submit@debbugs.gnu.org id=B.12793048502685
	(code B ref -1); Fri, 16 Jul 2010 18:28:01 +0000
Original-Received: (at submit) by debbugs.gnu.org; 16 Jul 2010 18:27:30 +0000
Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1OZpdA-0000hG-Vg
	for submit@debbugs.gnu.org; Fri, 16 Jul 2010 14:27:29 -0400
Original-Received: from mx10.gnu.org ([199.232.76.166])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <primary@qbilt.org>) id 1OZpd8-0000hB-4H
	for submit@debbugs.gnu.org; Fri, 16 Jul 2010 14:27:27 -0400
Original-Received: from lists.gnu.org ([199.232.76.165]:56148)
	by monty-python.gnu.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60)
	(envelope-from <primary@qbilt.org>) id 1OZpdL-0006TG-Rv
	for submit@debbugs.gnu.org; Fri, 16 Jul 2010 14:27:39 -0400
Original-Received: from [140.186.70.92] (port=40555 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1OZpdJ-0006wp-Tk
	for bug-gnu-emacs@gnu.org; Fri, 16 Jul 2010 14:27:39 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <primary@qbilt.org>) id 1OZpdI-0001MF-7Z
	for bug-gnu-emacs@gnu.org; Fri, 16 Jul 2010 14:27:37 -0400
Original-Received: from hgblob.mail.tigertech.net ([64.62.209.71]:53780)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <primary@qbilt.org>) id 1OZpdI-0001Lk-0D
	for bug-gnu-emacs@gnu.org; Fri, 16 Jul 2010 14:27:36 -0400
Original-Received: from localhost (localhost [127.0.0.1])
	by hgblob.tigertech.net (Postfix) with ESMTP id B06D232365D1;
	Fri, 16 Jul 2010 11:27:33 -0700 (PDT)
X-Virus-Scanned: Debian amavisd-new at hgblob.tigertech.net
Original-Received: from motoko.argon.local (unknown [72.165.80.2])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hgblob.tigertech.net (Postfix) with ESMTPSA id 8E64232365DC;
	Fri, 16 Jul 2010 11:27:32 -0700 (PDT)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
Resent-Date: Fri, 16 Jul 2010 14:28:01 -0400
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
	the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Xref: news.gmane.org gmane.emacs.bugs:38613
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/38613>


When attempting to send an encrypted message to multiple recipients,
mml-secure-message-encrypt-smime creates a "secure" mml tag contains a
separate certfile attribute for each recipient.  For example (with !
below replaced by #):

<!secure method=smime mode=signencrypt keyfile="~/certs/key.pem" certfile="~/certs/c1.pem" certfile="~/certs/c2.pem">

This gets parsed and eventually ends up in mml-parse-1.  In this block
of code:

       ((looking-at "<#secure")
	;; The secure part is essentially a meta-meta tag, which
	;; expands to either a part tag if there are no other parts in
	;; the document or a multipart tag if there are other parts
	;; included in the message
	(let* (secure-mode
	       (taginfo (mml-read-tag))
	       (keyfile (cdr (assq 'keyfile taginfo)))
	       (certfile (cdr (assq 'certfile taginfo)))
	       (recipients (cdr (assq 'recipients taginfo)))
	       (sender (cdr (assq 'sender taginfo)))
	       (location (cdr (assq 'tag-location taginfo)))
	       (mode (cdr (assq 'mode taginfo)))
	       (method (cdr (assq 'method taginfo)))
	       tags)

you can see that certfile is set by calling (assq 'certfile taginfo),
which loses all but the first certfile.  This causes it to be mapped
into this:

<!part sign=smime encrypt=smime keyfile="~/certs/key.pem" certfile="~/certs/c1.pem">

(again with ! replaced by #).

If you start off with

<!part sign=smime encrypt=smime keyfile="~/certs/key.pem" certfile="~/certs/c1.pem" certfile="~/certs/c2.pem">

and proceed to send the message, the message is encrypted with multiple
recipients as expected.


In GNU Emacs 23.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.4)
 of 2010-05-25 on motoko.argon.local
Windowing system distributor `The X.Org Foundation', version 11.0.70101000
configured using `configure  '--prefix=/opt/tps/packages/linux.x86_64.rhel5/emacs-23.2-1''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Summary

Minor modes in effect:
  gnus-agent-mode: t
  diff-auto-refine-mode: t
  which-function-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t

Recent input:
p s - b u i l d - i t e m s SPC i n SPC y o u r SPC 
C-a C-k T h e r e SPC a r e SPC o t h e r SPC w o r 
k a r o u n d s , SPC b u t SPC s e t t i n g SPC N 
O _ I C C SPC i s SPC a SPC r e a s o n a b l e SPC 
s o l u t i o n . SPC S-SPC I SPC s u p <backspace> 
s p e c t SPC y o u SPC m u s t SPC h a v e SPC N O 
_ X L C = 1 C-p M-f = 1 C-n SPC s o m e w h e r e SPC 
i n SPC y o r u <backspace> <backspace> u r SPC s e 
t u p SPC t o o SPC o r SPC e l s e SPC y o u ' d SPC 
b e SPC g e t t i n g SPC e r r o r s SPC a b o u t 
SPC x l c M-q SPC o n SPC t h e SPC h y d r a s . <return> 
<return> - - J a y C-n C-c C-c s s C-x C-g C-g M-x 
b u g <M-backspace> s e n d SPC e m SPC <M-backspace> 
<M-backspace> e m a c <M-backspace> b u g SPC SPC <M-backspace> 
<M-backspace> e m a c s SPC b SPC <M-backspace> <M-backspace> 
<M-backspace> r e p r t <backspace> <backspace> o t 
<tab> <backspace> <tab> r t <tab> b <tab> <return>

Recent messages:
waiting for TLS response...
Sending...done
Quit
Making completion list...
C-c C-g is undefined
Quit
Undo!
Type C-x 4 C-o RET to restore the other window.
Quit
C-c RET c s runs the command mml-secure-message-encrypt-smime

Load-path shadows:
/home/jberkenb/elisp/startup hides /opt/tps/packages/linux.x86_64.rhel5/emacs-23.2-1/share/emacs/23.2/lisp/startup

Features:
(shadow warnings emacsbug debug find-func diff-mode tabify man assoc
mule-util dabbrev perl-mode log-edit easy-mmode pcvs-util add-log vc-rcs
fg-lisp-indent help-mode view flow-fill mml-smime sh-script executable
tls newcomment rmail auth-source starttls mailalias q-valid-addr
flyspell ispell epa-file epa derived epg multi-isearch w3m-form
w3m-symbol sort gnus-cite ansi-color mail-extr gnus-async gnus-bcklg
parse-time gnus-ml disp-table vc-accurev paranoid-backup byte-opt
bytecomp byte-compile nndraft nnmh nnfolder gnus-agent gnus-srvr
gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015
epg-config mm-view smime dig nntp gnus-cache gnus-sum gnus-group
gnus-undo nndoc nnoo nnmail mail-source format-spec gnus-start gnus-spec
gnus-int gnus-range gnus-win gnus gnus-ems vc-svn vc vc-dispatcher w3m
browse-url doc-view image-mode dired timezone w3m-hist w3m-fb w3m-ems
w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util qmime qmime-compose
qmime-view which-func imenu filecache server uniquify compile ange-ftp
comint ring message ecomplete rfc822 mml mml-sec password-cache
mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045
qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util
mail-prsvr gmm-utils mailheader canlock sha1 hex-util hashcash
mail-utils cc-styles cc-align cc-engine cc-vars cc-defs smtpmail
sendmail regexp-opt project advice help-fns advice-preload jka-compr
cus-edit easymenu wid-edit cus-start cus-load edmacro kmacro cl cl-19
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
font-setting tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind system-font-setting
font-render-setting gtk x-toolkit x multi-tty emacs)