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

216 Commits

Author SHA1 Message Date
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 6ba7fb7c5c [list] Add list_last_entry()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-08 12:49:01 +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 6a4b128191 [test] Fix compiler warning on older gcc versions
Reported-by: Alex Davies <alex@davz.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-04 18:46:26 +01:00
Michael Brown 557f467bab [crypto] Allow certificate chains to be long-lived data structures
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>
2012-05-04 17:54:31 +01:00
Michael Brown f91995f193 [list] Add list_for_each_entry_continue() and _continue_reverse()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-04 15:15:34 +01:00
Michael Brown 69fa29029c [test] Fix memory leak in settings self-tests
Detected using Valgrind.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-04 15:15:34 +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 1c127a6962 [image] Simplify image management commands and internal API
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>
2012-03-24 23:12:04 +00: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 2d9d0adc4e [crypto] Add previous certificate in chain as a parameter to parse_next()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-22 01:34:40 +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 3ec773cd2b [crypto] Force caller to provide temporary storage for modular calculations
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>
2012-03-18 20:22:43 +00:00
Michael Brown 196f0bb081 [rng] Allow entropy_enable() to return an error
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-18 17:05:37 +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 da76a489d6 [test] Run self-tests as an embedded image
Allow iPXE to exit after running self-tests, rather than locking the
machine.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-18 13:13:50 +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 8ad1e7ac12 [test] Avoid using "static const" for test declarations
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>
2012-03-07 00:35:58 +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 a810258b42 [rng] Add NIST self-tests for HMAC_DRBG using SHA-256
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-06 13:34:22 +00:00
Michael Brown b9d9c3f1d5 [rng] Allow HMAC_DRBG to use multiple underlying hash algorithms
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-06 13:12:30 +00:00
Michael Brown 0978251a66 [rng] Add NIST self-tests for Hash_df using SHA-256
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-05 23:51:54 +00:00
Michael Brown fb6a33360f [rng] Allow hash_df() to accept multiple underlying hash algorithms
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-05 23:23:45 +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 5d2e65c60f [rng] Add entropy sample generator
Allow a list of raw noise samples to be generated for offline
analysis.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-27 23:44:41 +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
Michael Brown a99d5d5aca [rng] Add missing #include <string.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:37 +00:00
Michael Brown 71804f890d [rng] Add NIST self-tests for Hash_df
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>
2012-02-19 14:37:49 +00:00
Michael Brown 9ec80a3df1 [rng] Add NIST self-tests for HMAC_DRBG
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>
2012-01-23 15:06:08 +00:00
Michael Brown 18d2887281 [test] Add self-tests for SHA-1 algorithm
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-11 10:38:28 +00:00
Michael Brown c28053027b [list] Add list functions required by ath9k driver
Originally-implemented-by: Scott K Logan <logans@cottsay.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-14 14:33:32 +01:00
Michael Brown d40bd11c62 [test] Add self-tests for list manipulation functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-14 14:33:32 +01:00
Michael Brown eac134f8dc [test] Add a basic infrastructure for running self-tests
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>
2011-10-14 14:33:31 +01:00
Michael Brown dbb27c9c3b [uri] Avoid unused variable warning in gcc 4.6
Reported-by: Ralph Giles <giles@thaumas.net>
Tested-by: Ralph Giles <giles@thaumas.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-16 20:21:08 +00:00
Michael Brown bdd00e872a [bofm] Add offline BOFM test facility
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>
2011-03-02 23:58:43 +00:00
Piotr Jaroszyński 5bbad9c8f0 [ioapi] Move get_memmap() to the I/O API group
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>
2010-08-16 16:54:03 +01:00
Michael Brown 8406115834 [build] Rename gPXE to iPXE
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>
2010-04-19 23:43:39 +01:00
Joshua Oreman 3d9dd93a14 [uri] Decode/encode URIs when parsing/unparsing
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>
2010-01-20 18:14:28 -05:00
Michael Brown c9e5b12473 [i386] Add explicit flags and type on all .section declarations
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'`
2009-02-15 10:59:53 +00:00
Daniel Verkamp e8b22f203f [comboot] Add COMBOOT and COM32 support 2008-08-28 23:52:19 +01:00
Stefan Hajnoczi 3715c8c721 [GDB] Zero-extend 16-bit segment registers
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.
2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 19386ec2c8 [GDB] Add watch and rwatch hardware watchpoints 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 6e670b5f38 [GDB] Remote debugging over UDP
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.
2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 59b5465b30 [GDB] Handle kill and detach packets.
This commit also includes a test to ensure that single stepping works,
since continue, kill, detach, and single step all share code.
2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 4180815a90 [GDB] Test suite for the GDB stub 2008-06-05 00:45:51 +01:00
Michael Brown 720e256c50 [Misc] Kill off long-redundant tests/dhcptest.c 2008-03-21 00:07:36 +00:00
Michael Brown 43013da9bf Quick hack to get AoE back in to the tree, on a par with the current
iSCSI hack.
2007-07-29 02:31:14 +01:00
Michael Brown 487dc5be56 Fix up iscsiboot missing prototype warnings 2007-07-09 01:10:32 +01:00
Michael Brown b94420a52b Ready to start testing 2007-07-08 22:01:49 +01:00
Marty Connor ec0da04e7d Warnings purge iscsiboot.c 2007-07-03 16:20:54 -04:00
Michael Brown 01b3dd4fc3 Line buffer API changed a while ago 2007-07-03 21:21:50 +01:00
Michael Brown 15f8323055 Removing obsolete files. 2007-07-01 15:30:12 +01:00
Michael Brown 07dc294de8 Update DHCP to use data-xfer interface (not yet tested). 2007-06-27 23:20:36 +01:00
Michael Brown b7ccdb7948 Add a couple of tests for the URI parsing and resolving code. 2007-06-03 02:15:00 +00:00
Michael Brown 73b09ecba6 Use stdio.h instead of vsprintf.h 2007-01-19 01:13:12 +00:00
Michael Brown a213876382 Typo 2007-01-19 00:48:13 +00:00
Michael Brown 544fa25928 Rename e{malloc,realloc,free} to u{malloc,realloc,free}, to more obviously
reflect the fact that they allocate and deallocate user memory (i.e.
things reached through a userptr_t).
2007-01-16 08:36:42 +00:00
Michael Brown 4e20d73bb5 Gave asynchronous operations approximate POSIX signal semantics. This
will enable us to cascade async operations, which is necessary in order to
properly support DNS.  (For example, an HTTP request may have to redirect
to a new location and will have to perform a new DNS lookup, so we can't
just rely on doing the name lookup at the time of parsing the initial
URL).

Anything other than HTTP is probably broken right now; I'll fix the others
up asap.
2007-01-15 08:49:10 +00:00
Michael Brown 698bbe0155 Obsolete 2007-01-14 04:28:42 +00:00
Michael Brown 497c3a5aad Fixed HTTP 2007-01-12 19:18:13 +00:00
Michael Brown 83b7933f8a Damn it; my lovely resilient scheme falls down when you have a protocol
that switches from line-oriented to byte-oriented partway through, such as
HTTP.
2007-01-12 18:09:14 +00:00
Michael Brown 996b091b50 Added generic line-buffering code (a la stdio) 2007-01-12 17:08:37 +00:00
Michael Brown 112d7f9d79 Code used for load buffer and multiboot image testing 2007-01-12 10:12:11 +00:00
Michael Brown 132a8fe49d Quick and dirty test for emalloc() 2007-01-12 03:27:05 +00:00
Michael Brown c810baad37 Use generic "struct image" rather than "struct elf". 2007-01-11 16:10:32 +00:00
Michael Brown d84ec0e5d5 Had this file lying around for ages; may as well check it in. 2007-01-11 15:31:50 +00:00
Michael Brown 91ac92bc86 Try image as ELF file first. (Don't yet actually try to execute it). 2007-01-11 15:27:06 +00:00
Michael Brown 3460860bef Print informative error message when boot fails. 2007-01-11 15:26:17 +00:00
Michael Brown 0010e10ef3 Update TFTP to use a struct buffer rather than a callback.
Add debug autocolourisation to TFTP.
2007-01-11 15:14:54 +00:00
Michael Brown fbfed96965 buffer.c should be using copy_{to,from}_user, rather than
copy_{to,from}_phys.
2007-01-11 05:42:06 +00:00
Michael Brown 6918cf9e9e Change FTP to use a data buffer rather than a callback function. 2007-01-11 04:51:20 +00:00
Michael Brown c0ef730ec4 Fix bug in buffer.c, add buffer mini-unit test. 2007-01-11 04:46:41 +00:00
Michael Brown d45c5e7ce7 Add "route" command (which currently only displays the routing table; it
can't modify it).
2007-01-10 20:51:14 +00:00
Michael Brown d9ba8f790b Add route() function to display routing table. 2007-01-10 20:38:20 +00:00
Michael Brown 649b789e93 DHCP transmits via specified net device, so no need to create a dummy
routing table entry just to fool ipv4.c any more.
2007-01-10 02:37:23 +00:00
Michael Brown 98b6154c3e Add "name" field to network device, to facilitate netdev commands. 2007-01-09 23:48:18 +00:00
Michael Brown 61ed298bc7 Merge changes from mcb-tcp-fixes branch. 2006-12-27 23:09:46 +00:00
Michael Brown a2e3357825 Cannot immediately overwrite the peer address when we parse
TargetAddress from the login response, because we still need the old
address while we close the connection!
2006-12-22 12:24:12 +00:00
Michael Brown 9485478acc ibft_fill_data() prototype change. 2006-12-21 18:42:51 +00:00
Michael Brown 024809d454 Use a bigger buffer for the initiator IQN 2006-12-21 17:42:02 +00:00
Michael Brown ab242a760d Add ability to shut down iSCSI connection 2006-12-21 17:17:47 +00:00
Michael Brown 286db6ffa3 Print explicit error message on iSCSI boot failure, and add
"Permission denied" as an error text to strerror().
2006-12-21 16:16:24 +00:00
Michael Brown 8e460de6be Obsolete, and no longer functions 2006-12-19 00:34:54 +00:00
Michael Brown 2ed2b2efe8 Use iskey() and getchar() to interact with console, rather than object
abstraction.
2006-12-18 16:46:25 +00:00
Michael Brown c0ec119ede Typo 2006-12-12 16:18:42 +00:00
Michael Brown 72b1629cee Add placeholder ibft.h 2006-12-08 16:16:21 +00:00
Michael Brown 9aa3e10d7c Use root-path option (as per RFC 4173) rather than filename option to
determine iSCSI boot parameters.
2006-12-08 15:53:49 +00:00
Michael Brown d88832ad7e Support PXE and iSCSI by default 2006-12-05 23:26:07 +00:00
Michael Brown 89bcb57201 Update ftp.c to work with Nikhil's TCP stack.
Remove the now-totally-obsolete sockaddr_in field from tcp.h.
2006-12-05 19:07:47 +00:00
Michael Brown 70d4b4f7cf Make the "drive number" option apply to iSCSI as well as AoE 2006-11-29 00:27:10 +00:00
Michael Brown 74c41fac06 Create "username" and "password" DHCP options, ready for placing this
information in NVS.
2006-11-28 02:14:20 +00:00
Michael Brown 3f0b4d9ed8 Updated to use asynchronous operation model for iSCSI requests
Added CHAP authentication
2006-11-28 00:29:02 +00:00
Marty Connor 31d65dd73f Minor edit to make HEAD build 2006-09-19 14:16:15 +00:00
Michael Brown 7e95980858 Added iBFT construction to iSCSI boot test 2006-08-27 23:54:20 +00:00
Michael Brown c48170ffaf Print net device name when making request. 2006-08-11 18:49:58 +00:00
Derek Pryor 25ea34a8d7 New HTTP protocol and test code 2006-08-11 14:13:02 +00:00
Michael Brown c9e6c33bba Attempt a PXE NBP boot as the TFTP test. 2006-08-09 03:00:11 +00:00
Michael Brown d1a123b1f4 Added TFTP test code (currently just dumps file to console). 2006-08-09 00:09:29 +00:00
Michael Brown 010288577f Add very, very quick and dirty hello world test 2006-08-07 18:49:10 +00:00
Michael Brown 8a3f4b7de6 Set a NUL terminator before calling inet_aton. 2006-08-07 17:50:41 +00:00
Michael Brown d0e4f198d6 Add iSCSI to the DHCP tests.
Start updating iscsi.c to use Nikhil's TCP API.
2006-08-07 16:48:24 +00:00
Michael Brown 9e761f5f28 Print out "DHCP..." message just in case people think the demo is sitting
there doing nothing when it's actually waiting for a DHCP reply.
2006-07-20 14:20:11 +00:00
Michael Brown a92d242008 Allow an AoE boot to be directed via DHCP, so that we have a proof of
concept demo that actually does something useful.
2006-07-20 14:15:23 +00:00
Michael Brown 7ca8bcd98c Print out the lease time, just to show how easy it is. 2006-07-20 03:02:34 +00:00
Michael Brown 00a1f000b1 Added dhcp_ipv4_option() and friends.
Added test code to configure the interface for IPv4 after DHCP.
2006-07-20 02:49:59 +00:00
Michael Brown 6d9d48537e Added some debug messages and DHCP test code 2006-07-19 17:49:31 +00:00
Dan Lynch f9887c3f0f started on ANSI sequence processing 2006-06-28 11:50:02 +00:00
Dan Lynch f78fa3c59d - working basic ansi termnal extension for mucurses 2006-06-27 17:11:57 +00:00
Dan Lynch 197c0c91b2 make path relative (so that I don't break eb top of tree !) 2006-06-27 13:28:43 +00:00
Dan Lynch 6d34baaef9 - testable console framework implementing mucurses SCREEN struct 2006-06-27 11:00:14 +00:00
Michael Brown 3a660f9b25 Update ftp.c and hello.c to use the generic async_operations API. 2006-06-19 15:46:58 +00:00
Michael Brown cce2e47ff4 Added iSCSI boot test code 2006-06-14 17:00:25 +00:00
Michael Brown d21fc3610f Added sample AoE test code to tree 2006-06-01 11:05:36 +00:00