]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: Kconfig: depend on DM_RNG for WGET_HTTPS
authorJerome Forissier <jerome.forissier@linaro.org>
Tue, 4 Feb 2025 16:00:49 +0000 (17:00 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 12 Feb 2025 18:37:24 +0000 (12:37 -0600)
net/lwip/wget.c/mbedtls_hardware_poll() is calling dm_rng_read() but
dependency is not recorded anywhere that's why depend on DM_RNG
when WGET_HTTPS is used.

Suggested-by: Michal Simek <michal.simek@amd.com>
Co-developed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Michal Simek <michal.simek@amd.com>
cmd/Kconfig
net/lwip/wget.c

index 1f9b26928c4c319fe9bc5d242c32119080e6653a..a04fcaa0e08bddc456f8270eb513d2bd72ba68bc 100644 (file)
@@ -2161,6 +2161,7 @@ config WGET_HTTPS
        depends on CMD_WGET
        depends on PROT_TCP_LWIP
        depends on MBEDTLS_LIB
+       depends on DM_RNG
        select SHA256
        select RSA
        select ASYMMETRIC_KEY_TYPE
index 9aec75f9bedf8f457d3477d081122795a2a6be95..14f27d429989458b03c7cb7131abc132aa0cc880 100644 (file)
@@ -433,10 +433,15 @@ bool wget_validate_uri(char *uri)
 
        if (!strncmp(uri, "http://", strlen("http://"))) {
                prefix_len = strlen("http://");
-       } else if (!strncmp(uri, "https://", strlen("https://"))) {
-               prefix_len = strlen("https://");
+       } else if (CONFIG_IS_ENABLED(WGET_HTTPS)) {
+               if (!strncmp(uri, "https://", strlen("https://"))) {
+                       prefix_len = strlen("https://");
+               } else {
+                       log_err("only http(s):// is supported\n");
+                       return false;
+               }
        } else {
-               log_err("only http(s):// is supported\n");
+               log_err("only http:// is supported\n");
                return false;
        }