Subject: base32 in draft-ietf-cat-sasl-gssapi-04.txt

From: Simon Josefsson <[email-masked]>
Date: 08 May 2001 14:23:22 +0200

All,

two corrections for the base32 padding part of
draft-ietf-cat-sasl-gssapi below, I believe they are correct (?).

Also, if the intent is to provide a generic base32 description, I
think it would be good to include recomendations for often confused
details, such as if padding characters should be treated as
"characters outside of the base32 alphabet" or if they should be
"taken as evidence that the end of the data has been reached", I think
the most error-resistant approach is to treat padding characters as
outside of the base32 alphabet until at the end of the encoded data.
This probably isn't an issue within the scope of this draft, but for
other uses (in noisier environments, e.g. email) these details become
more important.

It has also been suggested that C code might be included to ease
correct implementations, including handling of different padding rules
etc.

Consider referencing draft-josefsson-base-encoding-02.txt instead for
aesthetic reasons :-)   E.g., I shouldn't have to read through MIME
specs in order to learn base64, I shouldn't have to read through
SASL-GSSAPI definitions in order to learn base32.

   Special processing is performed if fewer than 40 bits are available
   at the end of the data being encoded.  A full encoding quantum is
   always completed at the end of a body.  When fewer than 40 input bits
   are available in an input group, zero bits are added (on the right)
   to form an integral number of 5-bit groups.  Padding at the end of
   the data is performed using the "=" character.  Since all base32
   input is an integral number of octets, only the following cases can
   arise: (1) the final quantum of encoding input is an integral
   multiple of 40 bits; here, the final unit of encoded output will be
-  an integral multiple of 4 characters with no "=" padding, (2) the
+  an integral multiple of 8 characters with no "=" padding, (2) the
   final quantum of encoding input is exactly 8 bits; here, the final
   unit of encoded output will be two characters followed by six "="
   padding characters, (3) the final quantum of encoding input is
   exactly 16 bits; here, the final unit of encoded output will be four
   characters followed by four "=" padding characters, (4) the final
   quantum of encoding input is exactly 24 bits; here, the final unit of
-  encoded output will be five characters followed by five"=" padding
+  encoded output will be five characters followed by three "=" padding
   characters, or (5) the final quantum of encoding input is exactly 32
   bits; here, the final unit of encoded output will be seven characters
   followed by one "=" padding character.