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

Joshua Oreman oremanj at rwcr.net
Fri May 28 13:47:16 EDT 2010


2010/5/28 Piotr Jaroszyński <p.jaroszynski at gmail.com>:
>>> 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.
>
> They should but it's a good idea to be safe.
>
>> 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?
>
> Micheal's implementation of decoding [1] takes 196 bytes, so we could
> also use that. My patch for adding base64 support to iscsi should
> mostly work as is, but seeing that Michael didn't apply it (yet?) we
> might want to wait and see :)
>
> P.S. Although not related to CHAP the other Michael's patch [2] also
> makes sense and we might want to consider them at the same time.
>
> [1] https://git.ipxe.org/ipxe.git/commitdiff/97ea628484be522734d074995555ffcf3884a0e0
> [2] https://git.ipxe.org/ipxe.git/commitdiff/dfcce165a58dc3be7d1c6c1bdf80dd6a28d50d7f
> [your original iSCSI-base64 patch]

+1, +1, +1

I'm happy with all of these now. I'll apply in 24 hours barring
further comments.

-- Josh

>
> --
> Best Regards
> Piotr Jaroszyński
>


More information about the gPXE-devel mailing list