unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Arne Jørgensen" <arne@arnested.dk>
Subject: Re: base64 behavior is not MIME compliant
Date: Wed, 06 Jul 2005 00:52:52 +0200	[thread overview]
Message-ID: <87pstwq30b.fsf@seamus.arnested.dk> (raw)
In-Reply-To: t53vf3rcgja.fsf@central-air-conditioning.toybox.cambridge.ma.us

Marc Horowitz <marc@mit.edu> writes:

> "Richard M. Stallman" <rms@gnu.org> writes:
>
>>> Is there some situation in which the current behavior of
>>> base64-decode-region causes an actual problem or confusion for users?
>
> I never would have noticed this had it not caused me a problem.
>
> I received a piece of email which passed through an older MTA.  This
> MTA inserted a ! and a newline after every 1000 characters of a very
> long line of base64-encoded data, which used to be common behavior.
> When Gnus tried to display this email, it failed, because the !
> characters were not recognized as valid base64 encoding.

MIME puts a limit on the line length at 76 characters. So in most
cases this will in it self be a broken behavior. (Base64 can probably
be used outside MIME too, of course).

>>> Is there some situation in which the current behavior provides an
>>> advantage?
>
> The only case I can think of is if a program or the user tries to
> base64 decode something which is not base64 encoded, they will receive
> an error, instead of some other, possibly confusing behavior.
> However, I believe this case is less common than non-transparent MTAs
> making small changes to base64-encded data.

I actually wrote some code for No Gnus recently that depended on
base64-decode-string to throw an error on strings that where not
base64 encoded.

Then it turned out that XEmacs' implementation of
base64-decode-region/base64-decode-string _does_ ignore illegal
characters in the base64 encoding.

The problem is that we have no other way to detect if a region/string
is base64 encoded or not. I thought about doing a decode and then
encode and compare the before and after string, but I finally found
another to recognize the data (it was a PEM encoded X509 certificate
and should therefore begin with "MII").

>>> Also, how does the current development Emacs handle these things?
>>> Your report is based on 21.4; the current sources may be different.
>
> I do not know.

I think the behavior is unchanged.

Kind regards,
-- 
Arne Jørgensen <http://arnested.dk/>

      parent reply	other threads:[~2005-07-05 22:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <t53zmt4dce3.fsf@central-air-conditioning.toybox.cambridge.ma.us>
2005-07-03 20:43 ` base64 behavior is not MIME compliant 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 [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pstwq30b.fsf@seamus.arnested.dk \
    --to=arne@arnested.dk \
    /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.
Code repositories for project(s) associated with this public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).