Patch Detail
Show a patch.
GET /api/patches/27367/?format=api
{ "id": 27367, "url": "https://patchwork.libcamera.org/api/patches/27367/?format=api", "web_url": "https://patchwork.libcamera.org/patch/27367/", "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": "<20260715075004.36983-5-hpa@redhat.com>", "date": "2026-07-15T07:50:04", "name": "[v5,4/4] meson: Add ipa-signature-algo option", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "5a872030bdbd34db4f1914858f422c7520186dfc", "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/27367/mbox/", "series": [ { "id": 6059, "url": "https://patchwork.libcamera.org/api/series/6059/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6059", "date": "2026-07-15T07:50:00", "name": "Implement ML-DSA-65 for Post-Quantum Cryptographic compliance", "version": 5, "mbox": "https://patchwork.libcamera.org/series/6059/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/27367/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/27367/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 9EB98C3301\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jul 2026 07:50:54 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1709F66168;\n\tWed, 15 Jul 2026 09:50:54 +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 D99AA6615B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2026 09:50:52 +0200 (CEST)", "from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-49-vR8BxgIgMvyc589KjTSMzA-1;\n\tWed, 15 Jul 2026 03:50:48 -0400", "from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])\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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 05A971956041; Wed, 15 Jul 2026 07:50:47 +0000 (UTC)", "from fedora.redhat.com (unknown [10.67.32.131])\n\tby mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id EA13B30001A2; Wed, 15 Jul 2026 07:50:43 +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=\"ZeQuP001\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1784101851;\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=YGSnuMdupC9fBPBw59obctNZ/izhDTGqyyrmT8K0xz8=;\n\tb=ZeQuP001oi60qp8pYrbQcFChMOUr3FzC/9E00J3aKCAuLtRn3mlxE1Jh0nyO3Dalx6h7a+\n\t1hD0mste27AQiOlkBRW5GyJW87M3OwtXSB9PRAlhdfcdA6mELiERkIiCtyt972JIqYPDCt\n\tfQw9PquuPQoGaP9ZUQaSTRxhlu6dKGw=", "X-MC-Unique": "vR8BxgIgMvyc589KjTSMzA-1", "X-Mimecast-MFC-AGG-ID": "vR8BxgIgMvyc589KjTSMzA_1784101847", "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 v5 4/4] meson: Add ipa-signature-algo option", "Date": "Wed, 15 Jul 2026 15:50:04 +0800", "Message-ID": "<20260715075004.36983-5-hpa@redhat.com>", "In-Reply-To": "<20260715075004.36983-1-hpa@redhat.com>", "References": "<20260715075004.36983-1-hpa@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.4", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "ZTsKYGAX8Gvgel2CgNtiCGErrSM3iKFQVCtCCxhlTcw_1784101847", "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 | 12 ++++++++++++\n src/meson.build | 6 +++++-\n utils/check-algo.sh | 37 +++++++++++++++++++++++++++++++++++++\n utils/gen-ipa-priv-key.sh | 16 +++++++++++++---\n utils/meson.build | 3 +++\n 6 files changed, 78 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..1bb64090 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -89,14 +89,26 @@ 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+ crypto_library = 'gnutls'\n config_h.set('HAVE_GNUTLS', 1)\n else\n libcrypto = dependency('libcrypto', required : false)\n if libcrypto.found()\n+ crypto_library = 'openssl'\n config_h.set('HAVE_CRYPTO', 1)\n endif\n endif\n \n+# Verify that the library supports the selected algorithm (RSA-SHA256 or ML-DSA-65).\n+if libcrypto.found()\n+ ipa_signature_algo = get_option('ipa-signature-algo')\n+ r = run_command(check_algo, crypto_library, ipa_signature_algo, check : false)\n+ if r.returncode() != 0\n+ error('Unsupported signature @0@ algorithm in @1@'\n+ .format(ipa_signature_algo, crypto_library))\n+ endif\n+endif\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..a46d72ef\n--- /dev/null\n+++ b/utils/check-algo.sh\n@@ -0,0 +1,37 @@\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+algo=$(echo $algo | tr '[:lower:]' '[:upper:]')\n+\n+if [ \"$tool\" = \"gnutls\" ]; then\n+ gnutls-cli -l | grep \"$algo\" > /dev/null\n+ ret=$?\n+elif [ \"$tool\" = \"openssl\" ]; then\n+ if [ \"$algo\" = \"ML-DSA-65\" ]; then\n+ openssl list -signature-algorithms |grep ${algo} > /dev/null\n+ ret=$?\n+ else\n+ openssl list -signature-algorithms |grep \"RSA\" > /dev/null\n+ ret=$?\n+ if [ $ret -eq 0 ]; then\n+ openssl list -digest-algorithms |grep \"SHA256\" > /dev/null\n+ ret=$?\n+ fi\n+ fi\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..72d9cea5 100755\n--- a/utils/gen-ipa-priv-key.sh\n+++ b/utils/gen-ipa-priv-key.sh\n@@ -4,8 +4,18 @@\n #\n # Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n #\n-# Generate an RSA private key to sign IPA modules\n+# Generate a 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+# 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\ndiff --git a/utils/meson.build b/utils/meson.build\nindex 9c598793..b2e6f9f1 100644\n--- a/utils/meson.build\n+++ b/utils/meson.build\n@@ -5,6 +5,9 @@ subdir('ipu3')\n \n gen_shader_headers = files('gen-shader-headers.sh')\n \n+## Check signature algorithm\n+check_algo = files('check-algo.sh')\n+\n ## Module signing\n gen_ipa_priv_key = files('gen-ipa-priv-key.sh')\n \n", "prefixes": [ "v5", "4/4" ] }