From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60440 Path: news.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: magic numbers in mm-view.el Date: Fri, 10 Jun 2005 22:31:19 +0200 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1118435409 24884 80.91.229.2 (10 Jun 2005 20:30:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Jun 2005 20:30:09 +0000 (UTC) Cc: The Gnus Mailing List Original-X-From: ding-owner+M8967@lists.math.uh.edu Fri Jun 10 22:30:06 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dgq8V-0008Cf-Pb for ding-account@gmane.org; Fri, 10 Jun 2005 22:29:52 +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 1DgqBG-0002x3-00; Fri, 10 Jun 2005 15:32:42 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1DgqB7-0002wv-00 for ding@lists.math.uh.edu; Fri, 10 Jun 2005 15:32:33 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1DgqB5-0005MT-ED for ding@lists.math.uh.edu; Fri, 10 Jun 2005 15:32:31 -0500 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net ([217.13.230.178] helo=yxa.extundo.com) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1DgqB0-0006bG-00 for ; Fri, 10 Jun 2005 22:32:28 +0200 Original-Received: from latte.josefsson.org (c494102a.s-bi.bostream.se [217.215.27.65]) (authenticated bits=0) by yxa.extundo.com (8.13.4/8.13.4/Debian-3) with ESMTP id j5AKVRRE032722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=OK); Fri, 10 Jun 2005 22:31:50 +0200 Original-To: david.goldberg6@verizon.net (David S. Goldberg) OpenPGP: id=B565716F; url=http://josefsson.org/key.txt X-Hashcash: 1:21:050610:ding@gnus.org::q6eRD1r4LRy6p2yg:Bupp X-Hashcash: 1:21:050610:david.goldberg6@verizon.net::6lY5vM/G7gnEpVh7:Ov2m In-Reply-To: (David S. Goldberg's message of "Fri, 10 Jun 2005 13:59:25 -0400") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=failed version=3.0.3 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yxa-iv X-Virus-Scanned: ClamAV version 0.84, clamav-milter version 0.84e on yxa.extundo.com X-Virus-Status: Clean X-MIME-Autoconverted: from 8bit to quoted-printable by yxa.extundo.com id j5AKVRRE032722 X-Spam-Score: -4.9 (----) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:60440 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:60440 david.goldberg6@verizon.net (David S. Goldberg) writes: > If I use the #secure tag to send an encrypted s/mime email to others > and include a copy for myself, I am unable to read my copy in Gnus. I > am able to decrypt and verify it (assuming it's signed as well) by > manually running Openssl on the message file and am also able to do so > in Thunderbird. Oddly enough, if I build a multipart structure for > the message using #multipart instead of #secure I don't have this > problem. But because the structure of the message is apparently not a > problem for OpenSSL or Thunderbird, I believe that the problem is that > the mm-pkcs7-enveloped-magic variable is not sufficient to cover all > cases. > > Running (pp mm-pkcs7-enveloped-magic) gives > > "0\\(=C2=80\\|=C2=81.\\|=C2=82..\\|=C2=83...\\)=06 \\*=C2=86H=C2=86=C3=B7= =0D=01=07=03" > > So it's already a regular expression. Here's what I see: > > "0=C2=82\n=C3=8D=06 *=C2=86H=C2=86=C3=B7=0D=01=07=03" > > The problem is that the '\n' after the \202 does not match the . in > the regular expression. It seems it shouldn't be too hard to fix. > Just put [.\n] instead of just . in those locations. However, in > mm-view.el we have > > (defvar mm-pkcs7-enveloped-magic > (mm-string-as-unibyte > (mapconcat 'char-to-string > (list ?\x30 ?\x5c ?\x28 ?\x80 ?\x5c ?\x7c ?\x81 ?\x2e ?\x5c > ?\x7c ?\x82 ?\x2e ?\x2e ?\x5c ?\x7c ?\x83 ?\x2e ?\x2e > ?\x2e ?\x5c ?\x29 ?\x06 ?\x09 ?\x5c ?\x2a ?\x86 ?\x48 > ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x03) ""))) > > And I am unsure how to work the fix into that construct. I'd be glad > to do it but need a bit of guidance on how to translate the characters. Either you could simply replace those '.' with \(.\|\n\), but I think maintainability suggest getting rid of the entire char-list and replace it with something simpler. Perhaps you can use `format' and have the argument contain the printable characters, and regexp keywords, and use %c or something for the escaped characters.