summaryrefslogtreecommitdiffstats
path: root/src/tests/tests.c
Commit message (Collapse)AuthorAgeFilesLines
* [ntlm] Add support for NTLM authentication mechanismMichael Brown2017-11-121-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add MD4 message digest algorithmMichael Brown2017-11-121-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add PEM image formatMichael Brown2016-07-291-0/+1
| | | | | | | | | | | 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>
* [crypto] Add DER image formatMichael Brown2016-07-291-0/+1
| | | | | | | | 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>
* [bitops] Add generic atomic bit test, set, and clear functionsMichael Brown2016-03-161-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iobuf] Improve robustness of I/O buffer allocationMichael Brown2016-02-111-0/+1
| | | | | | | | | | | | | 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>
* [linebuf] Support buffering of multiple linesMichael Brown2015-07-281-0/+1
| | | | | | | | 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>
* [test] Generalise cipher tests and use okx()Michael Brown2015-07-271-1/+1
| | | | | | | | 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>
* [peerdist] Add support for decoding PeerDist Content InformationMichael Brown2015-04-131-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add SHA-512 algorithmMichael Brown2015-04-121-0/+1
| | | | | | | This implementation has been verified using the NIST SHA-512 test vectors. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add setjmp()/longjmp() self-testsMichael Brown2015-04-071-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix the REQUIRE_SYMBOL mechanismMichael Brown2015-03-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add IPv4 self-testsMichael Brown2015-02-181-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add constant-length memset() self-testsMichael Brown2015-02-171-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [profile] Add generic profiling infrastructureMichael Brown2014-04-281-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for flsl()Michael Brown2014-04-241-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Refactor URI parsing and formattingMichael Brown2014-02-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* [dns] Support DNS search listsMichael Brown2014-02-051-0/+1
| | | | | | | | | | | 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>
* [png] Add support for PNG imagesMichael Brown2014-01-121-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [deflate] Add support for DEFLATE decompressionMichael Brown2014-01-061-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pnm] Add support for PNM imagesMichael Brown2013-11-271-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Replace IPv6 stackMichael Brown2013-09-031-0/+1
| | | | | | | | | | | | | | | | 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>
* [test] Add self-tests for snprintf()Michael Brown2013-08-121-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for base16Michael Brown2013-07-121-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for string functionsMichael Brown2012-11-121-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-201-1/+2
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for TCP/IP checksum calculationMichael Brown2012-06-271-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add memcpy() self-testsMichael Brown2012-06-271-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for base64Michael Brown2012-05-201-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for OCSPMichael Brown2012-05-151-0/+1
| | | | | | | Add self-tests for OCSP using test vectors generated with the openssl tools. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for crc32_le()Michael Brown2012-05-071-0/+1
| | | | | | | Add self-tests for crc32_le() using test vectors generated with Perl's Digest::CRC. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for setting typesMichael Brown2012-04-171-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add CMS self-testsMichael Brown2012-03-221-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add X.509 self-testsMichael Brown2012-03-221-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for mktime()Michael Brown2012-03-191-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for RSAMichael Brown2012-03-181-0/+1
| | | | | | | Add self-tests for the RSA algorithm using test vectors generated with the openssl tools. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add big integer self-testsMichael Brown2012-03-141-0/+1
| | | | | | These test vectors are generated using Perl's Math::BigInt. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add NIST self-tests for AES128 and AES256 in CBC modeMichael Brown2012-03-061-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for MD5 algorithmMichael Brown2012-03-051-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for SHA-256 algorithmMichael Brown2012-03-051-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for byte-order swapping functionsMichael Brown2012-03-041-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Allow self-tests to be run individuallyMichael Brown2012-02-271-0/+31
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>