From nobody Fri Nov 21 10:05:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1762430072; cv=none; d=zohomail.com; s=zohoarc; b=avWBkKcUgMrcpB361rbZD7zl8u9sX4RHnwcFtQ4EqgtS7xPpKftsRCrTC7uEwTQsjH0cWiWDQ6zG2ePe1xVW7JSp/pUG4ODg2a0G9jVw4NaWGbZupB9m8pgOSQpKSGc1cfzX9fHD4xQBnkNB47t75YWJ/47+6CHDpeyNj7db59M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762430072; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=nddnPkoWB0NDLVpQdnU4Diujvlb/WyEgGV59hiuu88U=; b=b9SgmkoYAzmZmZ9ikybnDV9GNbMi0uWGjescepj9Ju/mS+Xq/1oSEAzkzs2wlpuDNimgjyV/PSWU1CqT4e7miK15uHHmsjp7rfNU1e1gabBP794nP8sedKRhBxEcQ6ttNr7Bh7TlwqYTfDL4ntsnxG+pgMUDcVkSnMnGGmdiXkQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1762430072563960.0802097992662; Thu, 6 Nov 2025 03:54:32 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id A7E2E44087; Thu, 6 Nov 2025 06:54:28 -0500 (EST) Received: from [172.19.199.29] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id B4C504418C; Thu, 6 Nov 2025 06:53:19 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 54EF144013; Thu, 6 Nov 2025 06:53:07 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id D305341B81 for ; Thu, 6 Nov 2025 06:53:04 -0500 (EST) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-61-K502Ud-xOGObtEC-DT9NQA-1; Thu, 06 Nov 2025 06:53:03 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5328C195608A for ; Thu, 6 Nov 2025 11:53:02 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.39]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3617B3001E83; Thu, 6 Nov 2025 11:52:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762429984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nddnPkoWB0NDLVpQdnU4Diujvlb/WyEgGV59hiuu88U=; b=TdCCQ/VyOs3BxD3XDWRaPGzZZn9a5ICy6iaIEjvI+irn3gvdUpM+Jiy/TvkXgYW79yLsHU 7A+Hqks3tNPC15ItNNvSS6IgdiZg2hiiEKRPJz06uKMVfQijyiAShmtE+S9NpYRQfP3HSW JDBrpvUhe/gFRjJT6SHIlGDzOT2dGvs= X-MC-Unique: K502Ud-xOGObtEC-DT9NQA-1 X-Mimecast-MFC-AGG-ID: K502Ud-xOGObtEC-DT9NQA_1762429982 To: devel@lists.libvirt.org Subject: [PATCH] meson: default to system crypto policies where available Date: Thu, 6 Nov 2025 11:52:57 +0000 Message-ID: <20251106115257.1709867-1-berrange@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: qyBNVG-neQ5-7t29dzARQ0xJosYPW20RiZAeELqw4Vc_1762429982 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: NNUPRETNPCWIVS6UAECM3THCA2N3DFX6 X-Message-ID-Hash: NNUPRETNPCWIVS6UAECM3THCA2N3DFX6 X-MailFrom: berrange@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9_via_Devel?= Reply-To: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1762430077635154100 From: Daniel P. Berrang=C3=A9 In RHEL and Fedora, the built-in GNUTLS default priority is changed from "NORMAL" to "@SYSTEM", but because libvirt sets an explicit policy with gnutls we don't honour that. Instead we force "NORMAL" unless the 'tls_priority' meson option is changed. In RPM builds, meanwhile, we ask for "@LIBVIRT,SYSTEM" to make it look for a libvirt specific profile first, falling back to "@SYSTEM" This changes the meson option to default to "@LIBVIRT,SYSTEM" if the crypto-policies config is present on the local machine and the meson option -Dsystem=3Dtrue is given. This gives developers more appropriate default behaviour, matching that seen in package builds. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- meson.build | 13 ++++++++++++- meson_options.txt | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index d68b37d0ba..c1871de64c 100644 --- a/meson.build +++ b/meson.build @@ -2035,7 +2035,18 @@ elif get_option('userfaultfd_sysctl').enabled() error('userfaultfd_sysctl option requires sysctl_config to be enabled') endif =20 -conf.set_quoted('TLS_PRIORITY', get_option('tls_priority')) +prio =3D get_option('tls_priority') +if prio =3D=3D 'auto' + # If local OS has 'crypto-policies' then default to that + policy =3D '/etc/crypto-policies/config' + if get_option('system') and \ + run_command('test', '-f', policy, check: false).returncode() =3D=3D= 0 + prio =3D '@LIBVIRT,SYSTEM' + else + prio =3D 'NORMAL' + endif +endif +conf.set_quoted('TLS_PRIORITY', prio) =20 =20 # test options diff --git a/meson_options.txt b/meson_options.txt index 3dc3e8667b..8b6b26dfc6 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -134,4 +134,4 @@ option('ssh_proxy', type: 'feature', value: 'auto', des= cription: 'Build ssh-prox option('sysctl_config', type: 'feature', value: 'auto', description: 'Whet= her to install sysctl configs') # dep:sysctl_config option('userfaultfd_sysctl', type: 'feature', value: 'auto', description: = 'Whether to install sysctl config for enabling unprivileged userfaultfd') -option('tls_priority', type: 'string', value: 'NORMAL', description: 'set = the default TLS session priority string') +option('tls_priority', type: 'string', value: 'auto', description: 'set th= e default TLS session priority string') --=20 2.51.1