summaryrefslogtreecommitdiffstats
path: root/src/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* [test] Add self-tests for TCP/IP checksum calculationMichael Brown2012-06-272-0/+214
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add memcpy() self-testsMichael Brown2012-06-272-34/+257
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Construct OCSP check URIMichael Brown2012-05-221-83/+8Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for base64Michael Brown2012-05-202-0/+125
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for OCSPMichael Brown2012-05-152-0/+1526
| | | | | | | Add self-tests for OCSP using test vectors generated with the openssl tools. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [list] Add list_last_entry()Michael Brown2012-05-081-1/+13
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for crc32_le()Michael Brown2012-05-072-0/+117
| | | | | | | Add self-tests for crc32_le() using test vectors generated with Perl's Digest::CRC. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Fix compiler warning on older gcc versionsMichael Brown2012-05-041-2/+2
| | | | | Reported-by: Alex Davies <alex@davz.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Allow certificate chains to be long-lived data structuresMichael Brown2012-05-042-127/+159
| | | | | | | | | | | | | | | | | At present, certificate chain validation is treated as an instantaneous process that can be carried out using only data that is already in memory. This model does not allow for validation to include non-instantaneous steps, such as downloading a cross-signing certificate, or determining certificate revocation status via OCSP. Redesign the internal representation of certificate chains to allow chains to outlive the scope of the original source of certificates (such as a TLS Certificate record). Allow for certificates to be cached, so that each certificate needs to be validated only once. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [list] Add list_for_each_entry_continue() and _continue_reverse()Michael Brown2012-05-041-14/+77
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Fix memory leak in settings self-testsMichael Brown2012-05-041-1/+2
| | | | | | Detected using Valgrind. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for setting typesMichael Brown2012-04-172-0/+279
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify image management commands and internal APIMichael Brown2012-03-251-5/+1Star
| | | | | | | | | | | | | | | | | | | | | | Remove the name, cmdline, and action parameters from imgdownload() and imgdownload_string(). These functions now simply download and return an image. Add the function imgacquire(), which will interpret a "name or URI string" parameter and return either an existing image or a newly downloaded image. Use imgacquire() to merge similar image-management commands that currently differ only by whether they take the name of an existing image or the URI of a new image to download. For example, "chain" and "imgexec" can now be merged. Extend imgstat and imgfree commands to take an optional list of images. Remove the arbitrary restriction on the length of image names. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add CMS self-testsMichael Brown2012-03-222-0/+1431
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add previous certificate in chain as a parameter to parse_next()Michael Brown2012-03-221-1/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add X.509 self-testsMichael Brown2012-03-222-0/+919
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for mktime()Michael Brown2012-03-192-0/+183
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Force caller to provide temporary storage for modular calculationsMichael Brown2012-03-181-6/+13
| | | | | | | | | | | | | bigint_mod_multiply() and bigint_mod_exp() require a fixed amount of temporary storage for intermediate results. (The amount of temporary storage required depends upon the size of the integers involved.) When performing calculations for 4096-bit RSA the amount of temporary storage space required will exceed 2.5kB, which is too much to allocate on the stack. Avoid this problem by forcing the caller to allocate temporary storage. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Allow entropy_enable() to return an errorMichael Brown2012-03-181-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for RSAMichael Brown2012-03-183-0/+667
| | | | | | | Add self-tests for the RSA algorithm using test vectors generated with the openssl tools. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Run self-tests as an embedded imageMichael Brown2012-03-181-4/+42
| | | | | | | Allow iPXE to exit after running self-tests, rather than locking the machine. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add big integer self-testsMichael Brown2012-03-142-0/+2430
| | | | | | These test vectors are generated using Perl's Math::BigInt. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Avoid using "static const" for test declarationsMichael Brown2012-03-073-6/+6
| | | | | | | | gcc will not warn about unused constant static variables. An unused test declaration is almost certainly a bug, so ensure that warnings are generated. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add NIST self-tests for AES128 and AES256 in CBC modeMichael Brown2012-03-064-0/+330
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add NIST self-tests for HMAC_DRBG using SHA-256Michael Brown2012-03-061-0/+544
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Allow HMAC_DRBG to use multiple underlying hash algorithmsMichael Brown2012-03-061-171/+216
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add NIST self-tests for Hash_df using SHA-256Michael Brown2012-03-061-0/+397
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Allow hash_df() to accept multiple underlying hash algorithmsMichael Brown2012-03-061-70/+75
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for MD5 algorithmMichael Brown2012-03-052-0/+94
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for SHA-256 algorithmMichael Brown2012-03-052-0/+102
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for byte-order swapping functionsMichael Brown2012-03-042-0/+92
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add entropy sample generatorMichael Brown2012-02-281-0/+70
| | | | | | | Allow a list of raw noise samples to be generated for offline analysis. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Allow self-tests to be run individuallyMichael Brown2012-02-272-6/+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>
* [rng] Add missing #include <string.h>Michael Brown2012-02-212-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add NIST self-tests for Hash_dfMichael Brown2012-02-192-0/+495
| | | | | | | | | | NIST provides a set of known-answer tests for the Hash_DRBG algorithm, which includes known answers for the derivation function Hash_df used as part of Hash_DRBG. Hash_DRBG is not an Approved algorithm for ANS X9.82, but the known answers for Hash_df (which is part of ANS X9.82) can still be used as part of the conformance testing for ANS X9.82. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add NIST self-tests for HMAC_DRBGMichael Brown2012-01-232-0/+796
| | | | | | | NIST provides a set of known-answer tests for the HMAC_DRBG algorithm, which can be used as part of the conformance testing for ANS X9.82. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for SHA-1 algorithmMichael Brown2012-01-114-0/+204
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [list] Add list functions required by ath9k driverMichael Brown2011-10-141-0/+172
| | | | | Originally-implemented-by: Scott K Logan <logans@cottsay.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for list manipulation functionsMichael Brown2011-10-142-0/+238
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add a basic infrastructure for running self-testsMichael Brown2011-10-141-0/+139
| | | | | | | | This self-test mechanism is inspired by Perl's Test::Simple and similar modules. The aim is to encourage the use of self-tests by making it as easy as possible to create self-test code Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Avoid unused variable warning in gcc 4.6Michael Brown2011-03-161-4/+2Star
| | | | | | Reported-by: Ralph Giles <giles@thaumas.net> Tested-by: Ralph Giles <giles@thaumas.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bofm] Add offline BOFM test facilityMichael Brown2011-03-031-0/+169
| | | | | | | | Testing BOFM involves gaining access to an IBM blade chassis, which is often not practical. Provide a facility for testing BOFM functionality outside of a real IBM blade context. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ioapi] Move get_memmap() to the I/O API groupPiotr Jaroszyński2010-08-161-1/+1
| | | | | | | | | pcbios specific get_memmap() is used by the b44 driver making all-drivers builds fail on other platforms. Move it to the I/O API group and provide a dummy implementation on EFI. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-204-56/+56
| | | | | | | | | | | Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Decode/encode URIs when parsing/unparsingJoshua Oreman2010-01-211-2/+5
| | | | | | | | | | | | | | | Currently, handling of URI escapes is ad-hoc; escaped strings are stored as-is in the URI structure, and it is up to the individual protocol to unescape as necessary. This is error-prone and expensive in terms of code size. Modify this behavior by unescaping in parse_uri() and escaping in unparse_uri() those fields that typically handle URI escapes (hostname, user, password, path, query, fragment), and allowing unparse_uri() to accept a subset of fields to print so it can be easily used to generate e.g. the escaped HTTP path?query request. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [i386] Add explicit flags and type on all .section declarationsMichael Brown2009-02-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Try to avoid future problems caused by implicit section flags and/or type information by instituting a policy that all .section declarations must explicitly state the flags and type. Most of this change was achieved using perl -pi \ -e 's/".text"$/".text", "ax", \@progbits/ ; ' \ -e 's/".text16"$/".text16", "ax", \@progbits/ ; ' \ -e 's/".text16.null"$/".text16.null", "ax", \@progbits/ ; ' \ -e 's/".text16.data"$/".text16.data", "aw", \@progbits/ ; ' \ -e 's/".data"$/".data", "aw", \@progbits/ ; ' \ -e 's/".data16"$/".data16", "aw", \@progbits/ ; ' \ -e 's/".bss"$/".bss", "aw", \@nobits/ ; ' \ -e 's/".bss16"$/".bss16", "aw", \@nobits/ ; ' \ -e 's/".prefix"$/".prefix", "ax", \@progbits/ ; ' \ -e 's/".prefix.lib"$/".prefix.lib", "awx", \@progbits/ ; ' \ -e 's/".prefix.data"$/".prefix.data", "aw", \@progbits/ ; ' \ -e 's/".weak"$/".weak", "a", \@nobits/ ; ' \ `git grep -l '\.section'`
* [comboot] Add COMBOOT and COM32 supportDaniel Verkamp2008-08-292-0/+176
|
* [GDB] Zero-extend 16-bit segment registersStefan Hajnoczi2008-06-301-2/+2
| | | | | | | When the 16-bit segment registers are accessed using 32-bit instructions the high order bytes are undefined on older CPUs. We now explicitly zero the high order bytes when snapshotting the CPU state. This ensures that the GDB stub reports consistent values for the segment registers.
* [GDB] Add watch and rwatch hardware watchpointsStefan Hajnoczi2008-06-302-0/+51
|
* [GDB] Remote debugging over UDPStefan Hajnoczi2008-06-301-6/+5Star
| | | | | | | | | | | | | | | | | This commit implements GDB over UDP. Using UDP is more complex than serial and has required some restructuring. The GDB stub is now built using one or both of GDBSERIAL and GDBUDP config.h options. To enter the debugger, execute the gPXE shell command: gdbstub <transport> [<options>...] Where <transport> is "serial" or "udp". For "udp", the name of a configured network device is required: gdbstub udp net0 The GDB stub listens on UDP port 43770 by default.