summaryrefslogtreecommitdiffstats
path: root/src/include
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into openslxopenslxSimon Rettberg2026-01-28496-2038/+10095
|\
| * [build] Mark known reviewed files as permitted for UEFI Secure BootMichael Brown2026-01-1487-0/+89
| | | | | | | | | | | | | | | | | | Some past security reviews carried out for UEFI Secure Boot signing submissions have covered specific drivers or functional areas of iPXE. Mark all of the files comprising these areas as permitted for UEFI Secure Boot. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [build] Mark core files as permitted for UEFI Secure BootMichael Brown2026-01-14232-0/+232
| | | | | | | | | | | | | | | | | | | | | | | | Mark all files used in a standard build of bin-x86_64-efi/snponly.efi as permitted for UEFI Secure Boot. These files represent the core functionality of iPXE that is guaranteed to have been included in every binary that was previously subject to a security review and signed by Microsoft. It is therefore legitimate to assume that at least these files have already been reviewed to the required standard multiple times. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Mark imported EDK2 headers as permitted for Secure BootMichael Brown2026-01-13123-2/+126
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Update to current EDK2 headersMichael Brown2026-01-131-22/+22
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [build] Define a mechanism for marking Secure Boot permissibilityMichael Brown2026-01-131-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | Not all files within the iPXE codebase are allowed to be included in UEFI Secure Boot signed builds. Following the pattern used by the existing FILE_LICENCE() macro and licensing check: define a FILE_SECBOOT() macro that can be used to declare a file as being permitted (or forbidden) in a UEFI Secure Boot signed build, and a corresponding build target to perform the check. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [tcp] Report TCP statistics via the "ipstat" commandMichael Brown2026-01-091-0/+17
| | | | | | | | | | | | | | | | | | | | | | Gather some basic statistics on TCP connections to allow out-of-order packets and duplicate packets to be observed even in non-debug builds. Report these statistics via the existing "ipstat" command, rather than introducing a separate "tcpstat" command, on the basis that we do not need the additional overhead of a separate command. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [neighbour] Add the ability to artificially delay outbound packetsMichael Brown2026-01-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a fault-injection mechanism that allows an arbitrary delay (configured via config/fault.h) to be added to any packets transmitted via the neighbour resolution mechanism, as a way of reproducing symptoms that occur only on high-latency connections such as a satellite uplink. The neighbour discovery mechanism is not a natural conceptual fit for this artficial delay, since neighbour discovery has nothing to do with transmit latency. However, the neighbour discovery mechanism happens to already include a deferred transmission queue that can be (ab)used to implement this artifical delay in a minimally intrusive way. In particular, there is zero code size impact on a standard build with no artificial delay configured. Implementing the delay only for packets transmitted via neighbour resolution has the side effect that broadcast packets (such as DHCP and ARP) are unaffected. This is likely in practice to produce a better emulation of a high-latency uplink scenario, where local network traffic such as DHCP and ARP will complete quickly and only the subsequent TCP/UDP traffic will experience delays. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [neighbour] Use discovery protocol field to identify incomplete neighboursMichael Brown2026-01-061-13/+2Star
| | | | | | | | | | | | | | | | | | Use the discovery protocol pointer field (rather than the running state of the discovery timer) to determine whether or not neighbour discovery is ongoing, as a precursor to allowing the timer to be (ab)used for adding deliberate latency to transmitted packets. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [neighbour] Always use network device's own link-layer addressMichael Brown2026-01-053-9/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API for neighbour_tx() allows for an explicit source link-layer address, but this will be ignored if the packet is deferred for transmission after completion of neighbour discovery. The network device's own link-layer address will always be used when sending neighbour discovery packets, and when sending any deferred packets after discovery completes. All callers pass in the network device's own link-layer address as the source address anyway, and so this explicit source link-layer address is never used for any meaningful purpose. Simplify the neighbour_tx() API by removing the ability to pass in an explicit source link-layer address. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Allow for zero-length big integer literalsMichael Brown2025-12-291-2/+2
| | | | | | | | | | | | | | | | | | | | Ensure that zero-length big integer literals are treated as containing a zero value. Avoid tests on every big integer arithmetic operation by ensuring that bigint_required_size() always returns a non-zero value: the zero-length tests can therefore be restricted to only bigint_init() and bigint_done(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Add ECDSA-based TLS cipher suitesMichael Brown2025-12-191-0/+6
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Add OID-identified algorithms for ECDSA with SHA2 hash familyMichael Brown2025-12-192-0/+25
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Allow ecPublicKey to be identified as a public-key algorithmMichael Brown2025-12-191-0/+1
| | | | | | | | | | | | | | | | Add a public-key algorithm to the definition of the "ecPublicKey" OID-identified algorithm, and move this definition to ecdsa.c to avoid unconditionally dragging in ECDSA support. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Add support for ECDSA signaturesMichael Brown2025-12-192-0/+20
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Allow for an explicit representation of point at infinityMichael Brown2025-12-184-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ECDSA requires the ability to add two arbitrary curve points, either of which may legitimately be the point at infinity. Update the API so that curves must choose an explicit affine representation for the point at infinity, and provide a method to test for this representation. Multiplication and addition will now allow this representation to be provided as an input, and will not fail if the result is the point at infinity. Callers must explicitly check for the point at infinity where needed (e.g. after computing the ECDHE shared secret curve point). Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Generalise rsa_parse_integer() to asn1_enter_unsigned()Michael Brown2025-12-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ECDSA signature values and private keys are fixed-length unsigned integers modulo N (the group order of the elliptic curve) and are therefore most naturally represented in ASN.1 using ASN1_OCTET_STRING. Private key representations do use ASN1_OCTET_STRING, but signature values tend to use ASN1_INTEGER, which adds no value but does ensure that the encoding becomes variable-length and requires handling a pointless extra zero byte if the MSB of the unsigned value happens to be set. RSA also makes use of ASN1_INTEGER for modulus and exponent values. Generalise the existing rsa_parse_integer() to asn1_enter_unsigned() to allow this code to be reused for ECDSA. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Allow for addition of arbitrary Weierstrass curve pointsMichael Brown2025-12-082-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ECDSA verification requires the ability to add two arbitrary curve points (as well as the ability to multiply a curve point by a scalar). Add an elliptic curve method to perform arbitrary point addition. Pass in curve points as affine coordinates: this will require some redundant conversions between affine coorfinates and the internal representation as projective coordinates in Montgomery form, but keeps the API as simple as possible. Since we do not expect to perform a high volume of ECDSA signature verifications, these redundant calculations are an acceptable cost for keeping the code simple. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Expose the (prime) group order as an elliptic curve propertyMichael Brown2025-12-052-1/+5
| | | | | | | | | | | | | | | | | | | | | | ECDSA requires knowledge of the group order of the base point, and is defined only for curves with a prime group order (e.g. the NIST curves). Add the group order as an explicit property of an elliptic curve, and add tests to verify that the order is correct. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Expose the base point as an explicit elliptic curve propertyMichael Brown2025-12-052-1/+4
| | | | | | | | | | | | | | | | Add the generator base point as an explicit property of an elliptic curve, and remove the ability to pass a NULL to elliptic_multiply() to imply the use of the generator base point. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [http] Abort connections after a long period of inactivityMichael Brown2025-12-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once an HTTP download has started (i.e. once all request headers have been sent), we generally have no more data to transmit. If an HTTP connection dies silently (e.g. due to a network failure, a NIC driver bug, or a server crash) then there is no mechanism that will currently detect this situation by default. We do send TCP keep-alives (to maintain state in intermediate routers and firewalls), but we do not attempt to elicit a response from the server. RFC 9293 explicitly states that the absence of a response to a TCP keep-alive probe must not be interpreted as indicating a dead connection, since TCP cannot guarantee reliable delivery of packets that do not advance the sequence number. Scripts may use the "--timeout" option to impose an overall time limit on downloads, but this mechanism is off by default and requires additional thought and configuration by the user (which goes against iPXE's general philosophy of being as automatic as possible). Add an idle connection watchdog timer which will cause the HTTP download to abort after 120 seconds of inactivity. Activity is defined as an I/O buffer being delivered to the HTTP transaction's upstream data transfer interface. Downloads over HTTPS may experience a substantial delay until the first recorded activity, since all TLS negotiation (including cross-chained certificate downloads and OCSP checks) must complete before any application data can be sent. We choose to not reset the watchdog timer during TLS negotiation, on the basis that 120 seconds is already an unreasonably long time for a TLS negotiation to take to complete. If necessary, resetting the watchdog timer could be accomplished by having the TLS layer deliver zero-length I/O buffers (via xfer_seek()) to indicate forward progress being made. When using PeerDist content encoding, the downloaded content information is not passed through to the content-decoded interface and so will not be classed as activity. Any activity in the individual PeerDist block downloads (either from peers or as range requests from the origin server) will be classed as activity in the overall download, since individual block downloads do not buffer data but instead pass it through directly via the PeerDist download multiplexer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [http] Rename connection retry timerMichael Brown2025-12-041-1/+1
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Allow for OID-identified elliptic curve algorithmsMichael Brown2025-12-031-2/+12
| | | | | | | | | | | | | | | | | | Elliptic curves in X.509 certificates are identified via the id-ecPublicKey object identifier (1.2.840.10045.2.1), with the specific elliptic curve identified via a second OID in the algorithm parameters. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Remove obsolete maximum output length methodMichael Brown2025-12-021-13/+0Star
| | | | | | | | | | | | | | | | Now that public-key algorithms use ASN.1 builders to dynamically allocate the output data, there is no further need for callers to be able to determine the maximum output length. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Construct asymmetric ciphered data using ASN.1 buildersMichael Brown2025-12-021-16/+18
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Construct signatures using ASN.1 buildersMichael Brown2025-12-011-4/+5
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Pass signatures for verification as ASN.1 cursorsMichael Brown2025-12-011-6/+5Star
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [crypto] Restructure handling of ASN.1 bit stringsMichael Brown2025-12-013-18/+6Star
| | | | | | | | | | | | | | | | | | | | | | | | Signature values in ASN.1 tend to be encoded as bit strings rather than octet strings. In practice, no existent signature scheme uses a non-integral number of bytes. Switch to using a standard ASN.1 cursor to hold signature values, to simplify consuming code. Restructure the API to treat entering an ASN.1 bit string in the same way as entering any other ASN.1 type. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Allow for creating devices with no EFI parent deviceMichael Brown2025-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On some systems (observed on an AWS m8g.medium instance in eu-west-2), the UEFI firmware fails to enumerate some of the underlying hardware devices. On these systems, we cannot comply with the UEFI device model by adding our SNP device as a child of the hardware device and appending to the parent hardware device path, since no parent hardware device has been created. Work around these systems by allowing for the creation of SNP devices with no parent device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [pci] Use runtime selectable PCI I/O API for EFI cloud buildsMichael Brown2025-11-251-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some systems (observed on an AWS m8g.medium instance in eu-west-2), the UEFI firmware omits the PCI host bridge drivers for all but the first PCI bus. The observable result is that any devices on other PCI buses (such as the ENA network device) are not enumerated by the UEFI firmware and are therefore unusable by iPXE. Support these systems by switching to using PCIAPI_CLOUD for EFI cloud builds, trying the EFI PCI I/O API first and falling back to direct access (via ECAM) for devices that the UEFI firmware has failed to enumerate itself. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [pci] Allow probing permission to vary by rangeMichael Brown2025-11-256-15/+12Star
| | | | | | | | | | | | | | Make pci_can_probe() part of the runtime selectable PCI I/O API, and defer this check to the per-range API. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [pci] Use linker tables for runtime selectable PCI APIsMichael Brown2025-11-243-18/+68
| | | | | | | | | | | | | | Use the linker table mechanism to enumerate the underlying PCI I/O APIs, to allow PCIAPI_CLOUD to become architecture-independent code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Wrap a selection of runtime services callsMichael Brown2025-11-131-0/+1
| | | | | | | | | | | | | | Allow DEBUG=efi_wrap to trace various runtime services calls as well as the existing boot services calls. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Add image security database GUID definitionMichael Brown2025-11-121-0/+1
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Add Microsoft vendor GUID definitionMichael Brown2025-11-123-1/+60
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Add storage security command protocol header and GUID definitionMichael Brown2025-11-122-0/+213
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Update to current EDK2 headersMichael Brown2025-11-1217-66/+239
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Mark Arm/ProcessorBind.h as a non-imported headerMichael Brown2025-11-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | Support for ARM32 has been removed from the EDK2 codebase. However, we may as well retain the ability to build iPXE for existing EFI platforms. Add an iPXE include guard to this file so that the EDK2 header import script will no longer attempt to import it from the EDK2 tree. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Mark Ip4Config.h as a non-imported headerMichael Brown2025-11-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | The Ip4Config.h header has been removed from the EDK2 codebase as obsolete. However, we may still encounter it in the wild and so it is useful to retain the GUID and the corresponding protocol name for debug messages. Add an iPXE include guard to this file so that the EDK2 header import script will no longer attempt to import it from the EDK2 tree. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Mark UgaDraw.h as a non-imported headerMichael Brown2025-11-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | The UgaDraw.h header has been removed from the EDK2 codebase as obsolete. However, we may still encounter it in the wild and so it is useful to retain the GUID and the corresponding protocol name for debug messages. Add an iPXE include guard to this file so that the EDK2 header import script will no longer attempt to import it from the EDK2 tree. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [efi] Skip including the EDK2 ProcessorBind.h header for 32-bit RISC-VMichael Brown2025-11-111-33/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently include the EDK2 RiscV64/ProcessorBind.h header when building for 32-bit RISC-V, as a placeholder since there is no support for 32-bit RISC-V in upstream EDK2. This causes errors when attempting to use the EDK2 VA_START() et al macros, since RiscV64/ProcessorBind.h ends up defining UINTN with a size different from the size of a pointer. Fix by falling back to the generic definitions for UINTN etc (as used for EFI_HOSTONLY) whenever we don't have an architecture-specific ProcessorBind.h header available. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [pci] Move ECAM pci_can_probe() definition to correct header fileMichael Brown2025-11-112-10/+10
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [spcr] Accept alternative type value for a 16550-compatible UARTMichael Brown2025-11-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Some systems (observed on an AWS EC2 m7i.metal-24xl instance in eu-south-2) use the newer "16550-compatible with parameters defined in Generic Address Structure" type value. (There does not appear to be any particular reason why the newer value needs to be used: the UART is still a standard 16550 with single-byte registers.) Accept this additional type value for a 16550-compatible UART. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [spcr] Add support for the ACPI Serial Port Console Redirection tableMichael Brown2025-11-054-0/+96
| | | | | | | | | | | | | | | | | | | | | | The BIOS may provide an ACPI Serial Port Console Redirection (SPCR) table to describe the serial port to be used for early boot messages. Add support for parsing the SPCR and instantiating a 16550-based UART. We do not currently attempt to support other types of UART, since iPXE does not yet have drivers for other types. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [acpi] Add acpi_ioremap() to map an ACPI-described addressMichael Brown2025-11-051-6/+24
| | | | | | | | | | | | | | | | | | An ACPI Generic Address Structure (GAS) may be used to describe the location of a peripheral such as an early boot console. Add the relevant definitions and provide acpi_ioremap() as a helper function to map a region described using this structure. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [uart] Make baud rate a property of the UARTMichael Brown2025-11-051-5/+6
| | | | | | | | | | | | | | | | Make the current baud rate (if specified) a property of the UART, to allow the default_serial_console() function to specify the default baud rate as well as the default UART device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [uart] Support 16550 UARTs accessed via either MMIO or port I/OMichael Brown2025-11-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | Use the combined accessors ioread8() and iowrite8() to read and write 16550 UART registers, to allow the decision between using MMIO and port I/O to be made at runtime. Minimise the increase in code size for x86 by ignoring the register shift, since this is essentially used only for non-x86 SoCs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [ioapi] Provide combined MMIO and port I/O accessorsMichael Brown2025-11-042-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some devices (such as a 16550 UART) may be accessed via either MMIO or port I/O. This is currently forced to be a compile-time decision. For example: we currently access a 16550 UART via port I/O on x86 and via MMIO on any other platform. PCI UARTs with MMIO BARs do exist but are not currently supported in an x86 build of iPXE. Some AWS EC2 systems (observed on a c6i.metal instance in eu-west-2) provide only a PCI MMIO UART, and it is therefore currently impossible to get serial output from iPXE on these instance types. Add ioread8(), ioread16(), etc accessors that will select between MMIO and port I/O at the point of use. For non-x86 platforms where we currently have no port I/O support, these simply become wrappers around the corresponding readb(), readw(), etc MMIO accessors. On x86, we use the fairly well-known trick of treating any 16-bit address (below 64kB) as a port I/O address. This trick works even in the i386 BIOS build of iPXE (where virtual addresses are offset from physical addresses by a runtime constant), since the first 64kB of the virtual address space will correspond to the iPXE binary itself (along with its uninitialised-data space), and so must be RAM rather than a valid MMIO address range. Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [pci] Record prefetchable memory window for PCI bridgesMichael Brown2025-10-142-1/+9
| | | | | | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
| * [pci] Handle sizing of 64-bit BARsMichael Brown2025-10-141-1/+3
| | | | | | | | | | | | | | | | Provide pci_bar_set() to handle setting the base address for a potentially 64-bit BAR, and rewrite pci_bar_size() to correctly handle sizing of 64-bit BARs. Signed-off-by: Michael Brown <mcb30@ipxe.org>