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

4121 Commits

Author SHA1 Message Date
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 6ed905aba2 [time] Add Linux time source using gettimeofday()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-04 17:54:31 +01:00
Michael Brown 6f3e7e90fc [malloc] Allow Valgrind to be used when all assertions are enabled
The free-memory-block traversal code triggers multiple warnings from
Valgrind when assertions are enabled, since the list consistency
checks performed by list_check() end up accessing areas that have been
marked as inaccessible.

Fix by ensuring that any memory areas that will be accessed by
list_check() are marked as defined when necessary.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-04 17:16:35 +01:00
Michael Brown 793b8b0893 [crypto] Fix memory leak in cms_verify_digest()
Detected using Valgrind.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-04 15:32:20 +01:00
Michael Brown 601cb3610f [crypto] Parse OCSP responder URI from X.509 certificate
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-04 15:15:34 +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 df2773193e [malloc] Discard all cached data on shutdown
Allow detection of genuine memory leaks by ensuring that all cached
data is freed on shutdown.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-04 15:15:34 +01:00
Michael Brown 838a76a042 [menu] Add "--default" option to "choose" command
Suggested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-28 23:42:15 +01:00
Michael Brown f8bb40b002 [realtek] Support RTL8139 cards within generic Realtek driver
RTL8139C+ cards use essentially the same datapath as RTL8169, which is
zerocopy and 64-bit capable.  Older RTL8139 cards use a single receive
ring buffer rather than a descriptor ring, but still share substantial
amounts of functionality with RTL8169.

Include support for RTL8139 cards within the generic Realtek driver,
since there is no way to differentiate between RTL8139 and RTL8139C+
cards based on the PCI IDs alone.

Many thanks to all the people who worked on the rtl8139 driver over
the years.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-28 19:10:41 +01:00
Kevin Tran e01cf6fb3a [http] Fix typo in memory allocation
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-27 21:07:12 +01:00
Michael Brown 1fe27a3e0e [myson] Replace driver for Myson Technology NICs
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-27 11:46:58 +01:00
Michael Brown 35e09c1a7c [natsemi] Fix test for addresses below 4GB
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-27 01:22:02 +01:00
Michael Brown 2c1e8d2cb1 [natsemi] Replace driver for National Semicondutor NICs
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-26 14:17:24 +01:00
Michael Brown bd16deaa87 [crypto] Do not allow build-time cryptography settings to be overridden
If a root certificate has been explicitly specified at build time
using TRUST=/path/to/cert then do not allow this to be overridden even
from a trustworthy settings source (such as VMware GuestInfo).

Similarly, if a client certificate (and private key) has been
explicitly specified at build time, then do not allow it to be
overridden at runtime.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-24 16:28:15 +01:00
Michael Brown 63d9cc28b9 [crypto] Allow client certificate to be changed without a rebuild
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-24 13:17:29 +01:00
Michael Brown 0e59417cec [build] Use $(xxx_DEPS) for additional dependency information
Some objects (embedded.o, rootcert.o, and clientcert.o) define
additional dependencies on external files, using syntax such as:

    $(BIN)/clientcert.o : $(CERT_LIST)

This dependency can be missed when using debug builds.  For example,
if DEBUG=clientcert is used, then the relevant object is
$(BIN)/clientcert.dbg1.o rather than $(BIN)/clientcert.o.

Fix by adding dependencies to $(clientcert_DEPS) instead:

    clientcert_DEPS += $(CERT_LIST)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-24 13:15:44 +01:00
Marin Hannache 8c42e0c210 [util] Remove obsolete Makefile rule for util/prototester.c
util/prototester.c was removed in commit a6d1815 ("Obsolete for some
time now") back in 2006.

Signed-off-by: Marin Hannache <mareo@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-24 11:45:24 +01:00
Marin Hannache 7865ae0dea [image] Remove non-working image loaders
The WinCE, a.out and FreeBSD loaders are designed to be #included by
core/loader.c, which no longer exists.  These old loaders are not
usable anymore and cause compilation failures when enabled in
config/general.h.

Signed-off-by: Marin Hannache <mareo@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-24 11:39:55 +01:00
Michael Brown 945e428137 [intel] Replace driver for Intel Gigabit NICs
Tested-by: Robin Smidsrød <robin@smidsrod.no>
Tested-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-23 23:29:18 +01:00
Michael Brown 45e0327987 [http] Avoid using stack-allocated memory in http_step()
http_step() allocates a potentially large block of storage (since the
URI can be arbitrarily long), and can be invoked as part of an already
deep call stack via xfer_window_changed().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-23 23:26:29 +01:00
Michael Brown a026a27f04 [script] Avoid using stack-allocated memory in process_line()
Script lines can be arbitrarily long; allocate on the heap rather than
on the stack.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-23 22:42:10 +01:00
Michael Brown de2616165b [xfer] Avoid using stack-allocated memory in xfer_printf()
xfer_printf() occasionally has to deal with strings that are
potentially long, such as HTTP URIs with multiple query parameters.
Allocating these on the stack can lead to stack overruns and memory
corruption.

Fix by using vasprintf() instead of a stack allocation.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-23 20:30:48 +01:00
Michael Brown 5b18489685 [realtek] Update link state when device is opened
The link state is currently set at probe time, and updated only when
the device is polled.  This results in the user seeing a misleading
stale "Link: down" message, if autonegotiation did not complete within
the short timespan of the probe routine.

Fix by updating the link state when the device is opened, so that the
message that ends up being displayed to the user reflects the real
link state at device open time.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-23 10:54:14 +01:00
Michael Brown 44d5ef9d7d [netdevice] Allow network device to update link state before checking
If the network interface has only just been opened (e.g. by the "dhcp"
command) then we should allow at least one opportunity for the card to
update the link state before testing it, to avoid false positives.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-21 16:28:29 +01:00
Michael Brown 38d2ad8676 [skel] Add skeleton network driver
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-21 08:05:24 +01:00
Michael Brown 8b0305e285 [efi] Fix compiler warning in elf2efi.c
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-21 08:05:24 +01:00
Michael Brown d3d87a2d92 [efi] Update link state in SNP device mode data
There is no explicit SNP API call to determine link state; the SNP
interface user may check the MediaPresent field within the mode data
at any time.

Update the MediaPresent field whenever the link state changes.

Reported-by: Michael R Turner <mikeyt@us.ibm.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-19 22:54:24 +01:00
Michael Brown 02f1f3066d [crypto] Allow trusted root certificate to be changed without a rebuild
Changing the trusted root certificate currently requires a rebuild of
the iPXE binary, which may be inconvenient or impractical.

Allow the list of trusted root certificate fingerprints to be
overridden using the "trust" setting, but only at the point of iPXE
initialisation.  This prevents untrusted sources of settings
(e.g. DHCP) from subverting the chain of trust, while allowing
trustworthy sources to change the trusted root certificate without
requiring a rebuild.

The basic idea is that if you are able to manipulate a trustworthy
source of settings (e.g. VMware GuestInfo or non-volatile stored
options), then you would be able to replace the iPXE binary anyway,
and so no security is lost by allowing such sources to override the
list of trusted root certificates.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-19 16:11:20 +01:00
Michael Brown 31e60de676 [settings] Add fetch_setting_copy()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-19 16:10:07 +01:00
Michael Brown 62eb2294f0 [multiboot] Place multiboot modules low in memory
Solaris assumes that there is enough space above the Multiboot modules
to use as a decompression and scratch area.  This assumption is
invalid when using iPXE, which places the Multiboot modules near the
top of (32-bit) memory.

Fix by copying the modules to an area of memory immediately following
the loaded kernel.

Debugged-by: Michael Brown <mcb30@ipxe.org>
Debugged-by: Scott McWhirter <scottm@joyent.com>
Tested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-19 13:13:32 +01:00
Michael Brown 2a0154db5b [realtek] Replace driver for Realtek Gigabit NICs
Tested-by: Thomas Miletich <thomas.miletich@gmail.com>
Debugged-by: Thomas Miletich <thomas.miletich@gmail.com>
Tested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-18 16:33:36 +01:00
Michael Brown 9b2aabe534 [mii] Add generic MII reset function
iPXE provides no support for manually configuring the link speed.
Provide a generic routine which should be able to reset any MII/GMII
PHY and enable autonegotiation.

Prototyped-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-18 16:33:18 +01:00
Michael Brown d27e6d6efd [mii] Synchronise constants with current Linux include/linux/mii.h
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-18 16:32:57 +01:00
Michael Brown 2f3f0ca953 [mii] Remove unused functionality
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-18 16:32:57 +01:00
Robin Smidsrød eadb6bc3fe [util] Add utility to generate list of supported network cards
niclist.pl recursively scans specified source folders and builds a
list of supported NICs by looking for ISA_ROM and PCI_ROM lines and
outputs the list in text, CSV, JSON, HTML or DokuWiki format.  Sorting
and column selection is possible.

The pci-utils pci.ids file is fetched from SourceForge once a day to
also output the "official" vendor/device names associated with the PCI
device.

Signed-off-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-18 10:38:22 +01:00
Michael Brown a9cf527641 [vmware] Allow settings to be specified in the VMware .vmx file
Allow iPXE settings to be specified in the .vmx file via the VMware
GuestInfo mechanism.  For example:

    guestinfo.ipxe.filename = "http://boot.ipxe.org/demo/boot.php"
    guestinfo.ipxe.dns = "192.168.0.1"
    guestinfo.ipxe.net0.ip = "192.168.0.15"
    guestinfo.ipxe.net0.netmask = "255.255.255.0"
    guestinfo.ipxe.net0.gateway = "192.168.0.1"

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-17 17:47:33 +01:00
Michael Brown 52e5ddce68 [tftp] Allow builds without TFTP support
Allow TFTP to be configured out by moving the next-server setting
definition (which is used by autoboot.c) from tftp.c to settings.c.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-17 11:50:11 +01:00
Michael Brown 831b16adde [settings] Split fetching and storing out of setting type handlers
Refactor setting type handlers to parse and format values, rather than
storing and fetching formatted values.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-17 10:46: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 1d33649516 [libc] Allow strtoul() to interpret negative numbers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-17 10:42:08 +01:00
Michael Brown d11b82f0e4 [multiboot] Include full image URI in command line
Solaris kernels seem to rely on having the full kernel path present in
the multiboot command line; if only the kernel name is present then
the boot fails with the error message

  krtld: failed to open 'unix'

Debugged-by: Michael Brown <mcb30@ipxe.org>
Debugged-by: Scott McWhirter <scottm@joyent.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-15 00:38:43 +01:00
Marin Mareo Hannache cc288dc0f8 [linux] Fix a build error on some platforms
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-10 20:32:56 +01:00
Marin Mareo Hannache 6ab98fa9f7 [tftp] Remove configuration option for tftm
DOWNLOAD_PROTO_TFTM is now useless as tftm support has been merged
into tftp.c.  DOWNLOAD_PROTO_TFTP should be used instead.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-10 20:32:50 +01:00
Michael Brown 196751ce95 [build] Enable warnings when building utilities
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-10 19:38:54 +01:00
Erik Jacobson 96a8c70a0c [igbvf] Add i350 virtual function support
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-10 13:53:24 +01:00
Daniel Hokka Zakrisson 0e4a5ca4c7 [e1000e] Basic 82579 support
Add support for 82579-based chips such as those found on Sandy Bridge
motherboards.  Based on d3738bb8203acf8552c3ec8b3447133fc0938ddd in
Linux.

Signed-off-by: Daniel Hokka Zakrisson <daniel@hozac.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-10 13:47:19 +01:00
Stefan Weil dcccb1fb7b [tls] Fix wrong memset in function tls_clear_cipher
sizeof(cipherspec) is obviously wrong in this context, because it will
only zero the first 4 or 8 bytes (cipherspec is a pointer).

This problem was reported by cppcheck.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-10 13:14:15 +01:00
Stefan Weil ede37e493d [crypto] Fix wrong setup in function aes_wrap
Use explicit size in memset because 8 bytes must be set always.

This problem was reported by cppcheck.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-10 13:14:15 +01:00