summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [syslog] Disable console when no syslog server is definedMichael Brown2012-02-291-7/+5Star
| | | | | | | | Explicitly disable the syslog console when no syslog server is defined, rather than (ab)using the socket family address as an equivalent console-enabled flag. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Allow for HTTPS-only buildsMichael Brown2012-02-283-859/+889
| | | | | | | | Separate out the core HTTP functionality (which is shared by both HTTP and HTTPS) from the provision of the "http://" URI opener. This allows for builds that support only "https://" URIs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add RTC-based entropy sourceMichael Brown2012-02-284-1/+298
| | | | | | | | | | | The RTC-based entropy source uses the nanosecond-scale CPU TSC to measure the time between two 1kHz interrupts generated by the CMOS RTC. In a physical machine these clocks are driven from independent crystals, resulting in some observable clock drift. In a virtual machine, the CMOS RTC is typically emulated using host-OS constructions such as SIGALRM. 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>
* [crypto] Use ANS X9.82 Approved get_random_nz() for RSAMichael Brown2012-02-211-2/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tls] Use ANS X9.82 Approved RBG as source of random data for TLSMichael Brown2012-02-211-9/+35
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add get_random_nz() function required by RSA algorithmMichael Brown2012-02-212-0/+91
| | | | | | | | | RSA requires the generation of random non-zero bytes (i.e. a sequence of random numbers in the range [0x01,0xff]). ANS X9.82 provides various Approved methods for converting random bits into random numbers. The simplest such method is the Simple Discard Method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add ANS X9.82 RBG wrapper functionsMichael Brown2012-02-212-0/+157
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add ANS X9.82 mandatory start-up testsMichael Brown2012-02-211-0/+32
| | | | | | | ANS X9.82 specifies that the start-up tests shall consist of at least one full cycle of the continuous tests. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add ANS X9.82 mandatory continuous testsMichael Brown2012-02-212-1/+296
| | | | | | | ANS X9.82 specifies two mandatory continuous tests to be performed upon the noise source. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add ANS X9.82 Approved Source of Entropy InputMichael Brown2012-02-2112-64/+409
| | | | | | | | | | | | | | | | ANS X9.82 specifies several Approved Sources of Entropy Input (SEI). One such SEI uses an entropy source as the Source of Entropy Input, condensing each entropy source output after each GetEntropy call. This can be implemented relatively cheaply in iPXE and avoids the need to allocate potentially very large buffers. (Note that the terms "entropy source" and "Source of Entropy Input" are not synonyms within the context of ANS X9.82.) Use the iPXE API mechanism to allow entropy sources to be selected at compilation time. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Record validity within DRBG stateMichael Brown2012-02-212-4/+15
| | | | | | | | Treat an empty (zeroed) DRBG as invalid. This ensures that a DRBG that has not yet been instantiated (or that has been uninstantiated) will refuse to attempt to generate random bits. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add missing #include <string.h>Michael Brown2012-02-215-0/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [802.11] Add missing #include <string.h>Michael Brown2012-02-214-0/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [udp] Propagate transmission errors to UDP interface usersMichael Brown2012-02-201-4/+3Star
| | | | | Suggested-by: Simon Rowe <simon.rowe@eu.citrix.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [i386] Add missing #include <ipxe/io.h> in pic8259.hMichael Brown2012-02-191-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 ANS X9.82 Approved Hash_df derivation functionMichael Brown2012-02-192-0/+164
| | | | | | | | | ANS X9.82 specifies several Approved derivation functions for use in distributing entropy throughout a buffer. One such derivation function is Hash_df, which can be implemented using the existing iPXE SHA-1 functionality. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add iPXE download protocolJarrod Johnson2012-02-154-2/+513
| | | | | | | | | | | | | iPXE exposes some extended capabilities via the PXE FILE API to allow NBPs such as pxelinux to use protocols other than TFTP. Provide an equivalent interface as a UEFI protocol so that EFI binaries may also take advantage of iPXE's extended capabilities. This can be used with a patched version of elilo, for example: http://comments.gmane.org/gmane.comp.boot-loaders.elilo.general/147 Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [snpnet] Give up entirely on the transmit queueJarrod Johnson2012-02-121-32/+13Star
| | | | | | | | Practically speaking, it seems the convention is to only have one packet pending and not rely upon any mechanism to associate returned txbuf with txqueue. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [contrib] Fix rom-o-maticPaul Sands2012-02-126-27/+28
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Fix missing underscore in libprefixTill Straumann2012-02-101-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] Remove tg3_calc_dma_bndry()Thomas Miletich2012-02-103-29/+6Star
| | | | | | | | | | This function never did much in this driver anyway, and after commit b5ed30b2 ("[tg3] Fix compilation on newer gcc versions") it became apparent that its remaining functionality could be easily moved to tg3_test_dma(). Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Delay initrd image copy until memory map is readyMichael Brown2012-02-091-2/+8
| | | | | | | | | | | initrd_init() calls umalloc() to allocate space for the initrd image, but does so before hide_etherboot() has been called. It is therefore possible for the initrd to end up overwriting iPXE itself. Fix by converting initrd_init() from an init_fn to a startup_fn. Originally-fixed-by: Till Straumann <strauman@slac.stanford.edu> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] Fix compilation on newer gcc versionsChristian Hesse2012-02-093-13/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] New tg3 driverThomas Miletich2012-01-316-3905/+7001
| | | | | | | | | Replace the old Etherboot tg3 driver with a more up-to-date driver using the iPXE API. Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add ANS X9.82 Approved DRBG mechanismMichael Brown2012-01-233-0/+535
| | | | | | | | | ANS X9.82 specifies that an Approved DRBG must consist of an Approved algorithm wrapped inside an envelope which handles entropy gathering, prediction resistance, automatic reseeding and other housekeeping tasks. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add dummy entropy sourceMichael Brown2012-01-232-0/+138
| | | | | | | | | | | Cryptographic random number generation requires an entropy source, which is used as the input to a Deterministic Random Bit Generator (DRBG). iPXE does not currently have a suitable entropy source. Provide a dummy source to allow the DRBG code to be implemented. 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>
* [rng] Add ANS X9.82 Approved HMAC_DRBG algorithmMichael Brown2012-01-233-0/+496
| | | | | | | | | | ANS X9.82 specifies several Approved algorithms for use in a Deterministic Random Bit Generator (DRBG). One such algorithm is HMAC_DRBG, which can be implemented using the existing iPXE SHA-1 and HMAC functionality. This algorithm provides a maximum security strength of 128 bits. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lkrnprefix] Copy command line before installing iPXEMichael Brown2012-01-182-5/+41
| | | | | | | | | | | | The command line may be situated in an area of base memory that will be overwritten by iPXE's real-mode segments, causing the command line to be corrupted before it can be used. Fix by creating a copy of the command line on the prefix stack (below 0x7c00) before installing the real-mode segments. Reported-by: Dave Hansen <dave@sr71.net> 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>
* [dns] Allow trailing dots in DNS namesMichael Brown2012-01-111-9/+15
| | | | | Reported-by: Christian Hesse <list@eworm.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vmxnet3] Add VMware vmxnet3 driverMichael Brown2012-01-073-0/+1167
| | | | | Reviewed-by: Pete Holland <pholland27@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Provide PXENV_FILE_EXIT_HOOK only for ipxelinux.0 buildsMichael Brown2011-12-116-53/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PXENV_FILE_EXIT_HOOK is designed to allow ipxelinux.0 to unload both the iPXE and pxelinux components without affecting the underlying PXE stack. Unfortunately, it causes unexpected behaviour in other situations, such as when loading a non-embedded pxelinux.0 via undionly.kpxe. For example: PXE ROM -> undionly.kpxe -> pxelinux.0 -> chain.c32 to boot hd0 would cause control to return to iPXE instead of booting from the hard disk. In some cases, this would result in a harmless but confusing "No more network devices" message; in other cases stranger things would happen, such as being returned to the iPXE shell prompt. The fundamental problem is that when pxelinux detects PXENV_FILE_EXIT_HOOK, it may attempt to specify an exit hook and then exit back to iPXE, assuming that iPXE will in turn exit cleanly via the specified exit hook. This is not a valid assumption in the general case, since the action of exiting back to iPXE does not directly cause iPXE to exit itself. (In the specific case of ipxelinux.0, this will work since the embedded script exits as soon as pxelinux.0 exits.) Fix the unexpected behaviour in the non-ipxelinux.0 cases by including support for PXENV_FILE_EXIT_HOOK only when using a new .kkkpxe format. The ipxelinux.0 build process should therefore now use undionly.kkkpxe instead of undionly.kkpxe. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Modularise PXE API provisionMichael Brown2011-12-118-468/+272Star
| | | | | | | Use the linker table infrastructure to dispatch PXE API calls to the relevant function. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Tidy up debugging outputMichael Brown2011-12-081-13/+16
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Check for a valid PXE network device when applicableMichael Brown2011-12-082-11/+213
| | | | | | | | | Very nasty things can happen if a NULL network device is used. Check that pxe_netdev is non-NULL at the applicable entry points, so that this type of problem gets reported to the caller rather than being allowed to crash the system. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lotest] Accept non-loopback packets during testMichael Brown2011-12-081-58/+86
| | | | | | | | It can sometimes be awkward to prevent additional packets from being received during a loopback test. Allow such additional packets to be present without terminating the test. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [e1000e] Strip the Ethernet CRC from received packetsMichael Brown2011-12-081-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Retry PXENV_UNDI_INITIALIZE multiple timesMichael Brown2011-12-081-8/+30
| | | | | | | | | | | | | | | | On at least one PXE stack (Realtek r8169), PXENV_UNDI_INITIALIZE has been observed to fail intermittently due to a media test failure (PXE error 0x00000061). Retrying the call to PXENV_UNDI_INITIALIZE succeeds, and the NIC is then usable. It is worth noting that this particular Realtek PXE stack is already known to be unreliable: for example, it repeatably fails its own boot-time media test after every warm reboot. Fix by attempting PXENV_UNDI_INITIALIZE multiple times, with a short delay between each attempt to allow the link to settle. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Add PXE-mandated DHCP options [128,135] to parameter request listMichael Brown2011-12-061-0/+1
| | | | | | | | The PXE specification requires us to request DHCP options 128 to 135 inclusive, although these have no defined purpose. Suggested-by: Ralf Buettner <rab@bootix.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [e1000] Request notification of TX completionsMichael Brown2011-12-061-1/+1
| | | | | | | | | | | | | | | | | | | The RS bit is used to instruct the NIC to update the TX descriptor status byte. The RPS bit is used to instruct the NIC to defer this update until after the packet has been transmitted on the wire (rather than merely read into the transmit FIFO). The driver currently sets RPS but not RS. Some e1000 models seem to interpret this as implying that the status byte should be updated; some don't. On the ones that don't, we never see any TX completions and so rapidly run out of TX buffers. Fix by setting the RS bit in the TX descriptor. (We don't care about when the packet reaches the wire, so don't bother setting the RPS bit.) Reported-by: Miroslav Halas <miroslav.halas@bankofamerica.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Fail immediately if target rejects any of our parametersMichael Brown2011-12-051-12/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some iSCSI targets (observed with stgt) can be configured to reject connections that do not use header or data digests, and will respond with "HeaderDigest=Reject" and/or "DataDigest=Reject", while still allowing the connection to proceed to the full feature phase. According to a strict reading of RFC3720, we are perfectly safe to ignore these "Reject" messages: upon such a rejection "the negotiated key is left at its current value (or default if no value was set)". Since the default value for both HeaderDigest and DataDigest is "None", then the only viable conclusion to be drawn is that the value resulting from "Reject" is still "None". Unfortunately, stgt doesn't seem to agree with this interpretation of events, causing us to eventually report an unhelpful "connection timed out" message to the user when we don't get any response to our first PDU in full feature phase. Fix by detecting any rejected parameters and immediately reporting an error, which at least gives the user some insight as to what the real problem may be. Reported-by: Michal Suchanek <hramrach@centrum.cz> Tested-by: Michal Suchanek <hramrach@centrum.cz> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Include UNDI PCI driver within all-drivers buildMichael Brown2011-11-161-1/+1
| | | | | | | | | | | | | Commit 9b99d2a ("[build] Avoid generating ROMs with "match-any" vendor or device IDs") introduced a regression which caused the UNDI PCI driver to be omitted from the list of all drivers, and thus to be excluded from the all-drivers build. Fix by ensuring that the per-driver section of the Makefile is generated even when there are no ROMs to be built. Reported-by: Sven Dreyer <sven@dreyer-net.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Ensure hardware is quiescent when no interfaces are openMichael Brown2011-11-162-92/+271
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Reorder code in preparation for quiescing patchMichael Brown2011-11-151-190/+197
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Ensure hardware is quiescent when no interfaces are openMichael Brown2011-11-152-81/+217
| | | | | | | | | | | | | WinPE has been observed to call PXENV_UNDI_SHUTDOWN but not PXENV_STOP_UNDI. This means that Hermon hardware is left partially active (firmware running and one event queue mapped) when WinPE starts up, which can cause a Blue Screen of Death. Fix by ensuring that the hardware is left quiescent (with the firmware stopped) when no interfaces are open. Reported-by: Itay Gazit <itayg@mellanox.co.il> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Reorder code in preparation for quiescing patchMichael Brown2011-11-151-641/+648
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>