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

41 Commits

Author SHA1 Message Date
Michael Brown 84add97ce9 [crypto] Add PEM image format
Add PEM-encoded ASN.1 as an image format.  We accept as PEM any image
containing a line starting with a "-----BEGIN" boundary marker.

We allow for PEM files containing multiple ASN.1 objects, such as a
certificate chain produced by concatenating individual certificate
files.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-07-29 01:13:27 +01:00
Michael Brown eb7188d04b [crypto] Add DER image format
Add DER-encoded ASN.1 as an image format.  There is no fixed signature
for DER files.  We treat an image as DER if it comprises a single
valid SEQUENCE object covering the entire length of the image.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-07-29 01:12:58 +01:00
Michael Brown c867b5ab1f [bitops] Add generic atomic bit test, set, and clear functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-16 22:33:40 +00:00
Michael Brown 12b3b57886 [iobuf] Improve robustness of I/O buffer allocation
Guard against various corner cases (such as zero-length buffers, zero
alignments, and integer overflow when rounding up allocation lengths
and alignments) and ensure that the struct io_buffer is correctly
aligned even when the caller requests a non-zero alignment for the I/O
buffer itself.

Add self-tests to verify that the resulting alignments and lengths are
correct for a range of allocations.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-02-11 19:04:23 +00:00
Michael Brown 1e4ff872be [linebuf] Support buffering of multiple lines
Allow line buffer to accumulate multiple lines, with buffered_line()
returning each freshly-completed line as it is encountered.  This
allows buffered lines to be subsequently processed as a group.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-28 16:59:11 +01:00
Michael Brown c0be4c6861 [test] Generalise cipher tests and use okx()
Generalise the existing support for performing CBC-mode block cipher
tests, and update the code to use okx() for neater reporting of test
results.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27 16:04:38 +01:00
Michael Brown d9166bbcae [peerdist] Add support for decoding PeerDist Content Information
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-13 12:26:05 +01:00
Michael Brown 6f713c2d95 [crypto] Add SHA-512 algorithm
This implementation has been verified using the NIST SHA-512 test
vectors.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-12 17:01:10 +01:00
Michael Brown dc795b9fef [test] Add setjmp()/longjmp() self-tests
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-07 06:40:46 +01:00
Michael Brown fbc4ba4b4e [build] Fix the REQUIRE_SYMBOL mechanism
At some point in the past few years, binutils became more aggressive
at removing unused symbols.  To function as a symbol requirement, a
relocation record must now be in a section marked with @progbits and
must not be in a section which gets discarded during the link (either
via --gc-sections or via /DISCARD/).

Update REQUIRE_SYMBOL() to generate relocation records meeting these
criteria.  To minimise the impact upon the final binary size, we use
existing symbols (specified via the REQUIRING_SYMBOL() macro) as the
relocation targets where possible.  We use R_386_NONE or R_X86_64_NONE
relocation types to prevent any actual unwanted relocation taking
place.  Where no suitable symbol exists for REQUIRING_SYMBOL() (such
as in config.c), the macro PROVIDE_REQUIRING_SYMBOL() can be used to
generate a one-byte-long symbol to act as the relocation target.

If there are versions of binutils for which this approach fails, then
the fallback will probably involve killing off REQUEST_SYMBOL(),
redefining REQUIRE_SYMBOL() to use the current definition of
REQUEST_SYMBOL(), and postprocessing the linked ELF file with
something along the lines of "nm -u | wc -l" to check that there are
no undefined symbols remaining.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-05 00:59:38 +00: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 b05e7e50fa [test] Add IPv4 self-tests
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-02-18 14:11:32 +00:00
Michael Brown 7867e48cee [test] Add constant-length memset() self-tests
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-02-17 00:41:40 +00:00
Michael Brown e5f6a9be38 [profile] Add generic profiling infrastructure
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-04-27 23:14:43 +01:00
Michael Brown 8f0e0e1356 [test] Add self-tests for flsl()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-04-24 13:40:35 +01:00
Michael Brown 7667536527 [uri] Refactor URI parsing and formatting
Add support for parsing of URIs containing literal IPv6 addresses
(e.g. "http://[fe80::69ff:fe50:5845%25net0]/boot.ipxe").

Duplicate URIs by directly copying the relevant fields, rather than by
formatting and reparsing a URI string.  This relaxes the requirements
on the URI formatting code and allows it to focus on generating
human-readable URIs (e.g. by not escaping ':' characters within
literal IPv6 addresses).  As a side-effect, this allows relative URIs
containing parameter lists (e.g. "../boot.php##params") to function
as expected.

Add validity check for FTP paths to ensure that only printable
characters are accepted (since FTP is a human-readable line-based
protocol with no support for character escaping).

Construct TFTP next-server+filename URIs directly, rather than parsing
a constructed "tftp://..." string,

Add self-tests for URI functions.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-02-27 13:32:53 +00:00
Michael Brown d4c0226a6c [dns] Support DNS search lists
Update the DNS resolver to support DNS search lists (as provided by
DHCP option 119, DHCPv6 option 24, or NDP option 31).

Add validation code to ensure that parsing of DNS packets does not
overrun the input, get stuck in infinite loops, or (worse) write
beyond the end of allocated buffers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-02-05 14:56:49 +00:00
Michael Brown c6c8078964 [png] Add support for PNG images
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-12 22:53:16 +01:00
Michael Brown 9bdfc36bcc [deflate] Add support for DEFLATE decompression
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-06 03:10:41 +01:00
Michael Brown 0ee89338dd [pnm] Add support for PNM images
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-27 11:27:51 +00:00
Michael Brown f7f3087cc5 [ipv6] Replace IPv6 stack
Replace the existing partially-implemented IPv6 stack with a fresh
implementation.

This implementation is not yet complete.  The IPv6 transmit and
receive datapaths are functional (including fragment reassembly and
parsing of arbitrary extension headers).  NDP neighbour solicitations
and advertisements are supported.  ICMPv6 echo is supported.

At present, only link-local addresses may be used, and there is no way
to specify an IPv6 address as part of a URI (either directly or via
a DNS lookup).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-03 16:30:46 +01:00
Michael Brown d105627928 [test] Add self-tests for snprintf()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-12 17:02:50 +01:00
Michael Brown 362a628e52 [test] Add self-tests for base16
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-12 15:14:36 +02:00
Michael Brown 520323e360 [test] Add self-tests for string functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-11-12 16:58:49 +00: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 bb9961fb54 [test] Add self-tests for TCP/IP checksum calculation
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-06-27 19:15:18 +01:00
Michael Brown 80cdf6acc7 [test] Add memcpy() self-tests
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-06-27 19:15:16 +01:00
Michael Brown f4c88d55bd [test] Add self-tests for base64
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-20 17:12:42 +01:00
Michael Brown a33298dcda [test] Add self-tests for OCSP
Add self-tests for OCSP using test vectors generated with the openssl
tools.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-15 13:24:30 +01:00
Michael Brown e844297ef6 [test] Add self-tests for crc32_le()
Add self-tests for crc32_le() using test vectors generated with Perl's
Digest::CRC.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-07 16:56:50 +01:00
Michael Brown 46409231ba [test] Add self-tests for setting types
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-17 10:45:41 +01:00
Michael Brown 7ace2ebe94 [test] Add CMS self-tests
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-22 11:41:29 +00:00
Michael Brown 9a03a8e3d2 [test] Add X.509 self-tests
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-22 00:31:17 +00:00
Michael Brown c130001bdf [test] Add self-tests for mktime()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-19 17:35:46 +00:00
Michael Brown 7fb064470f [test] Add self-tests for RSA
Add self-tests for the RSA algorithm using test vectors generated with
the openssl tools.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-18 13:37:56 +00:00
Michael Brown 4e53303c03 [test] Add big integer self-tests
These test vectors are generated using Perl's Math::BigInt.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-13 23:27:38 +00:00
Michael Brown 1f238bc69e [test] Add NIST self-tests for AES128 and AES256 in CBC mode
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-06 21:01:30 +00:00
Michael Brown c15e73f283 [test] Add self-tests for MD5 algorithm
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-05 00:31:07 +00:00
Michael Brown bbdf17c3e8 [test] Add self-tests for SHA-256 algorithm
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-05 00:20:30 +00:00
Michael Brown c94a4a8d12 [test] Add self-tests for byte-order swapping functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 15:29:24 +00:00
Michael Brown c0340d9762 [test] Allow self-tests to be run individually
Separate out the list of self-tests from the self-test infrastructure.
This allows tests to be run individually.  For example:

  make bin/sha1_test.iso

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-27 14:21:54 +00:00