| Message ID | 20260901154845.102123-14-philippe.reynes@softathome.com |
|---|---|
| State | Superseded |
| Delegated to: | Raymond Mao |
| Headers | show
Return-Path: <u-boot-bounces@lists.u-boot-project.org> 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=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=bzKLavB1; dkim=pass (2048-bit key; unprotected) header.d=softathome1.onmicrosoft.com header.i=@softathome1.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-softathome1-onmicrosoft-com header.b=v0W8gyC5; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.u-boot-project.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hZ9KD216Sz1xwZ for <incoming@patchwork.ozlabs.org>; Wed, 02 Sep 2026 01:49:36 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B1A7A6079D; Tue, 1 Sep 2026 15:49:32 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id xkLaWuyjoGSa; Tue, 1 Sep 2026 15:49:30 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver=<UNKNOWN> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1788277770; bh=YzDnEXJ3LlBP11/pfno7hvH5oS5DZZJuwOGheVXgpdk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bzKLavB1XoVyE0cds382KEWAxHhKk6tGso99b1OZ8YH4edUMlnR2RwJcjso/y2lKO eW8i355weCkt7hE4Hbo0AkxyuELKiXQPE98cUmRfuVZnZQh4HPTUYozV45vcxZvdV6 aYTP7C0HOCyfyAWfpJJKw4dgYKRSkQ0JEfRQOiVAVE1XI+qj1JRnDafmRqsjGQdgfG AMrb7j0NHKEC7mghiQA3kSoVoXYCJ1uNLKhRNCQq0W7pi83XTUDE6bEpkgwZ7XjdbI vqCpu8MjwGvXJxQoOYf8I3UrGahGR+DaN16BK5JBVwLfam9LRu+7xBvV9YanibrXnW RwbMds5Uy2L1g== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 7BB2360782; Tue, 1 Sep 2026 15:49:30 +0000 (UTC) X-Original-To: u-boot@lists.u-boot-project.org Delivered-To: u-boot@lists.u-boot-project.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id C20F8422 for <u-boot@lists.u-boot-project.org>; Tue, 1 Sep 2026 15:49:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id BFF4380972 for <u-boot@lists.u-boot-project.org>; Tue, 1 Sep 2026 15:49:29 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5metKXG8cg6V for <u-boot@lists.u-boot-project.org>; Tue, 1 Sep 2026 15:49:29 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=philippe.reynes@softathome.com; receiver=<UNKNOWN> Authentication-Results: smtp1.osuosl.org; dmarc=none (p=none dis=none) header.from=softathome.com Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=softathome1.onmicrosoft.com header.i=@softathome1.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-softathome1-onmicrosoft-com header.b=v0W8gyC5 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by smtp1.osuosl.org (Postfix) with ESMTPS id C685580D86 for <u-boot@lists.u-boot-project.org>; Tue, 1 Sep 2026 15:49:28 +0000 (UTC) Received: by phobos.denx.de (Postfix, from userid 109) id 27AE184A29; Tue, 1 Sep 2026 17:49:18 +0200 (CEST) Received: from PA5P264CU001.outbound.protection.outlook.com (mail-francecentralazlp170100000.outbound.protection.outlook.com [IPv6:2a01:111:f403:c20a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E06918484C for <u-boot@lists.denx.de>; Tue, 1 Sep 2026 17:48:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=softathome.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=philippe.reynes@softathome.com Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=softathome1.onmicrosoft.com header.i=@softathome1.onmicrosoft.com header.b="v0W8gyC5"; dkim-atps=neutral ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AwFzqa+U+g1TR75b5BkIi/SbTRcBmtPBn3McZ8oTsGh4MbG+21e27TegtE819sNOMy4uimTTfLbAq2E7Q2fRSAvukoshVU/JQBKu+mw1OINo/fXOT+Rl5GmRAyh07/cHyC/mMaXz8CSpm6DGP1C9zxuH8pAPT7VOy1mOYchPg+m5XsRER3rI2fWD975Ju/BoTlxdmHQ24xYSAgTh2llbtHsFeNv8icc16Uy32vTN+EQd4NYX5w5BvasTmjWvvJ/lCrFmfG3LYHtM4ipq5Bhjm8KmdYiGnzUeVMlrte5eeWCzDkWYPSKPLQnPy5v8dKuUwtR2+EN53pF6354OZTRhIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YzDnEXJ3LlBP11/pfno7hvH5oS5DZZJuwOGheVXgpdk=; b=rAN8ebzI1jfFwRi2O9iVkcNYyjVrtYqoeie1cOC1EGXzUp2kRNUyf6GjPxDzTCuHAznFGh/2vtG2H4DUKFvJWTAoqz54ZqKGYcm7V1Bm0eOqQVSTebb2NWhH5d95JZz5grqADo+KJWA6xaqxo+ob+kgEaysdvjBFIolzp9H9Hvnwf96lSr56zE5XPUwzRayte5e6G+ZsKm2Ct8S2c1qDY4vG5Ksv7YeaC603ZnpM3EB+jbdErMdot9gGEtX1SepGWbbiw5nVUfRP0yk6UgmZnuGvSAM7gjyu5pzLTzwkADeNqknZcq8iQOn36fuXBCfD5BHvD4/aezuddG5irfCjmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.6.166.170) smtp.rcpttodomain=canonical.com smtp.mailfrom=softathome.com; dmarc=bestguesspass action=none header.from=softathome.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=softathome1.onmicrosoft.com; s=selector1-softathome1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YzDnEXJ3LlBP11/pfno7hvH5oS5DZZJuwOGheVXgpdk=; b=v0W8gyC5zUX94ry+10GSYzqFgfc1RfEbqJdhz7T7s8t8+sRECC1A8iRqF+REKEHZyQvyEidApTYG3xhXsm8j5hpKGYcew3+VgpqLMhJyd8KJ/J1r2k+2A6qO1GxLwbRQl/flnATHK2TxeJj+1vLK8s1+ZvMxV5dd2r2jmZbo2nKGJpXv9a6kOjr+/bpHHxHdKOIpfdomKWqDLHYuH0adNhGQjKjU1cZofV+bvCsVTxYRZQDV8dGr+SUuW+D/JwUYqqIffwmuKaUXG+IIUGRkdZV79jEnfbOmHbeQU1pt3JNBj686yAshYvvz9kRtGpPIc88zqwlqcRDaaputWgHeSQ== Received: from PAZP264CA0133.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1f8::19) by MR0P264MB7803.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:a6::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.382.10; Tue, 1 Sep 2026 15:48:53 +0000 Received: from PA2PEPF00019231.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1f8:cafe::2) by PAZP264CA0133.outlook.office365.com (2603:10a6:102:1f8::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.13 via Frontend Transport; Tue, 1 Sep 2026 15:48:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.6.166.170) smtp.mailfrom=softathome.com; dkim=none (message not signed) header.d=none;dmarc=bestguesspass action=none header.from=softathome.com; Received-SPF: Pass (protection.outlook.com: domain of softathome.com designates 149.6.166.170 as permitted sender) receiver=protection.outlook.com; client-ip=149.6.166.170; helo=proxy.softathome.com; pr=C Received: from proxy.softathome.com (149.6.166.170) by PA2PEPF00019231.mail.protection.outlook.com (10.167.242.37) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.382.8 via Frontend Transport; Tue, 1 Sep 2026 15:48:53 +0000 Received: from sah1lpt726.softathome.com (unknown [192.168.72.32]) by proxy.softathome.com (Postfix) with ESMTPSA id 4E3EB209C3; Tue, 1 Sep 2026 17:48:53 +0200 (CEST) From: Philippe Reynes <philippe.reynes@softathome.com> To: marko.makela@iki.fi, jonny.green@keytechinc.com, raymondmaoca@gmail.com, trini@konsulko.com, simon.glass@canonical.com Cc: u-boot@lists.denx.de, Philippe Reynes <philippe.reynes@softathome.com>, Simon Glass <sjg@chromium.org> Subject: [PATCH v9 13/15] tools: preload_check_sign: add support of ecdsa Date: Tue, 1 Sep 2026 17:48:42 +0200 Message-ID: <20260901154845.102123-14-philippe.reynes@softathome.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260901154845.102123-1-philippe.reynes@softathome.com> References: <20260901154845.102123-1-philippe.reynes@softathome.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA2PEPF00019231:EE_|MR0P264MB7803:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: ec0d06ab-bcd1-49cb-90cd-08df0840865d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700016|23010399003|82310400026|10067099003|56012099006|22082099003|18002099003|6133799003; X-Microsoft-Antispam-Message-Info: FcZfIPX3CtIciKQ9kH4MEnX0gnBmPPeXCqIgMqjsmv7r3je6j+DRFDzfp4TA4qScwUC4m4Wjisu1YRaAMPCsG1oG2zONHw+0EXE3OtaISP+MWJw3lbjxKyZGLXIjphElV10O8LDlWg0FZid5AwVMS1j46gDXEGnrpdkPyudqk1Mwm8dBkp9PQ3CgpmGnVYeG7xOUyEuX6cRSsV4FpYNrMNRErbQdfjfFByh2ZcN/7cYq2JmLuqS8PTcKRdt1pyjYcKAHczQ2ELR3mi3UshRupNWWnBWzPXG8S3p7UQ9ON0TljwsXtcMM7hv7HPx0ydefrb04uroQelPJMJ/ZtR+1cMFzg+gBtYXWy797syyv/HS68dXC3NQJ6aPinT/OvRwtNRRXIC72OZ5Pu4Vtsr0p1dLZ4uNxiMy+MnlWYz8RUiPiU1KGoebPPA2DlFeglVD1Ak5o2CpYFqezZBtGGGU1Sms69WXovqW1N1BTCjYhs7eh8JUW2AHSh8THfMd5vJivG2f6g1YUK0BnllbQSYhDZErFq8VddytqMCPDzPNk+9fX+peFvJ4swdqIcne4Glac8aZ6tVKfoDhmUyegF9kDHcUrnSZWZEMPDib+YBbEuwAdUSRGmi+O8Yu0Zi4uJzxXkr6AuFHDRO/b6z92qjbaVNkjOgFixzgrJBwDlwPaeJETswJ+xiDC97+G1ZP+cQONymk8gsVhU2IFFs+EFJCiug== X-Forefront-Antispam-Report: CIP:149.6.166.170; CTRY:FR; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:proxy.softathome.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700016)(23010399003)(82310400026)(10067099003)(56012099006)(22082099003)(18002099003)(6133799003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TClkK3tceuytfBpgvVfC/GwCAQz4qOKQ4NGVIOX+vEfZVwOMctkjS3tRPiHN3wI3C8/JMk7ONoRMjGgRmqq5q2w3B3MISylo4B0LJEpEh+f81gyvdXEJ1F7tN6D4r5DqO+OUtjVHbyGUdIoGHTe0S9w5Js5nP3yHSgDxctr2QitQN2wtgw3TgjDGY8J3pIPFT41/dB/OFxVN9PsK8y+2gDd5y6ph0lP8wsQ6ZDnUHlTFKbEuBpPf8WsMwIs2cthnS7RhON4jH0E189loMv8v7F9g9cdleyceHoX4I7CHGox+eDurMkvmvgK1UPEgsishmMj1kCxPSfbJmQPvR484i1nsTTuIjI7m7BXHnJv4UvglzNPPBpnXzqHulJMQH4j0JZblDazUbHB/MSymPTKU4JTe8vSUy4InFUbg1X3KzeyMd8DlfzDt5iMc7VWn8Ytx X-OriginatorOrg: softathome.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2026 15:48:53.4651 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec0d06ab-bcd1-49cb-90cd-08df0840865d X-MS-Exchange-CrossTenant-Id: aa10e044-e405-4c10-8353-36b4d0cce511 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=aa10e044-e405-4c10-8353-36b4d0cce511; Ip=[149.6.166.170]; Helo=[proxy.softathome.com] X-MS-Exchange-CrossTenant-AuthSource: PA2PEPF00019231.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MR0P264MB7803 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion <u-boot.lists.u-boot-project.org> List-Unsubscribe: <https://lists.u-boot-project.org/mailman/options/u-boot>, <mailto:u-boot-request@lists.u-boot-project.org?subject=unsubscribe> List-Archive: <http://lists.u-boot-project.org/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.u-boot-project.org> List-Help: <mailto:u-boot-request@lists.u-boot-project.org?subject=help> List-Subscribe: <https://lists.u-boot-project.org/mailman/listinfo/u-boot>, <mailto:u-boot-request@lists.u-boot-project.org?subject=subscribe> Errors-To: u-boot-bounces@lists.u-boot-project.org |
| Series |
add software ecdsa support
|
expand
|
diff --git a/tools/preload_check_sign.c b/tools/preload_check_sign.c index ebead459273..d94f0509e74 100644 --- a/tools/preload_check_sign.c +++ b/tools/preload_check_sign.c @@ -8,9 +8,13 @@ * complete file. The tool preload_check_sign allows to verify and authenticate * a file starting with a preload header. */ + +#define OPENSSL_API_COMPAT 0x10101000L + #include <stdio.h> #include <unistd.h> #include <openssl/pem.h> +#include <openssl/ec.h> #include <openssl/evp.h> #include <openssl/err.h> #include <image.h> @@ -144,6 +148,32 @@ int main(int argc, char **argv) info.sig_info.key = info.key; info.sig_info.keylen = info.key_len; + /* For ecdsa key, we have to update some values */ + if (EVP_PKEY_id(pkey) == EVP_PKEY_EC) { + EC_KEY *ecdsa_key; + const EC_GROUP *group; + + ecdsa_key = EVP_PKEY_get1_EC_KEY(pkey); + if (!ecdsa_key) { + fprintf(stderr, "Can not extract ECDSA key\n"); + ret = EXIT_FAILURE; + goto out; + } + + group = EC_KEY_get0_group(ecdsa_key); + if (!group) { + fprintf(stderr, "Can not extract ECDSA group\n"); + EC_KEY_free(ecdsa_key); + ret = EXIT_FAILURE; + goto out; + } + + info.sig_info.keyfile = keyfile; + info.sig_size = (EC_GROUP_order_bits(group) + 7) / 8 * 2; + + EC_KEY_free(ecdsa_key); + } + /* Check the signature */ image_pre_load_sig_set_info(&info); ret = image_pre_load_sig((ulong)buffer);