From patchwork Tue Nov 11 12:41:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 681 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1762864958; bh=XKj56XiLFi/PqLr9mERZHDXKhij14IpPie7F8BbE564=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Fs85O5YLMf0K1MX0dgOwnphh+2D7nBNi2eCV2dnwJV+yMccNFJklFX7F8W5DM6gTm nnOUcJjmt4+vi89Q/0VlN2bHg1GzTTeMoGoPehoyXa/GAa40DzlmGTVOxYlsd/HUuV gte84uIXg4zYv9ZaeN/iFi7QU8edZM+KgTDiyo6OIl0sXwArZd7sI0KdRWjMNz3NHJ hYDnWEjAtsPh73iY6Vebj5cmP7QJ2mO77HuPcHhJDkbIWlHfkPIe8nxSRaRxhxDc3p qyvsqOnPMEtvjZ/kHecng/DN5v+wYt9spVOzkjNOtt1JIlUMZDIaKsLdD87+B9xDD3 SBELw1H+c0/Cw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B0EB668484 for ; Tue, 11 Nov 2025 05:42:38 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id tOetjqXDQ9YT for ; Tue, 11 Nov 2025 05:42:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1762864958; bh=XKj56XiLFi/PqLr9mERZHDXKhij14IpPie7F8BbE564=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Fs85O5YLMf0K1MX0dgOwnphh+2D7nBNi2eCV2dnwJV+yMccNFJklFX7F8W5DM6gTm nnOUcJjmt4+vi89Q/0VlN2bHg1GzTTeMoGoPehoyXa/GAa40DzlmGTVOxYlsd/HUuV gte84uIXg4zYv9ZaeN/iFi7QU8edZM+KgTDiyo6OIl0sXwArZd7sI0KdRWjMNz3NHJ hYDnWEjAtsPh73iY6Vebj5cmP7QJ2mO77HuPcHhJDkbIWlHfkPIe8nxSRaRxhxDc3p qyvsqOnPMEtvjZ/kHecng/DN5v+wYt9spVOzkjNOtt1JIlUMZDIaKsLdD87+B9xDD3 SBELw1H+c0/Cw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 99E9D68472 for ; Tue, 11 Nov 2025 05:42:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1762864956; bh=o+kdP0+QcXA7J+L1YzamG0nOxq5bX5XfsFYRoaLXoSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WoSfJKLhf0VtC7NycupXswTgjRL18axLNiAkq4RRUwyFv8IDJlbkc+TCRwY2IxhJj 71VVmfQ8UPal1ZFR3nPy45Wa+TiEN04FoMs9aXoUl9BRGQdMf/eVDYZuBRUBi/f9D4 XJqTYx6F2ml64Z9XZ3diBHYZqft+JPTBjH5h6wdUhBv1qZ4u/zxwcJpaZ59pSiHsVp Y7kYZreDiIKz62W2YXELxz0nPIT1yRdQu82vREqk5twJXRSjVi4bweWQIeKiS+KMsO DkuYG0XZ8H2vuNSCgHqWTr04EYRpDm414E9tTy8V3DPnk7pGGvIP0wdYMg1JpO/Ay6 TtZYz+nxdzPNA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BFA8268484; Tue, 11 Nov 2025 05:42:36 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id mW2xbR4Av5Y1; Tue, 11 Nov 2025 05:42:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1762864951; bh=A2I7epQHKWovgP2RQYVVKn0bJipV5kXAxZMN5fGMG/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nzjLZUXtGefL/eFqf9vRXfZVUfPeZEUD8t2X+23RNGKdQVYmZ3WwrCUldu7I0t4Uk M2IqbgjbG4QzbSwr7xe+QGrcxmU6PjUmK0SkWxQb+fqlhzGon7i5CRV2/ZDqxvUoD2 pheEg3LVK8f8cCzTRn/so/jpfjxLSekao3AdM+Z4Me8RyGjVav3pyXH20ySbUfFbHp nYomkYmIinns0l57Tbz8IcaenybKe/EKdrJF31rANJH4hQWnzwXYDRkpAbv0HQZBhJ 2wE9ygUZXwnA0JOC2fyxUgSwxdFtpdyj0bbBtATet/ZoS6FNlj7cqaFx4mz70exqvO E4Js/9CxBAMsA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 498006841A; Tue, 11 Nov 2025 05:42:31 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 11 Nov 2025 05:41:16 -0700 Message-ID: <20251111124131.1198930-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251111124131.1198930-1-sjg@u-boot.org> References: <20251111124131.1198930-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 64XJT3TQL7H5AFETJN4XYHEAUDHBFQCY X-Message-ID-Hash: 64XJT3TQL7H5AFETJN4XYHEAUDHBFQCY X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/15] test: Switch mmc12 over to use argon2id List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Use the more common argon2id algorithm for this disk so that we can test the implementation. Signed-off-by: Simon Glass --- test/py/img/common.py | 7 +++++-- test/py/img/ubuntu.py | 6 ++++-- test/py/tests/test_ut.py | 3 ++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/test/py/img/common.py b/test/py/img/common.py index f5a7fcba804..74ea04771c7 100644 --- a/test/py/img/common.py +++ b/test/py/img/common.py @@ -33,7 +33,7 @@ def copy_partition(ubman, fsfile, outname): def setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, - script, part2_size=1, use_fde=0): + script, part2_size=1, use_fde=0, luks_kdf='pbkdf2'): """Create a 20MB disk image with a single FAT partition Args: @@ -47,6 +47,8 @@ def setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, script (str): Script to place in the extlinux.conf file part2_size (int): Size of second partition in MB (default: 1) use_fde (int): LUKS version for full-disk encryption (0=none, 1=LUKS1, 2=LUKS2) + luks_kdf (str): Key derivation function for LUKS2: 'pbkdf2' or 'argon2id'. + Defaults to 'pbkdf2'. Ignored for LUKS1. """ fsh = FsHelper(config, 'vfat', 18, prefix=basename) fsh.setup() @@ -83,7 +85,8 @@ def setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, ext4 = FsHelper(config, 'ext4', max(1, part2_size - 30), prefix=basename, part_mb=part2_size, passphrase='test' if use_fde else None, - luks_version=use_fde if use_fde else 2) + luks_version=use_fde if use_fde else 2, + luks_kdf=luks_kdf) ext4.setup() bindir = os.path.join(ext4.srcdir, 'bin') diff --git a/test/py/img/ubuntu.py b/test/py/img/ubuntu.py index b783f7eb3cf..243fa38d021 100644 --- a/test/py/img/ubuntu.py +++ b/test/py/img/ubuntu.py @@ -7,7 +7,7 @@ from img.common import setup_extlinux_image def setup_ubuntu_image(config, log, devnum, basename, version='24.04.1 LTS', - use_fde=0): + use_fde=0, luks_kdf='pbkdf2'): """Create a Ubuntu disk image with a FAT partition and ext4 partition This creates a FAT partition containing extlinux files, kernel, etc. and a @@ -19,6 +19,8 @@ def setup_ubuntu_image(config, log, devnum, basename, version='24.04.1 LTS', devnum (int): Device number to use, e.g. 1 basename (str): Base name to use in the filename, e.g. 'mmc' use_fde (int): LUKS version for full-disk encryption (0=none, 1=LUKS1, 2=LUKS2) + luks_kdf (str): Key derivation function for LUKS2: 'pbkdf2' or 'argon2id'. + Defaults to 'pbkdf2'. Ignored for LUKS1. """ vmlinux = 'vmlinuz-6.8.0-53-generic' initrd = 'initrd.img-6.8.0-53-generic' @@ -50,4 +52,4 @@ label l0r ''' % ((version, vmlinux, initrd) * 2) setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, script, part2_size=60 if use_fde else 1, - use_fde=use_fde) + use_fde=use_fde, luks_kdf=luks_kdf) diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py index 94d98b3b73b..e2b4d49a2e0 100644 --- a/test/py/tests/test_ut.py +++ b/test/py/tests/test_ut.py @@ -84,7 +84,8 @@ def test_ut_dm_init_bootstd(u_boot_config, u_boot_log): setup_localboot_image(u_boot_config, u_boot_log) setup_vbe_image(u_boot_config, u_boot_log) setup_ubuntu_image(u_boot_config, u_boot_log, 11, 'mmc', use_fde=1) - setup_ubuntu_image(u_boot_config, u_boot_log, 12, 'mmc', use_fde=2) + setup_ubuntu_image(u_boot_config, u_boot_log, 12, 'mmc', use_fde=2, + luks_kdf='argon2id') def test_ut(ubman, ut_subtest): """Execute a "ut" subtest.