From patchwork Thu May 9 14:37:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Mao X-Patchwork-Id: 1933443 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=lykeHA+w; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VZvl00SwSz1ymg for ; Fri, 10 May 2024 00:38:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8BB81880FB; Thu, 9 May 2024 16:38:06 +0200 (CEST) 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="lykeHA+w"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6A34088054; Thu, 9 May 2024 16:38:05 +0200 (CEST) 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,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0: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 0D8858810E for ; Thu, 9 May 2024 16:38:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=raymond.mao@linaro.org Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6ef98eee195so253179a34.1 for ; Thu, 09 May 2024 07:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715265481; x=1715870281; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2u+JFr48lqQW3khtQN88692erGm8L+75uAfk9fXF1TI=; b=lykeHA+wpda+k4+Pbzt7Whqg5Wfv27Q8RlA2sfVQZBQPCvPwq6zDUmzYND4XzWzPgZ 7WtdXDZagkEXs3dg7HCMIFSGFqXjKgoIOHrnNr35KqxRQxZHV18NIEps190NATJ19l9Y JjzEvzPsvAgy8QgqGWasrhukwgQwmkVTI5BJf9LO6gyog34iza9tnR46DtVPNpBz0Iu+ i0yZrKC7AeOVUfU5cwE5VGDxQd8fjrWDGlhGVu6WJimLEQyjm74RfULAWiWsAH5S/EbX KxOWdkssVkV/LqJvSqR37JMEqOtR8go8I0UdQOHegfBstfMI7yZX5XauUtN7+h0A4xgB SXZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715265481; x=1715870281; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2u+JFr48lqQW3khtQN88692erGm8L+75uAfk9fXF1TI=; b=vMHsA/ePoZ6k8nLrLyX+ycQzb05QBz8ZpIQlPh+rpLkeDVDQPbyulk+KQ2JTyLRAkW mB36hPj3DtARXSr2jBGLefk4QNrRAXay/OHOZnVi0IdacVbaamVlYSZAxAU7izjHpIKH FkFOSoCL7Mo8zBiMU0L6u+8syrrXKe4g6xR0rXgehO9E8zhZMRa36OIi92VtVmk8N0Pd vyC6QZBMKXN30uxAHS3X3HLHbSKTu8gcX/89weXV6Ad0u66uu4BNaVWmAAdthEssWD2r ESMvUdTIJ7UHKrO0aA3EmtPMcxKzW2O8gSL6+gqkZIm1ZwXO+MLRsQFaGbBBRIZSXlFB 1UPQ== X-Gm-Message-State: AOJu0YxQWAio7/iKaeyKaBtGlFtSIXwTZ5McChXPcWfLIj+/Jov6Ts5I mVTWHOcZvOZ/D8xHzakl7seriMDOaLAMoyxP7g8c2HuCIoYDogldN+SoVoMPZTiUAQvAYmegFKl 5 X-Google-Smtp-Source: AGHT+IFJfmaqd5/SEueZuHCmHbFcKw7HxvQ4e40Ks1fVukwcVuFjFr7CEPwHh8qT8gM6nusD545OZQ== X-Received: by 2002:a05:6830:1be3:b0:6f0:396c:86f0 with SMTP id 46e09a7af769-6f0b7939545mr6031735a34.12.1715265481658; Thu, 09 May 2024 07:38:01 -0700 (PDT) Received: from ubuntu.localdomain (pool-174-115-4-214.cpe.net.cable.rogers.com. [174.115.4.214]) by smtp.gmail.com with ESMTPSA id af79cd13be357-792bf275b07sm74563685a.24.2024.05.09.07.38.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 07:38:01 -0700 (PDT) From: Raymond Mao To: u-boot@lists.denx.de Cc: Raymond Mao , Heinrich Schuchardt , Ilias Apalodimas , Tom Rini , Igor Opaniuk , Simon Glass , Marek Vasut , Ralph Siemsen , Masahisa Kojima , Eddie James Subject: [PATCH 1/4] image: remove redundant hash includes Date: Thu, 9 May 2024 07:37:38 -0700 Message-Id: <20240509143743.1496210-2-raymond.mao@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240509143743.1496210-1-raymond.mao@linaro.org> References: <20240509143743.1496210-1-raymond.mao@linaro.org> 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 Remove the redundant includes of u-boot/md5.h, u-boot/sha1.h, u-boot/sha256.h and u-boot/sha512.h Signed-off-by: Raymond Mao Reviewed-by: Tom Rini Reviewed-by: Ilias Apalodimas --- boot/image-fit.c | 4 ---- boot/image.c | 2 -- 2 files changed, 6 deletions(-) diff --git a/boot/image-fit.c b/boot/image-fit.c index 89e377563ce..1efc39f4408 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -38,10 +38,6 @@ DECLARE_GLOBAL_DATA_PTR; #include #include #include -#include -#include -#include -#include /*****************************************************************************/ /* New uImage format routines */ diff --git a/boot/image.c b/boot/image.c index 073931cd7a3..e57d6eae52d 100644 --- a/boot/image.c +++ b/boot/image.c @@ -26,8 +26,6 @@ #endif #include -#include -#include #include #include From patchwork Thu May 9 14:37:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Mao X-Patchwork-Id: 1933444 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=cdBkH1Qh; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VZvlC4pMKz1ymg for ; Fri, 10 May 2024 00:38:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E173188025; Thu, 9 May 2024 16:38:10 +0200 (CEST) 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="cdBkH1Qh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4B0FB87FD7; Thu, 9 May 2024 16:38:10 +0200 (CEST) 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,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 3AEA488131 for ; Thu, 9 May 2024 16:38:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=raymond.mao@linaro.org Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-792b934de39so74738985a.3 for ; Thu, 09 May 2024 07:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715265487; x=1715870287; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SpNiCIK4o8aZdGjenooW2bnwj6FEFbdFc9kzbo4v9/E=; b=cdBkH1QhZ9WAAiruomDDrGCxsumNafZuu9wXecMAqjpgG4769Fc1QQ6JElG+G1PEyD Rpc9SfPhC/EHeeuX9PdBj03iqziMjGZSh3RT7MvHTrOs35O1LktLTPENYOYtEPN5egEI myTCUGBmTCpV8F4QPBr7WAl6IXlo9ywgAn7QEcXOuIyXGMJfSC+NyGRm32OMuMSgjxBc N/3Hjm4uoa8FDQpE4uA3DHl01Tp+ngWC3iUUrt7K+Bz8U0HiEk/oabZ2+EuyTBa30sch ckq1nHYrn+HxS917MwAO5uA+TmKlEuzPK46sjMwYYgfbNExqGfsiqak5/Z7Sg8W9zrF7 tawA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715265487; x=1715870287; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SpNiCIK4o8aZdGjenooW2bnwj6FEFbdFc9kzbo4v9/E=; b=Z7N/py7OcRRHUUizPAiVA2wpFRc/sXWWmDYlFjShKanLhYs6/1Wl7156DJOtCEPRkN +J6OmhmyWRlOThWMszQPaIf9tz1q4KZm9Hof+mlkVGjC5XegZ71lkrWFBVO7BXrnD69M ld+zNAY7zr18PrH5SSinyA/65icDNSYbJvUz65jQyZg4Df7fqTdzrMArVFXg7uurHxWy MjnQr2gDtwnBj5x2z67OUbAh75A09tIR+jDbdGxi7Y8UCGK5eIQQ7ypdkpNyxcf4XO7H lpFYlQrcUpRQH9dXZ5suhHsBJ30nDgAmtNsWVG/125xqjxms+PRAN5ZEVz6R3i9xSLtc ZUHg== X-Gm-Message-State: AOJu0Yy7Vgb2N02XXvYuobVwz/lPuywcHw+QyL7t9X5TNr+k+pBVcd9z qbbeRbsaFB9u4d9HiOOQnZdtZcXMoHgFVUcapZSg5kTYDFqsjeaScO+aKQbVSvh/N+KjWdFr15y P X-Google-Smtp-Source: AGHT+IFjOfgtgSHGLvQsdQgLQ/HCO1H8O+3FRX6LsecezZHOQEsv8DfPzacEICNnd609li2YKwBD2w== X-Received: by 2002:a05:620a:8cc:b0:792:c2b5:ca6 with SMTP id af79cd13be357-792c2b50dc1mr101034385a.5.1715265486944; Thu, 09 May 2024 07:38:06 -0700 (PDT) Received: from ubuntu.localdomain (pool-174-115-4-214.cpe.net.cable.rogers.com. [174.115.4.214]) by smtp.gmail.com with ESMTPSA id af79cd13be357-792bf275b07sm74563685a.24.2024.05.09.07.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 07:38:06 -0700 (PDT) From: Raymond Mao To: u-boot@lists.denx.de Cc: Raymond Mao , Heinrich Schuchardt , Ilias Apalodimas , Tom Rini , Simon Glass , Igor Opaniuk , Marek Vasut , Ralph Siemsen , Masahisa Kojima , Eddie James Subject: [PATCH 2/4] efi_loader: remove redundant hash includes Date: Thu, 9 May 2024 07:37:39 -0700 Message-Id: <20240509143743.1496210-3-raymond.mao@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240509143743.1496210-1-raymond.mao@linaro.org> References: <20240509143743.1496210-1-raymond.mao@linaro.org> 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 Remove the redundant includes of u-boot/sha1.h, u-boot/sha256.h and u-boot/sha512.h Signed-off-by: Raymond Mao Reviewed-by: Tom Rini Reviewed-by: Ilias Apalodimas --- lib/efi_loader/efi_signature.c | 1 - lib/efi_loader/efi_tcg2.c | 3 --- 2 files changed, 4 deletions(-) diff --git a/lib/efi_loader/efi_signature.c b/lib/efi_loader/efi_signature.c index f338e732759..184eac8cddb 100644 --- a/lib/efi_loader/efi_signature.c +++ b/lib/efi_loader/efi_signature.c @@ -17,7 +17,6 @@ #include #include #include -#include const efi_guid_t efi_guid_sha256 = EFI_CERT_SHA256_GUID; const efi_guid_t efi_guid_cert_rsa2048 = EFI_CERT_RSA2048_GUID; diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c index b07e0099c27..ac056dcfc55 100644 --- a/lib/efi_loader/efi_tcg2.c +++ b/lib/efi_loader/efi_tcg2.c @@ -19,9 +19,6 @@ #include #include #include -#include -#include -#include #include #include #include From patchwork Thu May 9 14:37:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Mao X-Patchwork-Id: 1933445 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=kygEi6IC; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VZvlQ5m9kz1ymg for ; Fri, 10 May 2024 00:38:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 48D2E880A1; Thu, 9 May 2024 16:38:17 +0200 (CEST) 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="kygEi6IC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1E2A98811C; Thu, 9 May 2024 16:38:16 +0200 (CEST) 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,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (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 EDD5187FD7 for ; Thu, 9 May 2024 16:38:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=raymond.mao@linaro.org Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-78f049ddd7dso59769885a.1 for ; Thu, 09 May 2024 07:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715265492; x=1715870292; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AsXUyduIsiybDRSmNqaNgdd7zCBc1LDlv1tDwe3Y2z0=; b=kygEi6ICs/POptfjFOqLBfRaiRr1XZNWGwNxCM3xwZUBO1dHOqPXEVlTvD4+iQwYcV Pb38wPxUro4TSpFeeNObfoNojoEkMzX5UQs0sz72hfFQylwNXR8V+aLA20qoA1R0ca8c ySlfYmvvigRwKDNQThIPuzzXNg1tO3G7ZGg4+yV73OTopWtD5J68qBeq0fVfC/uyVC5c MzBsUPEYb7J4NSLEkEks3wwFS0BcGTweTmiIgyRPPQ/n9DNauuV+hIpC80vE81DS2eUY ckzULmiL/okMu+H6ZYpjINz3+3/U5MYf+VTxoiexBzn1Vvw1Sn5L40t1lvIJnL4xYaAq 26CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715265492; x=1715870292; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AsXUyduIsiybDRSmNqaNgdd7zCBc1LDlv1tDwe3Y2z0=; b=RkYrshrJQu4RSkICrSiM97a5cz7cQgJQIsCOn0ioKKfYy87ZoEWCUuQTlw0tLF6mw7 0SWFBeAXuZ90ze6KFWnZXEPNd/Idu/9gpbnIpV5kk8CZe/+JKHekxZ2LOT+EVMHuSH80 EOyPyOx2IgcHdDgWqEsJrGPrzl5hQPFzcem4LXNcSR7haBOFnbLIZv81QQVHm0QJGqVb ofp+Xjftf94UE2kkXXl8kni4w6RVUzyDg4Jwhe9gtHUEEtGlXVCOXAwQfoQ1ENIAB1PK qwyScizj/FArcFB/wfKsrHoYgskuU8IUjpcfrTrruv9pA8FbxeD1bAhW6Qh8Kw8gvfKe Y9iQ== X-Gm-Message-State: AOJu0YwwdPkPWvCdRqdRjKpaZwDcGjUb6WNBdUpGy1ZWl5SjAN524bPL CZhBRuKehtHZ6PVMKo07M349zprSZkjIsC7y2cSB4IPMU6z87iqMD/FZd/i+pHKUokingoq3g3i R X-Google-Smtp-Source: AGHT+IG4EObKn2k2k6rd/oxICBo1JwGUjF5j4/W2EehHVOy4KJgO6k8y6LbGHYyFzAbmgmGk1Vw2Kw== X-Received: by 2002:a05:620a:4606:b0:790:ec9c:cc7d with SMTP id af79cd13be357-792b27b2a6bmr653715585a.14.1715265492676; Thu, 09 May 2024 07:38:12 -0700 (PDT) Received: from ubuntu.localdomain (pool-174-115-4-214.cpe.net.cable.rogers.com. [174.115.4.214]) by smtp.gmail.com with ESMTPSA id af79cd13be357-792bf275b07sm74563685a.24.2024.05.09.07.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 07:38:12 -0700 (PDT) From: Raymond Mao To: u-boot@lists.denx.de Cc: Raymond Mao , Heinrich Schuchardt , Ilias Apalodimas , Tom Rini , Simon Glass , Igor Opaniuk , Marek Vasut , Ralph Siemsen , Eddie James , Masahisa Kojima Subject: [PATCH 3/4] md5: Use typedef for MD5 context Date: Thu, 9 May 2024 07:37:40 -0700 Message-Id: <20240509143743.1496210-4-raymond.mao@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240509143743.1496210-1-raymond.mao@linaro.org> References: <20240509143743.1496210-1-raymond.mao@linaro.org> 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 Use of typedef is beneficial for porting with other crypto libs without changing the API callers. Secondly, it is for the code consistency with other digest libs. SHA1, SHA256 and SHA512 are all using typedef for their context. Signed-off-by: Raymond Mao Reviewed-by: Tom Rini Reviewed-by: Ilias Apalodimas --- drivers/crypto/hash/hash_sw.c | 8 ++++---- include/u-boot/md5.h | 10 +++++----- lib/md5.c | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/crypto/hash/hash_sw.c b/drivers/crypto/hash/hash_sw.c index d8065d68ea4..a5033677930 100644 --- a/drivers/crypto/hash/hash_sw.c +++ b/drivers/crypto/hash/hash_sw.c @@ -51,17 +51,17 @@ static void hash_finish_crc32(void *ctx, void *obuf) /* MD5 */ static void hash_init_md5(void *ctx) { - MD5Init((struct MD5Context *)ctx); + MD5Init((MD5Context *)ctx); } static void hash_update_md5(void *ctx, const void *ibuf, uint32_t ilen) { - MD5Update((struct MD5Context *)ctx, ibuf, ilen); + MD5Update((MD5Context *)ctx, ibuf, ilen); } static void hash_finish_md5(void *ctx, void *obuf) { - MD5Final(obuf, (struct MD5Context *)ctx); + MD5Final(obuf, (MD5Context *)ctx); } /* SHA1 */ @@ -159,7 +159,7 @@ static struct sw_hash_impl sw_hash_impl[HASH_ALGO_NUM] = { .init = hash_init_md5, .update = hash_update_md5, .finish = hash_finish_md5, - .ctx_alloc_sz = sizeof(struct MD5Context), + .ctx_alloc_sz = sizeof(MD5Context), }, [HASH_ALGO_SHA1] = { diff --git a/include/u-boot/md5.h b/include/u-boot/md5.h index d61364c0ae3..c465925ea8d 100644 --- a/include/u-boot/md5.h +++ b/include/u-boot/md5.h @@ -10,18 +10,18 @@ #define MD5_SUM_LEN 16 -struct MD5Context { +typedef struct MD5Context { __u32 buf[4]; __u32 bits[2]; union { unsigned char in[64]; __u32 in32[16]; }; -}; +} MD5Context; -void MD5Init(struct MD5Context *ctx); -void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len); -void MD5Final(unsigned char digest[16], struct MD5Context *ctx); +void MD5Init(MD5Context *ctx); +void MD5Update(MD5Context *ctx, unsigned char const *buf, unsigned int len); +void MD5Final(unsigned char digest[16], MD5Context *ctx); /* * Calculate and store in 'output' the MD5 digest of 'len' bytes at diff --git a/lib/md5.c b/lib/md5.c index faf3f78ab1e..34343cf8e23 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -55,7 +55,7 @@ byteReverse(unsigned char *buf, unsigned longs) * initialization constants. */ void -MD5Init(struct MD5Context *ctx) +MD5Init(MD5Context *ctx) { ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; @@ -71,7 +71,7 @@ MD5Init(struct MD5Context *ctx) * of bytes. */ void -MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) +MD5Update(MD5Context *ctx, unsigned char const *buf, unsigned int len) { register __u32 t; @@ -120,7 +120,7 @@ MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) * 1 0* (64-bit count of bits processed, MSB-first) */ void -MD5Final(unsigned char digest[16], struct MD5Context *ctx) +MD5Final(unsigned char digest[16], MD5Context *ctx) { unsigned int count; unsigned char *p; @@ -269,7 +269,7 @@ MD5Transform(__u32 buf[4], __u32 const in[16]) void md5 (unsigned char *input, int len, unsigned char output[16]) { - struct MD5Context context; + MD5Context context; MD5Init(&context); MD5Update(&context, input, len); @@ -286,7 +286,7 @@ void md5_wd(const unsigned char *input, unsigned int len, unsigned char output[16], unsigned int chunk_sz) { - struct MD5Context context; + MD5Context context; #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) const unsigned char *end, *curr; int chunk; From patchwork Thu May 9 14:37:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Mao X-Patchwork-Id: 1933446 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Kgm02nTK; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VZvld6Lt6z1ymg for ; Fri, 10 May 2024 00:38:53 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A233E88149; Thu, 9 May 2024 16:38:22 +0200 (CEST) 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="Kgm02nTK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A60FE8816A; Thu, 9 May 2024 16:38:21 +0200 (CEST) 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,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (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 9781C87FD7 for ; Thu, 9 May 2024 16:38:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=raymond.mao@linaro.org Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-792b8d989e4so67428285a.2 for ; Thu, 09 May 2024 07:38:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715265498; x=1715870298; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ehx0haR2DDx1Asot1OSvMfhakzN2ADui538Qv0HMaEA=; b=Kgm02nTKc5pvEVIyFv+8uQJeWeMVYfickqyq8Zg7EyKyvKjWqWr/HHL4WuwkE3CXNX LRF5twhsZhTmgDgKamgI3tgS7mOEo20YUTWsTwbWBYAfCu09Mut8xiPfHXjMqPZJ6Lch wLm+5tXka45kUsI2ZTSJ/MSXtxZzgRDumpqn+Om5c9KYHZcfxki7Gj5tRsv03oRw8u0K gcUEg7mDO0xtiKaYFbRU4dtm1i66oC5idlbxlCWFNeNBK5OGOm8KdzP6K2RPULDSdFBT FYemolcmzSxS7dUWhHFYHSAy9ZILqdgw71/tOLYVqvvsnmQysIWjnONAShhQbr7mLc1D lD7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715265498; x=1715870298; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ehx0haR2DDx1Asot1OSvMfhakzN2ADui538Qv0HMaEA=; b=v71DVg6TP3YYSzcdDjxN2r5nUOXIPp4rldF2qQJ7U5Yax72s+ecW8/KyYYByFqlcfc i0ogUsrV6H6X3v3p51cEtcmjQS4FjhlDQoFNYrCTnqGTmbyO+XRvIDVpHONdxKVUMErB v+QlWR6+4stReEj5AycZAl4bLaHpttMsfP9oqyNHRt2ekgBJwZIhFijLNzBpDKzRtGAs MQSEYL46SEYImEta1I3Kgn7Yf6ABLBfuCisS5z036OkV9ZSvZOql9uNaVVsIBTCKlMV2 AxqI51dr0uFi/K+CfTkl97JyEaVSibmXDaFp6kgf++ycpdVUqNa2x0BQKl+pHjbq3eEo VHPA== X-Gm-Message-State: AOJu0YxeTspgabJ6l3FC6aJ3TVnEUMdkYoA8QviDX7+TwXxq4XHC/TDp UNB9tUxLBAQAFlwRPwaI8OrssePtkg3ekG0TyXoSSMTd4Bh5Rh/g+nxLCNaRy7IhI345JNG/ACf 3 X-Google-Smtp-Source: AGHT+IERHo5rcEDv9VA5dtc2kmQ/xf+ZS3Q+y9EUu6tMnmLbi+7lornLrwpUcbtg1qhCoLNI7MQAUA== X-Received: by 2002:ae9:f102:0:b0:792:8f3a:b663 with SMTP id af79cd13be357-792b2868defmr603289885a.55.1715265498327; Thu, 09 May 2024 07:38:18 -0700 (PDT) Received: from ubuntu.localdomain (pool-174-115-4-214.cpe.net.cable.rogers.com. [174.115.4.214]) by smtp.gmail.com with ESMTPSA id af79cd13be357-792bf275b07sm74563685a.24.2024.05.09.07.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 07:38:18 -0700 (PDT) From: Raymond Mao To: u-boot@lists.denx.de Cc: Raymond Mao , Heinrich Schuchardt , Ilias Apalodimas , Tom Rini , Simon Glass , Igor Opaniuk , Marek Vasut , Ralph Siemsen , Masahisa Kojima , Eddie James Subject: [PATCH 4/4] arm: EFI linker script text section alignment Date: Thu, 9 May 2024 07:37:41 -0700 Message-Id: <20240509143743.1496210-5-raymond.mao@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240509143743.1496210-1-raymond.mao@linaro.org> References: <20240509143743.1496210-1-raymond.mao@linaro.org> 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 Add text section alignment to fix sbsign signing warning 'gaps in the section table may result in different checksums' which causes a failure of efi_image_verify_diges() Signed-off-by: Raymond Mao --- arch/arm/lib/elf_aarch64_efi.lds | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/lib/elf_aarch64_efi.lds b/arch/arm/lib/elf_aarch64_efi.lds index 5dd98091698..bffd9a0447a 100644 --- a/arch/arm/lib/elf_aarch64_efi.lds +++ b/arch/arm/lib/elf_aarch64_efi.lds @@ -28,6 +28,7 @@ SECTIONS *(.dynamic); . = ALIGN(512); } + . = ALIGN(4096); .rela.dyn : { *(.rela.dyn) } .rela.plt : { *(.rela.plt) } .rela.got : { *(.rela.got) }