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

4057 Commits

Author SHA1 Message Date
Michael Brown 732bea2f88 [i386] Use memory address constraints in __bswap_16s() and __bswap_64s()
Minimise code size by forcing the use of memory addresses for
__bswap_16s() and __bswap_64s().  (__bswap_32s() cannot avoid loading the
value into a register.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 21:41:24 +00:00
Michael Brown e187de7239 [i386] Fix building on older versions of gcc
Fix a strict-aliasing error on certain versions of gcc.

Reported-by: Marko Myllynen <myllynen@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 21:34:46 +00:00
Michael Brown 76f5939736 [crypto] Replace SHA-1 implementation
Replace SHA-1 implementation from AXTLS with a dedicated iPXE
implementation which is around 40% smaller.  This implementation has
been verified using the existing SHA-1 self-tests (including the NIST
SHA-1 test vectors).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 17:42:29 +00:00
Michael Brown 4100edf9d7 [802.11] Eliminate use of AXTLS-specific SHA1_SIZE constant
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 15:29:24 +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 249a833ed4 [x86_64] Provide __bswap_{16,32,64}s()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 15:29:24 +00:00
Michael Brown af96c4151c [i386] Optimise byte-swapping functions and provide __bswap_{16,32,64}s()
Use the "bswap" instruction to shrink the size of byte-swapping code,
and provide the in-place variants __bswap_{16,32,64}s.

"bswap" is available only on 486 and later processors.  (We already
assume the presence of "cpuid" and "rdtsc", which are available only
on Pentium and later processors.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 15:14:47 +00:00
Michael Brown 4a32308b40 [tls] Add missing #include <stdlib.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 15:14:47 +00:00
Michael Brown c5c1ae42e6 [rng] Add missing #include <assert.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 15:14:20 +00:00
Michael Brown 4fde501e39 [802.11] Add missing #include <byteswap.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 15:14:16 +00:00
Michael Brown 281f9aa7a6 [tls] Send empty Certificate record if requested by server
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-03 22:47:16 +00:00
Michael Brown a42f6cab14 [tls] Verify the contents of the Finished record
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-03 22:29:20 +00:00
Michael Brown 56a7981d58 [tls] Allow transmitted records to be scheduled independently
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-03 22:15:25 +00:00
Michael Brown b7f8d1bbfd [tls] Add support for Server Name Indication (SNI)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-03 20:15:21 +00:00
Michael Brown d9ce3bfe4c [tls] Support TLS version 1.1
Advertise support for TLS version 1.1, and be prepared to downgrade to
TLS version 1.0.  Tested against Apache with mod_gnutls, using the
GnuTLSPriorities directive to force specific protocol versions.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-03 16:19:12 +00:00
Michael Brown d620606d3e [arp] Maintain an ARP transmission queue
Allow packet transmission to be deferred pending successful ARP
resolution.  This avoids the time spent waiting for a higher-level
protocol (e.g. TCP or TFTP) to attempt retransmission.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-02 23:46:29 +00:00
Michael Brown 6324bd9389 [undi] Allow underlying PXE stack to construct link-layer header
Some PXE stacks (observed with a QLogic 8242) will always try to
prepend a link-layer header, even if the caller uses P_UNKNOWN to
indicate that the link-layer header has already been filled in.  This
results in an invalid packet being transmitted.

Work around these faulty PXE stacks where possible by stripping the
existing link-layer header and allowing the PXE stack to (re)construct
the link-layer header itself.

Originally-fixed-by: Buck Huppmann <buckh@pobox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-02 18:02:03 +00:00
Michael Brown 1d293776ea [iscsi] Send any padding inline with the data segment
Some iSCSI targets respond to a PDU before receiving the padding
bytes.  If the target responds quickly enough, this can cause iPXE to
start processing a new TX PDU before the padding bytes have been sent,
which results in a protocol violation.

Fix by always transmitting the padding bytes along with the data
segment.

Originally-fixed-by: Shyam Iyer <shyam_iyer@dell.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-01 16:33:05 +00:00
Jason Lunz cb10137e19 [http] Recognise status code 303 as valid
As RFC 2616 10.3.4 explains, a 303 status is the proper HTTP 1.1
behavior for what most HTTP 1.0 clients did with code 302.

Signed-off-by: Jason Lunz <lunz@acm.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-01 16:16:53 +00:00
Michael Brown cd29df5c08 [vmware] Fix length returned by guestrpc_command()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-01 14:20:32 +00:00
Michael Brown fa538bdbc6 [vmware] Add VMware logfile console (CONSOLE_VMWARE)
Allow iPXE console output to be sent to the VMware logfile via the
GuestRPC mechanism.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-28 23:10:02 +00:00
Michael Brown 3a5823a126 [vmware] Add GuestRPC mechanism
Use the VMware backdoor I/O port to access the GuestRPC mechanism.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-28 23:10:02 +00:00
Michael Brown 851b93fbc3 [syslog] Separate out generic line-based console functionality
Abstract out the generic line-handling portions of the syslog
putchar() routine, to allow use by other console types.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-28 23:10:01 +00:00
Michael Brown c72b8969e2 [syslog] Disable console when no syslog server is defined
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>
2012-02-28 23:10:01 +00:00
Michael Brown 99de239867 [http] Allow for HTTPS-only builds
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>
2012-02-28 14:54:32 +00:00
Michael Brown 05719804b9 [rng] Add RTC-based entropy source
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>
2012-02-28 11:18:48 +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 5a80c11062 [crypto] Use ANS X9.82 Approved get_random_nz() for RSA
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:43:03 +00:00
Michael Brown 75090f2abf [tls] Use ANS X9.82 Approved RBG as source of random data for TLS
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:54 +00:00
Michael Brown 4fb60435c9 [rng] Add get_random_nz() function required by RSA algorithm
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>
2012-02-21 12:42:54 +00:00
Michael Brown 4e0effc6ad [rng] Add ANS X9.82 RBG wrapper functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:46 +00:00
Michael Brown c6b0b3424b [rng] Add ANS X9.82 mandatory start-up tests
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>
2012-02-21 12:42:45 +00:00
Michael Brown a3b116cea1 [rng] Add ANS X9.82 mandatory continuous tests
ANS X9.82 specifies two mandatory continuous tests to be performed
upon the noise source.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:45 +00:00
Michael Brown 073f41085f [rng] Add ANS X9.82 Approved Source of Entropy Input
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>
2012-02-21 12:42:38 +00:00
Michael Brown c2668b61ea [rng] Record validity within DRBG state
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>
2012-02-21 12:42:37 +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 a8756182c3 [802.11] Add missing #include <string.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:37 +00:00
Michael Brown bb36f3d7dc [udp] Propagate transmission errors to UDP interface users
Suggested-by: Simon Rowe <simon.rowe@eu.citrix.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-20 19:29:49 +00:00
Michael Brown 464ca5dbc0 [i386] Add missing #include <ipxe/io.h> in pic8259.h
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-19 22:09:13 +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 eec068253f [rng] Add ANS X9.82 Approved Hash_df derivation function
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>
2012-02-19 14:37:13 +00:00
Jarrod Johnson 32c4a3a255 [efi] Add iPXE download protocol
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>
2012-02-15 12:08:39 +00:00
Jarrod Johnson dc70229f70 [snpnet] Give up entirely on the transmit queue
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>
2012-02-12 13:57:07 +00:00
Paul Sands 4108321bf5 [contrib] Fix rom-o-matic
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-12 13:35:43 +00:00
Till Straumann d3630b6a64 [prefix] Fix missing underscore in libprefix
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-10 14:12:04 +00:00
Thomas Miletich 1476d6f47c [tg3] Remove tg3_calc_dma_bndry()
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>
2012-02-10 13:34:23 +00:00
Michael Brown 3a4253868c [prefix] Delay initrd image copy until memory map is ready
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>
2012-02-09 16:49:30 +00:00
Christian Hesse b5ed30b2d0 [tg3] Fix compilation on newer gcc versions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-09 16:00:05 +00:00
Thomas Miletich f6840ba83e [tg3] New tg3 driver
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>
2012-01-30 23:10:53 +00:00