Patch Detail
Show a patch.
GET /api/patches/27152/?format=api
{ "id": 27152, "url": "https://patchwork.libcamera.org/api/patches/27152/?format=api", "web_url": "https://patchwork.libcamera.org/patch/27152/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260701040721.145659-5-hpa@redhat.com>", "date": "2026-07-01T04:07:21", "name": "[v4,4/4] meson: Add ipa-signature-algo option", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "0e7aa3dfedb799283fe9aafcd24deb4d21c7df77", "submitter": { "id": 105, "url": "https://patchwork.libcamera.org/api/people/105/?format=api", "name": "Kate Hsuan", "email": "hpa@redhat.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/27152/mbox/", "series": [ { "id": 6030, "url": "https://patchwork.libcamera.org/api/series/6030/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6030", "date": "2026-07-01T04:07:17", "name": "Implement ML-DSA-65 for Post-Quantum Cryptographic compliance", "version": 4, "mbox": "https://patchwork.libcamera.org/series/6030/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/27152/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/27152/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 2427DC3301\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 1 Jul 2026 04:08:18 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DB16065F9F;\n\tWed, 1 Jul 2026 06:08:17 +0200 (CEST)", "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7EF3265F8D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 1 Jul 2026 06:08:16 +0200 (CEST)", "from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-587-tT0BOi-fMPm7__Qa9w9_Zg-1;\n\tWed, 01 Jul 2026 00:08:12 -0400", "from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.95])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 5CC4518C0FDC; Wed, 1 Jul 2026 04:08:11 +0000 (UTC)", "from fedora.redhat.com (unknown [10.67.32.18])\n\tby mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 7781A36F01; Wed, 1 Jul 2026 04:08:08 +0000 (UTC)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"g0wFgqcN\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1782878895;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=yhA3N0ZnM9yVzbFsrGsd3ZApoQ7N0UVPkKe1Lo8VIu8=;\n\tb=g0wFgqcNi9SNcG03WBzA6uhmCBQEaGYWvzlAT/NOcRrOQW/Q3Hi6qqxcaM/nYw1deZUSAN\n\tXvv8P74KhBa5AtjagYja+FaHu6EgrtZ8QfbqS9NtGcw8Ja/fGhbnombwugttq/7YUIRoOR\n\tkWD9ClkDVShY2OYg8wPTeFlPLC52TN4=", "X-MC-Unique": "tT0BOi-fMPm7__Qa9w9_Zg-1", "X-Mimecast-MFC-AGG-ID": "tT0BOi-fMPm7__Qa9w9_Zg_1782878891", "From": "Kate Hsuan <hpa@redhat.com>", "To": "libcamera-devel@lists.libcamera.org, =?utf-8?b?QmFybmFiw6FzIFDFkWN6?=\n\t=?utf-8?q?e?= <barnabas.pocze@ideasonboard.com>, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>", "Cc": "Kate Hsuan <hpa@redhat.com>", "Subject": "[PATCH v4 4/4] meson: Add ipa-signature-algo option", "Date": "Wed, 1 Jul 2026 12:07:21 +0800", "Message-ID": "<20260701040721.145659-5-hpa@redhat.com>", "In-Reply-To": "<20260701040721.145659-1-hpa@redhat.com>", "References": "<20260701040721.145659-1-hpa@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.6 on 10.30.177.95", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "M_fcNW5hSsAxy0-ZNdGw32-8bEeh2GaLadPrHoOt1dw_1782878891", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add a combo type \"ipa-signature-algo\" meson option to select signature\nalgorithms, including rsa-sha256 and ml-dsa-65.\nras-sha256 is the default setting for now.\n\nSigned-off-by: Kate Hsuan <hpa@redhat.com>\n---\n meson_options.txt | 8 ++++++++\n src/libcamera/meson.build | 11 +++++++++++\n src/meson.build | 6 +++++-\n utils/check-algo.sh | 35 +++++++++++++++++++++++++++++++++++\n utils/gen-ipa-priv-key.sh | 21 ++++++++++++++++++---\n 5 files changed, 77 insertions(+), 4 deletions(-)\n create mode 100755 utils/check-algo.sh", "diff": "diff --git a/meson_options.txt b/meson_options.txt\nindex 20baacc4..18488e6b 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -46,6 +46,14 @@ option('gstreamer',\n value : 'auto',\n description : 'Compile libcamera GStreamer plugin')\n \n+option('ipa-signature-algo',\n+ type : 'combo',\n+ choices : [\n+ 'rsa-sha256',\n+ 'ml-dsa-65',\n+ ],\n+ description : 'Select a signature algorithm to sign IPA libraries.')\n+\n option('ipas',\n type : 'array',\n choices : ['ipu3', 'mali-c55', 'rkisp1', 'rpi/pisp', 'rpi/vc4', 'simple',\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex 575408b2..cabd1041 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -89,14 +89,25 @@ libyaml = dependency('yaml-0.1', default_options : [\n # Use one of gnutls or libcrypto (provided by OpenSSL), trying gnutls first.\n libcrypto = dependency('gnutls', required : false)\n if libcrypto.found()\n+ r = run_command('../../utils/check-algo.sh', 'guntls', get_option('ipa-signature-algo'), check: false)\n+ if r.returncode() != 0\n+ error('Unsupported signature algorithm (', 'guntls,', get_option('ipa-signature-algo'), ')')\n+ endif\n config_h.set('HAVE_GNUTLS', 1)\n else\n libcrypto = dependency('libcrypto', required : false)\n if libcrypto.found()\n+ r = run_command('../../utils/check-algo.sh', 'openssl', get_option('ipa-signature-algo'), check: false)\n+ if r.returncode() != 0\n+ error('Unsupported signature algorithm. (', 'libcrypto,', get_option('ipa-signature-algo'), ')')\n+ endif\n config_h.set('HAVE_CRYPTO', 1)\n endif\n endif\n \n+# comply with FIPS 204\n+config_h.set('IPA_MODULE_DIR_SIGNATURE_ALGO', '\"' + get_option('ipa-signature-algo') + '\"')\n+\n if not libcrypto.found()\n warning('Neither gnutls nor libcrypto found, all IPA modules will be isolated')\n summary({'IPA modules signed with': 'None (modules will run isolated)'},\ndiff --git a/src/meson.build b/src/meson.build\nindex 9b63c8e8..4111f591 100644\n--- a/src/meson.build\n+++ b/src/meson.build\n@@ -19,7 +19,11 @@ openssl = find_program('openssl', required : false)\n if openssl.found()\n ipa_priv_key = custom_target('ipa-priv-key',\n output : ['ipa-priv-key.pem'],\n- command : [gen_ipa_priv_key, '@OUTPUT@'])\n+ command : [\n+ gen_ipa_priv_key,\n+ get_option('ipa-signature-algo'),\n+ '@OUTPUT@'\n+ ])\n config_h.set('HAVE_IPA_PUBKEY', 1)\n ipa_sign_module = true\n else\ndiff --git a/utils/check-algo.sh b/utils/check-algo.sh\nnew file mode 100755\nindex 00000000..2ee6c7cb\n--- /dev/null\n+++ b/utils/check-algo.sh\n@@ -0,0 +1,35 @@\n+#!/bin/sh\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+# Copyright (C) 2026, Red Hat Inc.\n+#\n+# Author: Kate Hsuan <hpa@redhat.com>\n+#\n+# Check if the given algorithm is supported by the library\n+\n+tool=\"$1\"\n+algo=\"$2\"\n+\n+if [ \"$algo\" = \"rsa-sha256\" ]; then\n+ algo=\"RSA-SHA256\"\n+elif [ \"$algo\" = \"ml-dsa-65\" ]; then\n+ algo=\"ML-DSA-65\"\n+else\n+ echo \"Invalid algorithm: $algo\"\n+ exit 1\n+fi\n+\n+if [ \"$tool\" = \"guntls\" ]; then\n+ gnutls-cli -l | grep \"$algo\" > /dev/null\n+ ret=$?\n+elif [ \"$tool\" = \"openssl\" ]; then\n+ openssl list -signature-algorithms |grep ${algo} > /dev/null\n+ ret=$?\n+else\n+ echo \"Invalid tool: $tool\"\n+ exit 1\n+fi\n+\n+if [ $ret -ne 0 ]; then\n+ echo \"Algorithm $algo is not supported by $tool\"\n+ exit 1\n+fi\ndiff --git a/utils/gen-ipa-priv-key.sh b/utils/gen-ipa-priv-key.sh\nindex 2ca7b883..3fc44bcc 100755\n--- a/utils/gen-ipa-priv-key.sh\n+++ b/utils/gen-ipa-priv-key.sh\n@@ -4,8 +4,23 @@\n #\n # Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n #\n-# Generate an RSA private key to sign IPA modules\n+# Generate an private key for the given algorithm to sign IPA modules\n \n-key=\"$1\"\n+algo=\"$1\"\n+key=\"$2\"\n \n-openssl genpkey -algorithm RSA -out \"${key}\" -pkeyopt rsa_keygen_bits:2048\n+if [ -e \"${key}\" ]; then\n+ echo \"File ${key} already exists. Removing it.\"\n+ rm \"${key}\"\n+fi\n+\n+# Two possible algorithms: RSA and ML-DSA-65\n+\n+if [ \"$algo\" = \"rsa-sha256\" ]; then\n+ openssl genpkey -algorithm RSA -out \"${key}\"\n+elif [ \"$algo\" = \"ml-dsa-65\" ]; then\n+ openssl genpkey -algorithm ML-DSA-65 -out \"${key}\"\n+else\n+ echo \"Invalid algorithm: $algo\"\n+ exit 1\n+fi\n", "prefixes": [ "v4", "4/4" ] }