david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

8 Commits

Author SHA1 Message Date
Michael Brown 9aa8090d06 [base16] Add buffer size parameter to base16_encode() and base16_decode()
The current API for Base16 (and Base64) encoding requires the caller
to always provide sufficient buffer space.  This prevents the use of
the generic encoding/decoding functionality in some situations, such
as in formatting the hex setting types.

Implement a generic hex_encode() (based on the existing
format_hex_setting()), implement base16_encode() and base16_decode()
in terms of the more generic hex_encode() and hex_decode(), and update
all callers to provide the additional buffer length parameter.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-24 14:41:32 +01:00
Michael Brown b6ee89ffb5 [legal] Relicense files under GPL2_OR_LATER_OR_UBDL
Relicense files for which I am the sole author (as identified by
util/relicense.pl).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-02 14:17:31 +00:00
Michael Brown a32b1e9e35 [libc] Rewrite strtoul()
The implementation of strtoul() has a partially unknown provenance.
Rewrite this code to avoid potential licensing uncertainty.

Since we now use -ffunction-sections, there is no need to place
strtoull() in a separate file from strtoul().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-02-19 16:00:01 +00:00
Michael Brown 4f078801e9 [base16] Fix comparison of signed and unsigned integers
gcc 4.7.1 fails to report this erroneous comparison unless assertions
are enabled.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-14 12:35:43 +00:00
Michael Brown 49d14f0d8d [base16] Ensure base16_encode() always terminates its result string
base16_encode() will fail to generate a terminating NUL if the length
of the raw data is zero, since the loop calling sprintf() will never
execute.

Fix by explicitly terminating the result with a NUL.

Reported-by: Marin Hannache <git@mareo.fr>
Debugged-by: Marin Hannache <git@mareo.fr>
Tested-by: Marin Hannache <git@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-15 00:06:45 +02:00
Michael Brown 076f58c4bf [base16] Generalise base16_decode() to hex_decode()
Provide a generic hex_decode() routine which can be shared between the
Base16 code and the "hex" and "hexhyp" settings parsers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-12 15:14:36 +02:00
Michael Brown c3b4860ce3 [legal] Update FSF mailing address in GPL licence texts
Suggested-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-07-20 19:55:45 +01:00
Michael Brown bc83e4b5d3 [base16] Add generic base16 encoding and decoding routines
Base16 encoding is currently implemented in both iSCSI and SRP.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-05-28 15:41:37 +01:00