[gPXE-devel] [iscsi] base64 support for CHAP revisited

Joshua Oreman oremanj at rwcr.net
Thu May 27 20:08:40 EDT 2010


2010/5/27 Piotr Jaroszyński <p.jaroszynski at gmail.com>:
> Hello,
>
> reposting the patches so you can take another look.
>
> ===
>
> iscsi implementation is missing base64 encoding support. At least
> StarWind uses it for CHAP and hence fails with gpxe.
>
> Patches tested by a user who originally reported the problem and myself.

base64_decode_buf_len() looks like it rounds down in (encoded_len / 4)
* 3. It would be safer to do (encoded_len * 3 + 3) / 4; i.e. do the
multiplication first and round up. If base64 strings always contain a
multiple-of-4 number of characters then this isn't an issue.

300 bytes is kind of a lot. It might be worth putting base64 decoding
a separate file from encoding, and using a configuration flag and weak
symbols to control whether iSCSI base64 support is enabled. I don't
think that should block this patch, though; what do other developers
think?

-- Josh

> base64 +300
> iscsi +63
> TOTAL: +363
>
> http://git.etherboot.org/?p=people/peper/gpxe.git;a=shortlog;h=refs/heads/base64
> http://github.com/peper/gpxe-peper/compare/master...base64
>
> --
> Best Regards
> Piotr Jaroszyński
>
> _______________________________________________
> gPXE-devel mailing list
> gPXE-devel at etherboot.org
> http://etherboot.org/mailman/listinfo/gpxe-devel
>
>


More information about the gPXE-devel mailing list