summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2024-12-06mbedtls: remove MBEDTLS_HAVE_TIMEIlias Apalodimas
When MbedTLS TLS features were added MBEDTLS_HAVE_TIME was defined as part of enabling https:// support. However that pointed to the wrong function which could crash if it received a NULL pointer. Looking closer that function is not really needed, as it only seems to increase the RNG entropy by using 4b of the current time and date. The reason that was enabled is that lwIP was unconditionally requiring it, although it's configurable and can be turned off. Since lwIP doesn't use that field anywhere else, make it conditional and disable it from our config. Fixes: commit a564f5094f62 ("mbedtls: Enable TLS 1.2 support") Reported-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2024-12-06net: disable MBEDTLS in SPLHeinrich Schuchardt
Building SPL fails with MBEDTLS enabled. Currently we don't need it there. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2024-12-06lmb: prohibit allocations above ram_top even from same bankSughosh Ganu
There are platforms which set the value of ram_top based on certain restrictions that the platform might have in accessing memory above ram_top, even when the memory region is in the same DRAM bank. So, even though the LMB allocator works as expected, when trying to allocate memory above ram_top, prohibit this by marking all memory above ram_top as reserved, even if the said memory region is from the same bank. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Andreas Schwab <schwab@suse.de>
2024-12-05lmb: Fix the allocation of overlapping memory areas with !LMB_NONEIlias Apalodimas
At the moment the LMB allocator will return 'success' immediately on two consecutive allocations if the second one is smaller and the flags match without resizing the reserved area. This is problematic for two reasons, first of all the new updated allocation won't update the size and we end up holding more memory than needed, but most importantly it breaks the EFI SCT tests since EFI now allocates via LMB. More specifically when EFI requests a specific address twice with the EFI_ALLOCATE_ADDRESS flag set, the first allocation will succeed and update the EFI memory map. Due to the LMB behavior the second allocation will also succeed but the address ranges are already in the EFI memory map due the first allocation. EFI will then fail to update the memory map, returning EFI_OUT_OF_RESOURCES instead of EFI_NOT_FOUND which break EFI conformance. So let's remove the fast check with is problematic anyway and leave LMB resize and calculate address properly. LMB will now - try to resize the reservations for LMB_NONE - return -1 if the memory is not LMB_NONE and already reserved The LMB code needs some cleanup in that part, but since we are close to 2025.01 do the easy fix and plan to refactor it later. Also update the dm tests with the new behavior. Fixes: commit 22f2c9ed9f53 ("efi: memory: use the lmb API's for allocating and freeing memory") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-12-05efi_loader: Check for a valid fw_name before auto generating GUIDsIlias Apalodimas
The gen_v5_guid() is a void and does no error checking with pointers being available etc. Instead it expects all things to be in place to generate GUIDs. If a board capsule definition is buggy and does not define the firmware names when enabling capsule updates, the board will crash trying to bring up the EFI subsystem. Check for a valid firmware name before generating GUIDs. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-12-04efi_loader: Fix Kconfig logic around OF_LIBFDTTom Rini
Given that OF_LIBFDT is library functionality, the feature of EFI_LOADER needs to select OF_LIBFDT rather than depend on it being already enabled. Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-12-04Merge tag 'efi-next-2024-12-04' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi into next CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/23707 With this pull request support for the EFI_HTTP_PROTOCOL and EFI_IP4_CONFIG2 protocols are added. This allows EFI applications to load files via HTTP. UEFI: add efi_dp_from_ipv4 function add efi_net_set_addr, efi_net_get_addr functions add support for HTTP device path set EFI bootdevice device path to HTTP when loaded from wget add support to send http requests and parse http headers provide EFI_IP4_CONFIG2_PROTOCOL provide EFI_HTTP_PROTOCOL support IPv4() in device path to text protocol provide unit tests for the HTTP and IPv4 Config2 protocols Network: zero terminate string with headers in wget_fill_info() zero terminate string with headers in wget_lwip_fill_info() pass port and server_name via wget_ctx in lwIP network stack let wget_with_dns work with dns disabled Others: Add HTTP and IPV4 Config II protocols to UUID library functions.
2024-12-04efi_selftest: add test for IPv4 Config2 protocolAdriano Cordova
Add a test for the EFI_IP4_CONFIG2_PROTOCOL. The test sets the ip policy to static, adds an ip address, and then reads the current ip address and checks for it to be the same as the one that was set. Signed-off-by: Adriano Cordova <adrianox@gmail.com>
2024-12-04efi_selftest: add test for HTTP protocolAdriano Cordova
Add a test for the EFI_HTTP_PROTOCOL and EFI_SEVICE_BINDING_PROTOCOL. Signed-off-by: Adriano Cordova <adrianox@gmail.com>
2024-12-04lib: uuid: display HTTP and IPV4 Config II protocolsHeinrich Schuchardt
Add long texts for * EFI HTTP Protocol * EFI HTTP Service Binding Protocol * EFI IPv4 Configuration II Protocol to the uuid library. Signed-off-by: Adriano Cordova <adrianox@gmail.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-12-04efi_loader: efi_net: add EFI_HTTP_PROTOCOLAdriano Cordova
Add an EFI HTTP driver. This commit implements the EFI_HTTP_PROTOCOL and the EFI_HTTP_SERVICE_BINDING_PROTOCOL. The latter is attached to the handle of th efi network device. This is the same handle where snp, pxe, and ipconfig are attached to. Signed-off-by: Adriano Cordova <adrianox@gmail.com>
2024-12-04efi_loader: efi_net: add EFI_IP4_CONFIG2_PROTOCOLAdriano Cordova
Add an implementation of the EFI_IP4_CONFIG2_PROTOCOL. The protocol is attached to the handle of the efi network device. This is the same handle where snp and pxe are attached to. Signed-off-by: Adriano Cordova <adrianox@gmail.com>
2024-12-04efi_loader: net: add support to send http requests and parse http headersAdriano Cordova
Add network-stack agnostic way to send an http request and parse http headers from efi drivers. This uses wget as a backend and communicates with it via efi_wget_info. The function efi_net_do_request allocates a buffer on behalf of an efi application using efi_alloc and passes it to wget to receive the data. If the method is GET and the buffer is too small, it re-allocates the buffer based on the last received Content-Length header and tries again. If the method is HEAD it just issues one request. So issuing a HEAD request (to update Content-Length) and then a GET request is preferred but not required. The function efi_net_parse_headers parses a raw buffer containing an http header into an array of EFI specific 'http_header' structs. Signed-off-by: Adriano Cordova <adrianox@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2024-12-04efi_loader: net: set EFI bootdevice device path to HTTP when loaded from wgetAdriano Cordova
Set the device path of the efi boot device to an HTTP device path (as formed by efi_dp_from_http) when the next boot stage is loaded using wget (i.e., when wget is used with wget_info.set_bootdev=1). When loaded from HTTP, the device path should account for it so that the next boot stage is aware (e.g. grub only loads its http stack if it itself was loaded from http, and it checks this from its device path). Signed-off-by: Adriano Cordova <adrianox@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2024-12-04efi_loader: device_path: add support for HTTP device pathAdriano Cordova
Add efi_dp_from_http to form a device path from HTTP. The device path is the concatenation of the device path returned by efi_dp_from_ipv4 together with an URI node and an END node. Signed-off-by: Adriano Cordova <adrianox@gmail.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-12-04efi_loader: efi_net: add efi_net_set_addr, efi_net_get_addrAdriano Cordova
Add the functions efi_net_set_addr and efi_net_get_addr to set and get the ip address from efi code in a network agnostic way. This could also go in net_common, or be compiled conditionally for each network stack. Signed-off-by: Adriano Cordova <adrianox@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2024-12-04efi_loader: add IPv4() to device path to text protocolHeinrich Schuchardt
Implement Ipv4() node support in the device path to text protocol. Signed-off-by: Adriano Cordova <adrianox@gmail.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-12-04efi_loader: device_path: add efi_dp_from_ipv4Adriano Cordova
Add efi_dp_from_ipv4 to form a device path from an ipv4 address. Signed-off-by: Adriano Cordova <adrianox@gmail.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-12-04net: wget: let wget_with_dns work with dns disabledAdriano Cordova
This was marked as TODO in the code: - Enable use of wget_with_dns even if CMD_DNS is disabled if the given uri has the ip address for the http server. - Move the check for CMD_DNS inside wget_with_dns. - Rename wget_with_dns to wget_do_request Signed-off-by: Adriano Cordova <adrianox@gmail.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
2024-12-03Merge tag 'xilinx-for-v2025.04-rc1' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze into next AMD/Xilinx changes for v2025.04-rc1 binman: - Separate binman description from main DT zynqmp: - Enable binman for ZynqMP platforms - DT sync with Linux v6.12 - Update usb5744 hub for SOMs common: - Drop SPL_FIT_GENERATOR support versal2 - Enable OPTEE layers ospi: - Refactor the flash reset functionality pytest: - Fix tcminit mode handling
2024-12-03Merge patch series "CI: Set up for an arm64 runner"Tom Rini
Tom Rini <trini@konsulko.com> says: Hey all, This is picking up Simon's v5 of the above-named series and making a few more changes so that the follow-up series I have leads to arm64 being supported for almost all jobs. To quote Simon's cover letter: All gitlab runners are currently amd64 machines. This series attempts to create a docker image which can also support arm64 so that sandbox tests can be run on it. The TARGET_... environment variables for grub could perhaps be adjusted, using the new variables, but I have not done that for now. Adding to what Simon said, we now build grub for all architectures as the reason to install it was to be able to use the binaries in QEMU. That won't provide us with amd64 binaries on arm64 hosts so we can't use that shortcut anymore. Link: https://lore.kernel.org/r/20241127172247.1488685-1-trini@konsulko.com
2024-12-02sandbox: efi_loader: Correct use of addresses as pointersSimon Glass
The cache-flush function is incorrect which causes a crash in the remoteproc tests with arm64. Fix both problems by using map_sysmem() to convert an address to a pointer and map_to_sysmem() to convert a pointer to an address. Also update the image-loader's cache-flushing logic. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 3286d223fd7 ("sandbox: implement invalidate_icache_all()") Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Changes in v6: - Re-introduce Changes in v2: - Drop message about EFI_LOADER arch/sandbox/cpu/cache.c | 8 +++++++- drivers/remoteproc/rproc-elf-loader.c | 18 +++++++++++------- lib/efi_loader/efi_image_loader.c | 3 ++- 3 files changed, 20 insertions(+), 9 deletions(-) Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2024-12-02binman: Avoid skipping binman_init()Simon Glass
A recent lwip change stopped binman's init from working, so it is not possible to read nodes from the image description anymore. Correct this by dropping the offending line. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 4d4d7838127 net: lwip: add TFTP support and tftpboot command
2024-11-30Revert "efi_memory: do not add U-Boot memory to the memory map"Ilias Apalodimas
This reverts commit ("commit a68c9ac5d8af ("efi_memory: do not add U-Boot memory to the memory map"). This code was removed when the EFI subsystem started using LMB calls for the reservations. In hindsight it unearthed two problems. The e820 code is adding u-boot memory as EfiReservedMemory while it should look at what LMB added and decide instead of blindly overwriting it. The reason this worked is that we marked that code properly late, when the EFI came up. But now with the LMB changes, the EFI map gets added first and the e820 code overwrites it. The second problem is that we never mark SetVirtualAddressMap as runtime code, which we should according to the spec. Until we fix this the current hack can't go away, at least for architectures that *need* to call SVAM. More specifically x86 currently requires SVAM and sets the NX bit for pages not marked as *_CODE. So unless we do that late, it will crash trying to execute from non-executable memory. It's also worth noting that x86 calls SVAM late in the boot, so this will work until someone decides to overwrite/use BootServicesCode from the OS. Notably arm64 disables it explicitly if the VA space is > 48bits, so doesn't suffer from any of these problems. This doesn't really deserve a fixes tag, since it brings back a hack to remedy a situation that was wrong long before that commit, but in case anyone hits the same bug ... Simon sent the original revert in the link, but we need a proper justification for it. Link: https://lore.kernel.org/u-boot/20241112131830.576864-1-sjg@chromium.org/ Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reported-by: Simon Glass <sjg@chromium.org>
2024-11-29tiny-printf: Handle NULL pointer argument to %sBenedikt Spranger
A NULL pointer argument to %s causes a NULL pointer dereference in the fixed width numerical printout code, since p is overwritten with NULL. In case of %s width is 0. Check width before dereferencing the pointer. Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de> Reviewed-by: John Ogness <john.ogness@linutronix.de>
2024-11-27binman: Add option for pointing to separate descriptionMichal Simek
Adding binman node with target images description can be unwanted feature but as of today there is no way to disable it. Also on size constrained systems it is not useful to add binman description to DTB. Introduce BINMAN_DTB Kconfig symbol which allows separate DTB for target from DTB for binman itself. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/f1379d2587f9bf279a7a75c318aabbc1b35ee0c6.1730452668.git.michal.simek@amd.com
2024-11-25Merge tag 'v2025.01-rc3' into nextTom Rini
Prepare v2025.01-rc3
2024-11-24Merge patch series "Fix device removal order for Apple dart iommu"Tom Rini
Janne Grunau <j@jannau.net> says: Starting with v2024.10 dev_iommu_dma_unmap calls during device removal trigger a NULL pointer dereference in the Apple dart iommu driver. The iommu device is removed before its user. The sparsely used DM_FLAG_VITAL flag is intended to describe this dependency. Add it to the driver. Adding this flag is unfortunately not enough since the boot routines except the arm one simply remove all drivers. Add and use a new function which calls dm_remove_devioce_flags(DM_REMOVE_ACTIVE_ALL | DM_REMOVE_NON_VITAL); dm_remove_devices_flags(DM_REMOVE_ACTIVE_ALL); to ensure this order dependency is head consistently. Link: https://lore.kernel.org/r/20241123-iommu_apple_dart_ordering-v2-0-cc2ade6dde97@jannau.net
2024-11-24dm: Add dm_remove_devices_active() for ordered device removalJanne Grunau
This replaces dm_remove_devices_flags() calls in all boot implementations to ensure non vital devices are consistently removed first. All boot implementation except arch/arm/lib/bootm.c currently just call dm_remove_devices_flags(DM_REMOVE_ACTIVE_ALL). This can result in crashes when dependencies between devices exists. The driver model's design document describes DM_FLAG_VITAL as "indicates that the device is 'vital' to the operation of other devices". Device removal at boot should follow this. Instead of adding dm_remove_devices_flags() with (DM_REMOVE_ACTIVE_ALL | DM_REMOVE_NON_VITAL) everywhere add dm_remove_devices_active() which does this. Fixes a NULL pointer deref in the apple dart IOMMU driver during EFI boot. The xhci-pci (driver which depends on the IOMMU to work) removes its mapping on removal. This explodes when the IOMMU device was removed first. dm_remove_devices_flags() is kept since it is used for testing of device_remove() calls in dm. Signed-off-by: Janne Grunau <j@jannau.net>
2024-11-24lmb: Correctly unmap and free memory on errorsIlias Apalodimas
We never free and unmap the memory on errors and we never unmap it when freeing it. The latter won't cause any problems even on sandbox, but for consistency always use unmap_sysmem() Fixes: commit 22f2c9ed9f53 ("efi: memory: use the lmb API's for allocating and freeing memory") Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-11-23efi_loader: allow EFI_LOADER_BOUNCE_BUFFER on all architecturesHeinrich Schuchardt
Commit 775f7657ba58 ("Kconfig: clean up the efi configuration status") by mistake revoked commit dcd1b63b7072 ("efi_loader: allow EFI_LOADER_BOUNCE_BUFFER on all architectures"). Fixes: 775f7657ba58 ("Kconfig: clean up the efi configuration status") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Tested-by: Loic Devulder <ldevulder@suse.com>
2024-11-23efi_loader: simplify efi_tcg2_hash_log_extend_event()Heinrich Schuchardt
The value of variable nt is never used. Just use NULL when calling efi_check_pe(). The API function is not expected to write to the console. Such output might have unwanted side effects on the screen layout of an EFI application. Leave error handling to the caller. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-11-18Merge tag 'efi-next-2024-11-18' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi into next CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/23430 - Prepare for implementing the EFI_HTTP_PROTOCOL: - Make wget functionality callable even if the wget command is not built (add CONFIG_WGET symbol). - Ensure that wget_with_dns() works the same with the old network stack and with lwIP. - Put server_name and port into wget_ctx. - Integrate struct wget_info into wget code. - Move ip_to_string to lib/net_utils.c
2024-11-18net: net_utils: Move ip_to_string to lib/net_utils.cAdriano Cordova
The function string_to_ip is already in net_utils, which is compiled unconditionally, but ip_to_string is currently only accessible if the legacy network stack is selected. This commit puts ip_to_string in net_utils.c and removes it from the legacy network code. Signed-off-by: Adriano Cordova <adrianox@gmail.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-11-17dm: sysinfo: Shorten the SYSINFO_ID prefixSimon Glass
We are about to add a large number of new entries. Update the prefix to be a little shorter. For SMBIOS items, use SYSID_SM_ (for System Management) which is enough to distinguish it. For now at least, it seems that most items will be for SMBIOS. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Raymond Mao <raymond.mao@linaro.org>
2024-11-16tpm: use memmove() for overlapping buffersHeinrich Schuchardt
The behavior of memcpy() for overlapping buffers is undefined. Fixes: 4c57ec76b725 ("tpm: Implement state command for Cr50") Addresses-Coverity-ID: 356664 Overlapping buffer in memory copy Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-11-14lmb.c: add missing comma in lmb_dump_region()Heinrich Schuchardt
In the message string " %s[%d]\t[0x%llx-0x%llx], 0x%08llx bytes flags: " a comma is missing before flags. To avoid increasing the code size replace '0x%' by '%#'. Printing the size with leading zeros but not the addresses does not really make sense. Remove the leading zeros from the size output. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> [trini: Fix test/cmd/bdinfo.c for these changes] Signed-off-by: Tom Rini <trini@konsulko.com>
2024-11-14lmb: do not panic in lmb_print_region_flagsHeinrich Schuchardt
Commit c3cf0dc64f1c ("lmb: add a check to prevent memory overrun") addressed a possible buffer overrun using assert_noisy(). Resetting via panic() in lmb_print_region() while allowing invalid lmb flags elsewhere is not reasonable. Instead of panicking print a message indicating the problem. fls() returns an int. Using a u64 for bitpos does not match. Use int instead. fls() takes an int as argument. Using 1ull << bitpos generates a u64. Use 1u << bitpos instead. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-11-14lib: rsa: Set conventional salt length RSA-PSS parameterLoic Poulain
RFC 3447 says that Typical salt length are either 0 or the length of the output of the digest algorithm, RFC 4055 also recommends hash value length as the salt length. Moreover, By convention, most of the signing infrastructures/libraries use the length of the digest algorithm (such as google cloud kms: https://cloud.google.com/kms/docs/algorithms). If the salt-length parameter is not set, openssl default to the maximum allowed value, which is a openssl 'specificity', so this works well for local signing, but restricts compatibility with other engines (e.g pkcs11/libkmsp11): ``` returning 0x71 from C_SignInit due to status INVALID_ARGUMENT: at rsassa_pss.cc:53: expected salt length for key XX is 32, but 478 was supplied in the parameters Could not obtain signature: error:41000070:PKCS#11 module::Mechanism invalid ``` To improve compatibility, we set the default RSA-PSS salt-length value to the conventional one. A further improvement could consist in making it configurable as signature FIT node attribute. rfc3447: https://datatracker.ietf.org/doc/html/rfc3447 rfc4055: https://datatracker.ietf.org/doc/html/rfc4055 Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2024-11-14lwip: fix code style issuesJerome Forissier
Fix various code style issues in the lwIP code. Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-11-13lib: vsprintf: fix API buildHeinrich Schuchardt
Avoid a build failure when building with CONFIG_API=y, CONFIG_EXAMPLES=y: lib/vsprintf.c:312:14: warning: ‘device_path_string’ defined but not used [-Wunused-function] 312 | static char *device_path_string(char *buf, char *end, void *dp, int field_width, | ^~~~~~~~~~~~~~~~~~ Fixes: 64b5ba4d293a ("efi_loader: make device path to text protocol customizable") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-11-13Merge patch series "lib: uuid: fix uuid_str_to_le_bin() on 32-bit"Tom Rini
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> says: The lib_test_uuid_to_le and lib lib_test_dynamic_uuid tests fail on 32-bit systems. But we never caught this in our CI because we never ran any of our C unit tests on 32-bit. Enable CONFIG_UNIT_TEST on qemu_arm_defconfig. hextoul() cannot convert a string to a 64-bit number on a 32-bit system. Use the new function hextoull() instead. Link: https://lore.kernel.org/r/20241103224223.195255-1-heinrich.schuchardt@canonical.com
2024-11-13lib: uuid: fix uuid_str_to_bin() on 32-bitHeinrich Schuchardt
hextoul() cannot convert a string to a 64-bit number on a 32-bit system. Use function hextoull() instead. Reported-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Fixes: 22c48a92cdce ("lib: uuid: supporting building as part of host tools") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Tested-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2024-11-13lib: uuid: fix uuid_str_to_le_bin() on 32-bitHeinrich Schuchardt
hextoul() cannot convert a string to a 64-bit number on a 32-bit system. Use function hextoull() instead. Reported-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Fixes: 22c48a92cdce ("lib: uuid: supporting building as part of host tools") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org> Tested-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-11-13lib: provide function hextoull()Heinrich Schuchardt
We often convert hexadecimal strings to hextoull(). Provide a wrapper function to simple_strtoull() that does not require specifying the radix. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-11-12Merge patch series "Enable https for wget"Tom Rini
Ilias Apalodimas <ilias.apalodimas@linaro.org> says: Hi all, This is a respin of [1] adding https support to wget. In short patch#1 enables the crypto algorithms we need in mbedTLS patches#2, #3 enable anf fix the lwIP part we need patch#4 is adding https:// parsing support in our wget patch#5 is making https:// the default for QEMU lwip defconfig so people can easily test and finaly patch#6 updates our documentation [1] https://lore.kernel.org/u-boot/20241024112449.1362319-1-ilias.apalodimas@linaro.org/ Link: https://lore.kernel.org/r/20241110083017.367565-1-ilias.apalodimas@linaro.org
2024-11-12net: lwip: Add Support Server Name Indication supportJavier Tia
SNI, or Server Name Indication, is an addition to the TLS encryption protocol that enables a client device to specify the domain name it is trying to reach in the first step of the TLS handshake, preventing common name mismatch errors and not reaching to HTTPS server that enforce this condition. Since most of the websites require it nowadays add support for it. It's worth noting that this is already sent to lwIP [0] [0] https://github.com/lwip-tcpip/lwip/pull/47 Signed-off-by: Javier Tia <javier.tia@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-11-12net: lwip: Update lwIP for mbedTLS > 3.0 support and enable httpsJavier Tia
The current code support mbedTLS 2.28. Since we are using a newer version in U-Boot, update the necessary accessors and the lwIP codebase to work with mbedTLS 3.6.0. It's worth noting that the patches are already sent to lwIP [0] While at it enable LWIP_ALTCP_TLS and enable TLS support in lwIP [0] https://github.com/lwip-tcpip/lwip/pull/47 Signed-off-by: Javier Tia <javier.tia@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-11-12mbedtls: Enable TLS 1.2 supportIlias Apalodimas
Since lwIP and mbedTLS have been merged we can tweak the config options and enable TLS1.2 support. Add RSA and ECDSA by default and enable enough block cipher modes of operation to be comatible with modern TLS requirements and webservers Reviewed-by: Raymond Mao <raymond.mao@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-11-11lmb: Add basic io_lmb functionalityJanne Grunau
These functions can be used with struct lmb pointers and will be used to manage IOVA space in the apple_dart iommu driver. This restores part of the pointer base struct lmb API from before commit ed17a33fed29 ("lmb: make LMB memory map persistent and global"). io_lmb_add() and io_lmb_free() can trivially reuse exisiting lmb functions. io_lmb_setup() is separate for unique error log messages. io_lmb_alloc() is a simplified copy of _lmb_alloc_base() since the later has unused features and internal use of the global LMB memory map. Signed-off-by: Janne Grunau <j@jannau.net>