all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* base64 behavior is not MIME compliant
@ 2005-07-02 23:19 Marc Horowitz
  2005-07-03 20:43 ` Richard M. Stallman
  0 siblings, 1 reply; 12+ messages in thread
From: Marc Horowitz @ 2005-07-02 23:19 UTC (permalink / raw)


(emacs-version)
"GNU Emacs 21.4.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2005-03-17 on trouble, modified by Debian"

(gnus-version)
"No Gnus v0.4"

RFC 3548 has this to say about characters not part of the encoding
alphabet:

    Implementations MUST reject the encoding if it contains characters
    outside the base alphabet when interpreting base encoded data, unless
    the specification referring to this document explicitly states
    otherwise.  Such specifications may, as MIME does, instead state that
    characters outside the base encoding alphabet should simply be ignored
    when interpreting data ("be liberal in what you accept").

The second sentence is a reference to RFC 2045:

   Any characters outside of the base64 alphabet are to be ignored in
   base64-encoded data.

The base64-decode-region function is somewhere in the middle, and
therefore compliant with neither spec: in addition to the alphabet
characters, it seems to accept whitespace, but nothing else.

Gnus's mm-decode-content-transfer-encoding method, in mm-bodies.el,
both in No Gnus and in the verison shipped with emacs 21.4, uses
base64-decode-region, which means it does not conform to the MIME
standard.

I believe the best fix is for base64-decode-region to take an optional
argument which specifies how liberal it should be about it's input,
defaulting to the current behavior, and for Gnus to use this argument.
It should, at the least, provide modes for strict parsing (no extra
chars or whitespace), the current behavior (accept whitespace), and
the MIME-compliant behavior (ignore all extra chars).  Of course, Gnus
can fix this independently by using an external base64 implementation
which is MIME-compliant.

                Marc

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2005-07-06  1:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-02 23:19 base64 behavior is not MIME compliant Marc Horowitz
2005-07-03 20:43 ` Richard M. Stallman
2005-07-03 21:09   ` Nic Ferrier
2005-07-04  4:59   ` Marc Horowitz
2005-07-05  4:35     ` Richard M. Stallman
2005-07-05 21:35       ` Marc Horowitz
2005-07-05 22:10         ` Nic Ferrier
2005-07-05 23:55           ` Marc Horowitz
2005-07-06  1:06             ` Nic Ferrier
2005-07-06  1:15           ` Ken Raeburn
2005-07-06  1:48             ` Nic Ferrier
2005-07-05 22:52     ` Arne Jørgensen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.