Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBB5EC433EF for ; Fri, 12 Nov 2021 09:28:18 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 809EA60EDF for ; Fri, 12 Nov 2021 09:28:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 809EA60EDF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=softathome.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3073282F7E; Fri, 12 Nov 2021 10:28:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=softathome.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id BBB3782F6D; Fri, 12 Nov 2021 10:28:11 +0100 (CET) Received: from smtp.smtpout.orange.fr (smtp05.smtpout.orange.fr [80.12.242.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2EE6882F69 for ; Fri, 12 Nov 2021 10:28:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=softathome.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=philippe.reynes@softathome.com Received: from sah1lpt571.home ([90.0.151.89]) by smtp.orange.fr with ESMTPA id lSqrmpauKOvR0lSqsm4ndH; Fri, 12 Nov 2021 10:28:06 +0100 X-ME-Helo: sah1lpt571.home X-ME-Auth: ZDI3NDIxNif3YzVhYiQzN2FlZDdmZTc4NTQ2Nic3MzI2ZDdk X-ME-Date: Fri, 12 Nov 2021 10:28:06 +0100 X-ME-IP: 90.0.151.89 From: Philippe Reynes To: sjg@chromium.org, mr.nuke.me@gmail.com, joel.peshkin@broadcom.com Cc: u-boot@lists.denx.de, Philippe Reynes Subject: [RFC PATCH v2 0/6] image: add a stage pre-load Date: Fri, 12 Nov 2021 10:27:51 +0100 Message-Id: <20211112092757.8463-1-philippe.reynes@softathome.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.35 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.2 at phobos.denx.de X-Virus-Status: Clean This serie adds a stage pre-load before launching an image. This stage is used to read a header before the image and this header contains the signature of the full image. So u-boot may check the full image before using any data of the image. Changelog: v2: - move the code to image-pre-load - add support of stage pre-load for spl - add support of stage pre-load on spl_ram Philippe Reynes (6): lib: allow to build asn1 decoder and oid registry in SPL lib: crypto: allow to build crypyo in SPL lib: rsa: allow rsa verify with pkey in SPL common: image: add a stage pre-load cmd: bootm: add a stage pre-load common: spl: fit_ram: allow to use image pre load cmd/Kconfig | 9 ++ cmd/bootm.c | 2 +- common/Kconfig.boot | 33 +++++ common/Makefile | 1 + common/bootm.c | 33 +++++ common/image-pre-load.c | 291 ++++++++++++++++++++++++++++++++++++++++ common/spl/spl_ram.c | 21 ++- include/image.h | 10 ++ lib/Kconfig | 6 + lib/Makefile | 9 +- lib/crypto/Kconfig | 15 +++ lib/crypto/Makefile | 19 ++- lib/rsa/Kconfig | 8 ++ 13 files changed, 446 insertions(+), 11 deletions(-) create mode 100644 common/image-pre-load.c -- 2.17.1