aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-08-02[crypto] Add ASN.1 OIDs for sha{224,384,512}WithRsaEncryptionTufan Karadere1-0/+18
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-08-02[tls] Report supported signature algorithms in ClientHelloMichael Brown2-0/+28
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-08-01[tls] Do not access beyond the end of a 24-bit integerMichael Brown1-22/+29
The current implementation handles big-endian 24-bit integers (which occur in several TLS record types) by treating them as big-endian 32-bit integers which are shifted by 8 bits. This can result in "Invalid read" errors when running under valgrind, if the 24-bit field happens to be exactly at the end of an I/O buffer. Fix by ensuring that we touch only the three bytes which comprise the 24-bit integer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-31[serial] Check for UART existence in uart_select()Michael Brown3-15/+41
Check for existence of the UART in uart_select(), not just in uart_init(). This allows uart_select() to refuse to set a non-working address in uart->base, which in turns means that the serial console code will not attempt to use a non-existent UART. Reported-by: Torgeir Wulfsberg <Torgeir.Wulfsberg@kongsberg.com> Reported-by: Ján ONDREJ (SAL) <ondrejj@salstar.sk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-31[comboot] Avoid dragging in serial console support unconditionallyMichael Brown1-1/+3
When the ability for iPXE to handle multiple serial ports was added, the choice was made that the singular serial port referred to by COMBOOT calls should mean the port used for the serial console. This unintentionally caused IMAGE_COMBOOT to also enable CONSOLE_SERIAL. Fix by providing a weak-symbol version of the serial console which will be used if serial console support was not explicitly enabled. Reported-by: Torgeir Wulfsberg <Torgeir.Wulfsberg@kongsberg.com> Reported-by: Ján ONDREJ (SAL) <ondrejj@salstar.sk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-29[elf] Reject ELFBoot images requiring virtual addressingMichael Brown3-52/+131
We do not set up any kind of virtual addressing before invoking an ELFBoot image. Reject if the image's program headers indicate that virtual addresses are not equal to physical addresses. This avoids problems when loading some RHEL5 kernels, which seem to include ELFBoot headers using virtual addressing. With this change, these kernels are no longer detected as ELFBoot, and so may be (correctly) detected as bzImage instead. Reported-by: Torgeir.Wulfsberg@kongsberg.com Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-28[linebuf] Support buffering of multiple linesMichael Brown4-45/+358
Allow line buffer to accumulate multiple lines, with buffered_line() returning each freshly-completed line as it is encountered. This allows buffered lines to be subsequently processed as a group. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-28[pool] Add a generic concept of a pooled connectionMichael Brown2-0/+241
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-28[peerdist] Add support for constructing and decoding retrieval messagesMichael Brown1-0/+376
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-28[peerdist] Add support for constructing and decoding discovery messagesMichael Brown3-0/+334
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-28[peerdist] Include trimmed range within content information blockMichael Brown3-37/+76
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-28[netdevice] Allow network devices to disclaim IRQ support at runtimeMichael Brown3-1/+18
VLAN and 802.11 devices use a network device operations structure that wraps an underlying structure. For example, the vlan_operations structure wraps the network device operations structure of the underlying trunk device. This can cause false positives from the current implementation of netdev_irq_supported(), which will always report that VLAN devices support interrupts since it has no visibility into the support provided by the underlying trunk device. Fix by allowing network devices to explicitly flag that interrupts are not supported, despite the presence of an irq() method. Originally-fixed-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-28[iscsi] Add missing "break" statementsMichael Brown1-0/+2
iscsi_tx_done() is missing "break" statements at the end of each case. (Fortunately, this happens not to cause a bug in practice, since iscsi_login_request_done() is effectively a no-op when completing a data-out PDU.) Reported-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-28[ipv4] Allow IPv4 socket addresses to include a scope IDMichael Brown3-15/+50
Extend the IPv6 concept of "scope ID" (indicating the network device index) to IPv4 socket addresses, so that IPv4 multicast transmissions may specify the transmitting network device. The scope ID is not (currently) exposed via the string representation of the socket address, since IPv4 does not use the IPv6 concept of link-local addresses (which could legitimately be specified in a URI). Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-28[ipv4] Redefine IP address constants to avoid unnecessary byte swappingMichael Brown3-37/+44
Redefine various IPv4 address constants and testing macros to avoid unnecessary byte swapping at runtime, and slightly rename the macros to prevent code from accidentally using the old definitions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-28[netdevice] Avoid using zero as a network device indexMichael Brown1-2/+2
Avoid using zero as a network device index, so that a zero sin6_scope_id can be used to mean "unspecified" (rather than unintentionally meaning "net0"). Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-28[ipv6] Treat a missing network device name as "netX"Michael Brown2-4/+18
When an IPv6 socket address string specifies a link-local or multicast address but does not specify the requisite network device name (e.g. "fe80::69ff:fe50:5845" rather than "fe80::69ff:fe50:5845%net0"), assume the use of "netX". Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27[build] Fix strict-aliasing warning on older gcc versionsMichael Brown1-4/+8
Reported-by: James A. Peltier <jpeltier@sfu.ca> Reported-by: Matthew Helton <mwhelton@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27[crypto] Remove AXTLS headersMichael Brown5-526/+0
Remove AXTLS headers now that no AXTLS code remains, with many thanks to the AXTLS project for use of their cryptography code over the past several years. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27[test] Add NIST self-tests for AES192 in ECB and CBC modesMichael Brown1-1/+33
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27[crypto] Replace AES implementationMichael Brown5-635/+836
Replace the AES implementation from AXTLS with a dedicated iPXE implementation which is slightly smaller and around 1000% faster. This implementation has been verified using the existing self-tests based on the NIST AES test vectors. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27[test] Add NIST self-tests for AES128 and AES256 in ECB modeMichael Brown1-0/+38
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27[test] Define shortcuts for frequently-used NIST AES test vectorsMichael Brown1-25/+30
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27[test] Generalise cipher tests and use okx()Michael Brown5-213/+192
Generalise the existing support for performing CBC-mode block cipher tests, and update the code to use okx() for neater reporting of test results. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27[crypto] Add ECB block cipher mode (for debug and self-tests only)Michael Brown4-1/+142
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27[802.11] Use correct SHA1_DIGEST_SIZE constant nameMichael Brown1-1/+1
The constant SHA1_SIZE is defined only as part of the imported AXTLS code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27[crypto] Add bit-rotation functions for 8-bit and 16-bit valuesMichael Brown1-0/+20
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27[build] Fix compiler warnings on some gcc versionsMichael Brown1-1/+1
xfer_buffer() uses intf_get_dest_op() to obtain the destination interface for xfer_deliver(), in order to check that this is the same interface which provides xfer_buffer(). The return value from intf_get_dest_op() (which contains the actual method implementing xfer_deliver()) is not used. On some gcc versions, this triggers a "value computed is not used" warning, since the explicit type cast included within the intf_get_dest_op() macro is treated as a "value computed". Fix by explicitly casting the result of intf_get_dest_op() to void. Reported-by: Matthew Helton <mwhelton@gmail.com> Reported-by: James A. Peltier <jpeltier@sfu.ca> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[downloader] Provide direct access to the underlying data transfer bufferMichael Brown1-0/+14
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[downloader] Use generic data-transfer buffer mechanismMichael Brown1-74/+18
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[xferbuf] Add xfer_buffer() to provide direct access to underlying bufferMichael Brown2-0/+44
Allow data transfer buffer users to provide direct access to their underlying data transfer buffer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[xferbuf] Generalise to handle umalloc()-based buffersMichael Brown3-25/+268
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[xfer] Add xfer_check_order() utility functionMichael Brown2-0/+33
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[xfer] Use intf_poke() to implement xfer_window_changed()Michael Brown1-11/+1
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[interface] Add intf_poke() helperMichael Brown2-0/+30
Reduce the cost of implementing object methods which convey no information beyond the fact that the method has been called. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[profile] Add profile_custom() for profiling with arbitrary time unitsMichael Brown1-0/+14
Provide profile_custom() as a trivial wrapper around profile_update() to allow for the use of the profiling infrastructure by code using timers other than the default profile_timestamp() provider. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[fault] Add inject_corruption() to randomly corrupt dataMichael Brown2-0/+50
Provide an inject_corruption() function that can be used to randomly corrupt data bytes with configurable probabilities. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[fault] Generalise NETDEV_DISCARD_RATE fault injection mechanismMichael Brown6-8/+110
Provide a generic inject_fault() function that can be used to inject random faults with configurable probabilities. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[tcp] Ensure FIN is actually sent if connection is closed while idleMichael Brown1-0/+1
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[build] Add named configuration for qemuMichael Brown8-0/+10
Add a named configuration for qemu, based on the config.ipxe.general.h file taken from the current qemu repository and enabling the option to work around the missing EFI_PXE_BASE_CODE_PROTOCOL. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[efi] Allow user experience to be downgradedMichael Brown2-0/+35
iPXE does not currently provide EFI_PXE_BASE_CODE_PROTOCOL: this causes failures when chainloading bootloaders such as shim.efi which assume that this protocol will be present. Provide the ability to work around these problems via the build configuration option EFI_DOWNGRADE_UX. If this option is enabled, then we will not install our usual EFI_LOAD_FILE_PROTOCOL implementation, thereby allowing the platform firmware to install its own EFI_PXE_BASE_CODE_PROTOCOL implementation on top of our EFI_SIMPLE_NETWORK_PROTOCOL handle. A somewhat major side-effect of this workaround is that almost all iPXE features will be disabled. This configuration option will be removed in future when support for EFI_PXE_BASE_CODE_PROTOCOL is added. Requested-by: Laszlo Ersek <lersek@redhat.com> Requested-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[efi] Fix receive and transmit completion reportingMichael Brown2-80/+79
Fix the TxBuf value filled in by GetStatus() to report the transmit buffer address as required by the (now clarified) specification. Simplify "interrupt" handling in GetStatus() to report only that one or more packets have been transmitted or received; there is no need to report one GetStatus() "interrupt" per packet. Simplify receive handling to dequeue received packets immediately from the network device into an internal list (thereby avoiding the hacks previously used to determine when to report new packet arrivals). Originally-fixed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22[bios] Add ANSI blink attributeChristian Nilsson1-0/+6
Expose the high bit of the VGA text attribute byte via the ANSI SGR parameters 5 ("blink on") and 25 ("blink off"). Note that some video cards (and virtual machines) may display a high intensity background colour instead of blinking text. Signed-off-by: Christian Nilsson <nikize@gmail.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-06[tg3] Add support for BCM57766Bernd Wiebelt3-0/+3
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-06[ipoib] Transmit multicast packets as broadcastsMichael Brown1-2/+4
Multicast MAC addresses will never have REMAC cache entries, and the corresponding multicast IPoIB MAC address cannot be obtained simply by issuing an ARP request. For the trivial volume of multicast packets that we expect to send in any realistic scenario, the simplest solution is to send them as broadcasts instead. Reported-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-04[tcp] Gracefully close connections during shutdownMichael Brown2-1/+63
We currently do not wait for a received FIN before exiting to boot a loaded OS. In the common case of booting from an HTTP server, this means that the TCP connection is left consuming resources on the server side: the server will retransmit the FIN several times before giving up. Fix by initiating a graceful close of all TCP connections and waiting (for up to one second) for all connections to finish closing gracefully (i.e. for the outgoing FIN to have been sent and ACKed, and for the incoming FIN to have been received and ACKed at least once). Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-06-30[xen] Wait for and clear XenStore event before receiving dataMichael Brown2-0/+23
Older, out-of-tree Xen kernel modules (such as those provided with SuSE Linux Enterprise Server 11) do not clear the leftover "event pending" bit when opening an event channel. Consequently, no event is ever delivered to indicate that there is information in the XenStore ring buffer, and the system hangs shortly after loading the xen-platform-pci kernel module. Work around this problem by always waiting for the XenStore event channel to be signalled, and clearing the event before processing the received data. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-06-29[gdb] Allow gdbstub to be started on an arbitrary serial portMichael Brown2-7/+44
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-06-29[ipoib] Attempt to generate ARPs as needed to repopulate REMAC cacheMichael Brown3-8/+57
The only way to map an eIPoIB MAC address (REMAC) to an IPoIB MAC address is to intercept an incoming ARP request or reply. If we do not have an REMAC cache entry for a particular destination MAC address, then we cannot transmit the packet. This can arise in at least two situations: - An external program (e.g. a PXE NBP using the UNDI API) may attempt to transmit to a destination MAC address that has been obtained by some method other than ARP. - Memory pressure may have caused REMAC cache entries to be discarded. This is fairly likely on a busy network, since REMAC cache entries are created for all received (broadcast) ARP requests. (We can't sensibly avoid creating these cache entries, since they are required in order to send an ARP reply, and when we are being used via the UNDI API we may have no knowledge of which IP addresses are "ours".) Attempt to ameliorate the situation by generating a semi-spurious ARP request whenever we find a missing REMAC cache entry. This will hopefully trigger an ARP reply, which would then provide us with the information required to populate the REMAC cache. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-06-29[ipoib] Mark REMAC cache as expensiveMichael Brown1-1/+1
As with the neighbour cache, discarding an REMAC cache entry is potentially very disruptive. Originally-fixed-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>