From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60710 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.gnus.general Subject: Re: Fwd: [PATCH]: gnus: use correct GPG hash algorithm in 'micalg' Date: Fri, 05 Aug 2005 18:13:59 +0900 Message-ID: <82e593ac-30c0-438c-b353-0f053f0ea2d0@well-done.deisui.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-ripemd160; protocol="application/pgp-signature" X-Trace: sea.gmane.org 1123233401 27550 80.91.229.2 (5 Aug 2005 09:16:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 5 Aug 2005 09:16:41 +0000 (UTC) Cc: Ding List , Reiner Steib , Enrico Scholz Original-X-From: ding-owner+M9242=ding+2Daccount=gmane.org@lists.math.uh.edu Fri Aug 05 11:16:39 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E0yHz-0007ZE-Px for ding-account@gmane.org; Fri, 05 Aug 2005 11:14: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 1E0yHy-000685-02 for ding-account@gmane.org; Fri, 05 Aug 2005 04:14:50 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1E0yHr-00067x-00 for ding@lists.math.uh.edu; Fri, 05 Aug 2005 04:14:43 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1E0yHf-0002zi-Ml for ding@lists.math.uh.edu; Fri, 05 Aug 2005 04:14:31 -0500 Original-Received: from [210.231.96.69] (helo=well-done.deisui.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1E0xLa-0000Kz-00 for ; Fri, 05 Aug 2005 10:14:30 +0200 Original-Received: from l209016.ppp.asahi-net.or.jp ([218.219.209.16] helo=well-done.deisui.org) by well-done.deisui.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1E0yHK-0008VJ-5x; Fri, 05 Aug 2005 18:14:10 +0900 Original-To: Simon Josefsson X-Attribution: DU In-Reply-To: (Simon Josefsson's message of "Wed, 03 Aug 2005 22:41:38 +0200") User-Agent: Gnus/5.110004 (No Gnus v0.4) XEmacs/21.4.17 (linux) X-Spam-Score: -0.7 (/) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:60710 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:60710 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable >>>>> In =20 >>>>> Simon Josefsson wrote: > Daiki Ueno writes: > > I'm not sure that the micalg=3D parameter is still mandatory, while the > > hash algorithm used is embedded in OpenPGP packets. > Sadly RFC 1847 require the presence of micalg, it seems. A wart, but > difficult to fix at this point. We should populate it with correct > information. > > It can be obtained by using the builtin packet parser (pgg-parse), > > without depending on --status-fd output of GnuPG. > Very nice! Would you mind proposing a patch for mml2016.el that uses > this approach? No, I made the patch attached below. I'm sending this mail with DSA & RIPEMD160. If the patch works as expected, micalg=3Dripemd160 appears in the Content-Type: header. --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline; filename=micalg.diff Content-Transfer-Encoding: quoted-printable ? micalg.diff Index: lisp/mml2015.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/mml2015.el,v retrieving revision 7.9 diff -u -r7.9 mml2015.el --- lisp/mml2015.el 17 Jul 2005 14:10:38 -0000 7.9 +++ lisp/mml2015.el 5 Aug 2005 07:58:19 -0000 @@ -645,7 +645,8 @@ (autoload 'pgg-decrypt-region "pgg") (autoload 'pgg-verify-region "pgg") (autoload 'pgg-sign-region "pgg") - (autoload 'pgg-encrypt-region "pgg")) + (autoload 'pgg-encrypt-region "pgg") + (autoload 'pgg-parse-armor "pgg-parse")) =20 (defun mml2015-pgg-decrypt (handle ctl) (catch 'error @@ -813,15 +814,23 @@ (let ((pgg-errors-buffer mml2015-result-buffer) (boundary (mml-compute-boundary cont)) (pgg-default-user-id (or (message-options-get 'mml-sender) - pgg-default-user-id))) + pgg-default-user-id)) + entry) (unless (pgg-sign-region (point-min) (point-max)) (pop-to-buffer mml2015-result-buffer) (error "Sign error")) (goto-char (point-min)) (insert (format "Content-Type: multipart/signed; boundary=3D\"%s\";\n" boundary)) - ;;; FIXME: what is the micalg? - (insert "\tmicalg=3Dpgp-sha1; protocol=3D\"application/pgp-signature\"= \n") + (if (setq entry (assq 2 (pgg-parse-armor + (with-current-buffer pgg-output-buffer + (buffer-string))))) + (setq entry (assq 'hash-algorithm (cdr entry)))) + (insert (format "\tmicalg=3D%s; " + (if (cdr entry) + (downcase (format "pgp-%s" (cdr entry))) + "pgp-sha1"))) + (insert "protocol=3D\"application/pgp-signature\"\n") (insert (format "\n--%s\n" boundary)) (goto-char (point-max)) (insert (format "\n--%s\n" boundary)) Index: lisp/pgg-parse.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/pgg-parse.el,v retrieving revision 7.6 diff -u -r7.6 pgg-parse.el --- lisp/pgg-parse.el 5 Jul 2005 22:34:49 -0000 7.6 +++ lisp/pgg-parse.el 5 Aug 2005 07:58:19 -0000 @@ -56,7 +56,8 @@ (cons (sexp :tag "Number") (sexp :tag "Type")))) =20 (defcustom pgg-parse-hash-algorithm-alist - '((1 . MD5) (2 . SHA1) (3 . RIPEMD160) (5 . MD2)) + '((1 . MD5) (2 . SHA1) (3 . RIPEMD160) (5 . MD2) (8 . SHA256) (9 . SHA38= 4) + (10 . SHA512)) "Alist of the assigned number to the cryptographic hash algorithm." :group 'pgg-parse :type '(repeat --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Regards, --=20 Daiki Ueno --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBC8y3gpbay1LFYE/4RA25QAKCIxlKgIZ83PdtlxC3fCL79IBEKgwCff5rh p5CMTAC9UetyjoJPEvm+CvY= =a858 -----END PGP SIGNATURE----- --==-=-=--