From patchwork Tue Feb 4 16:00:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 861821 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:11cb:b0:385:e875:8a9e with SMTP id i11csp372558wrx; Tue, 4 Feb 2025 08:01:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU3JRHyiGvCIv7XbEDOs5OLH/EvbQH9ENTbLpiwH9lSQBaWLiCo6Qv5pw2/NBKV23QdodXRsQ==@linaro.org X-Google-Smtp-Source: AGHT+IFYYN/vQW7ysgp1SbZ/iKdN5UtAB3D3yHZJtI7u8m8qTAyrZ7Z+c8lPFnNQVJzLfiHtV9SR X-Received: by 2002:a05:6402:50ca:b0:5dc:5e37:b3ab with SMTP id 4fb4d7f45d1cf-5dc5efc1e31mr30805899a12.12.1738684879280; Tue, 04 Feb 2025 08:01:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738684879; cv=none; d=google.com; s=arc-20240605; b=CacJRY92XIkSZWJzS71J2x0zGe5zC8Tqvw35o0HzlLvtRN5TdHgEfeC9A6w1jrGEM4 C9oJiOVT/iAxYpom2m1iwBCekBTdl+rNGyLg/aY6O5ZYHgr5VGMovTQEU+4Su6/nwj81 tMB/NTfbH8yhR4EghCkXXaMKlgiCL4YqXK5FtH5iwC1A8CWcQC3e0deKa7oJtNfev0QO SfnMlAJ86jKORghzwqYb4tpTZYGMdxod97d6xw2JEe/W2TQ7iPKadTXGdTmP5p2n2w+b BNX1KwHaVqZk/CdJIvKwqj7AtKUa+XSSMuJq3JNezoaZYZ7P+HZE2O6iw8xCCEug1S6Q hqZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=7jMRRunng2OcOEIGW14xnD3tcjDijGkJj7ls2qvjd/o=; fh=cLm6xbSRc66ol5ix1l0UWyMw7snL3keIH1SOnYH3RlY=; b=fQmXwPEuWYD+49sm7t8B5IA6Ybgq75HSqWNAsEZpYmzc18GwVKuUlYWnE0qJHjoNsv 96tNA5RV1rw1lydNIsvyAD8sxKxEMz4QUkAaphRcrAY0o0rnKtPY6tIXAChDZh6u5Tms ts+TofGCPdHGCokcBBNOISuU69gwYM8ajJATSOyUD0zlt4ukyZb7TyayBIPjEjS9GZBh whUgKjeX3UyyBj3GErEjx2whDZMYkmHm6ULS0MLt/F7T7xt7rH+eXSypozimSubw+RHr 2ox0wBmFVRt8WSWTIY1uO1BrxPfZSi9eg2W7RpYgZZVtp2GK9upBd729ZvJ7/P7wcwaq VrCg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PPBwCU/0"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5dcd8dbd729si322600a12.30.2025.02.04.08.01.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2025 08:01:18 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PPBwCU/0"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 87ADD800B3; Tue, 4 Feb 2025 17:01:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="PPBwCU/0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 20CC3801BE; Tue, 4 Feb 2025 17:01:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1FAAC80040 for ; Tue, 4 Feb 2025 17:01:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4368a293339so66748935e9.3 for ; Tue, 04 Feb 2025 08:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738684873; x=1739289673; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7jMRRunng2OcOEIGW14xnD3tcjDijGkJj7ls2qvjd/o=; b=PPBwCU/0MJt2j6dhAiCOmzZwWF3cm8dCfZL5fodgZFvRkMOgq8/ZS6Uya/o2mQAisn 6pG0DMkdds+PklK3yqMGmMJbTXhJYH9I8yZ+iTdjDvJzmlu8hPuTo+i9UZT8xolTr3k1 lypNgO+oBZSSa6icAL9MVvrYOEbvt+V9IKyqPE2L62vpQ9J6LVzSESBUQ/zpPfJixvPh nB4dZram4qhb30bxmV2LP6q0lFEAhxD9XmtIwo6BLOVu7vuI6ZB80upErz1GQIktMEIV ihAR0rKXzOCdq0PVb3sHI/AHAlQ40Irx0faUtKKebmR3eBex/rGvP+L0StCjQ0J+WFtS mzSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738684873; x=1739289673; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7jMRRunng2OcOEIGW14xnD3tcjDijGkJj7ls2qvjd/o=; b=wqAWeY1ryYOOiXRypeUiAggTumSWBQqtc5rfuLOIwMYglSI4u2RC984b5HSuOva9uQ 047v7Pwc4DRh4NcBkbepLw+Zr3ADPs4x0QcuRacdjFvcgOn7fjQy0/YyYLdxh0RoF0+A NRh0C6sDFyQJejsrLM0oMlOfCii6Tmak0YKOoluEwRolXaHFnhDYigC73Rl+lRI1wsyZ Qw+xjfUhuGaPygwpQ5/DGJeihu3N93akxcYjiF4jr7oJ75Bu/THNtsMCsqiVywha672A RehhaNlZnAa3ren4k0rX3ZhH1X8bQSua0RuEqfc0lLC1IhTmjXSNUwCd3VWCYXij1uLI PSgg== X-Gm-Message-State: AOJu0YwYngl0QJo1AvQqfvWz25Mc/SHmmQiDE5PM6tgMbN78mb2OvWwX BLypDAdS7MHK2juX0D0A8kszvikGrdPQMsZhSR3KE7WegPQMJOkwZas/Ky69U1Edwz7rgWIzdfQ Zc0ob/OKC X-Gm-Gg: ASbGncuKdV/t+HU0F5ureTUcAYC4xZxJ5G0eGu+s+icfkkBcxskMhgAoDC7diBEJs/4 PkzG2q9uk0S1YGEzYnYMd0oF6bt1QNtzP0ocrslFJ8XH9bDDK/NPf/t5QHv2sS62PVUu1E5kyC3 0Co/65P9RtqHFloSJLm51xQt14jL+jLeEwkw2GXn50R5GR/98mGJtAEdrbCOkO7vjFkhIsvhtMv 1Bxgh9tQXiPeI2R4ppa0jilYSxBDgGdkHQR++H9jPmvA+WrfT9wVB0Fh3y3s0SrXYv4Xu7co9SE d9lzHMETjLt8oNbv6kPb9LmW X-Received: by 2002:a05:600c:1e20:b0:438:a1f4:3e9d with SMTP id 5b1f17b1804b1-438dc3c405dmr208118055e9.9.1738684873010; Tue, 04 Feb 2025 08:01:13 -0800 (PST) Received: from builder.. ([2a01:e0a:3cb:7bb0:43d5:b1e2:1df9:edcc]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438dcc6de2dsm230933245e9.26.2025.02.04.08.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2025 08:01:12 -0800 (PST) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Michal Simek , Jerome Forissier , Tom Rini , Joe Hershberger , Ramon Fried , Simon Glass , Heinrich Schuchardt , Mattijs Korpershoek , Dmitry Rokosov , Adriano Cordova Subject: [PATCH v2] net: Kconfig: depend on DM_RNG for WGET_HTTPS Date: Tue, 4 Feb 2025 17:00:49 +0100 Message-ID: <20250204160051.3055038-1-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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 Co-developed-by: Ilias Apalodimas Signed-off-by: Ilias Apalodimas Signed-off-by: Jerome Forissier Tested-by: Michal Simek --- cmd/Kconfig | 1 + net/lwip/wget.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index e62817bd977..e3fbb7538ee 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2154,6 +2154,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 diff --git a/net/lwip/wget.c b/net/lwip/wget.c index b76f6c0f1d9..de688641dd7 100644 --- a/net/lwip/wget.c +++ b/net/lwip/wget.c @@ -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; }