From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1088ACCF9F8 for ; Fri, 31 Oct 2025 11:33:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vEnNe-0006xP-Ma; Fri, 31 Oct 2025 07:33:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vEnNd-0006x8-Bq for qemu-devel@nongnu.org; Fri, 31 Oct 2025 07:33:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vEnNX-0002Gk-NE for qemu-devel@nongnu.org; Fri, 31 Oct 2025 07:33:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761910387; 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: in-reply-to:in-reply-to:references:references; bh=sEb20HK7eSZm56T++WgMxDh1emREf5mlZ+KyxqhBJmI=; b=EOBlsLgvi4EzFvKWUaF30LZOrzh2ZTOLg+YnwWBtySBZTqm+uozX/MsPwQyLz2d6gvs7SZ mX1cvE6+Q/Nci1vXekyv/tOqU5YCb0WjfdpnWqMRE6ngGYqBLvK1WsTd4yeFaQP6HuybMS vHQjAY54AkBHVMcLz09mqpkX8ygRj/E= Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-F1py5ZhfMFeg6JpwNGU0ug-1; Fri, 31 Oct 2025 07:33:05 -0400 X-MC-Unique: F1py5ZhfMFeg6JpwNGU0ug-1 X-Mimecast-MFC-AGG-ID: F1py5ZhfMFeg6JpwNGU0ug_1761910384 Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-33d75897745so5431373a91.0 for ; Fri, 31 Oct 2025 04:33:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761910384; x=1762515184; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sEb20HK7eSZm56T++WgMxDh1emREf5mlZ+KyxqhBJmI=; b=ObxRm0n8xvX06Gc/z74JcPvQ4euoEe2BVVN7qBhPNa1ePYmLyO2eGVqCXTKzzdfXCX c7fTw4DQIaL7tLUsgVXxJQq3QKWuBQkmv0SYaJeZJd4s0Ts3FgXx10ZvbeuRQxRG2oUG 4kVlWUdDOH1VhdB0rXsAFoj9ybemnYwRbvGEbNU45ZMxWpiWwR8bkoLsGO1OhtJHGByJ ygYzV3vyvcJ+OMkFRotsaJGLcSqw3Cl8Ooy95t9xIo81HmqIhqCWhUtMPd+A9L/rHfvd 0FaFN3g7SDSKvqNOKmkaWpIRFKB0fDRnwOwx3MdliF+hDqyJE4rTRqJnQs9nsHbmURya +D/A== X-Gm-Message-State: AOJu0YxVb2nmD5n0yFbdIENQrD1TBU6XKAQAqPftqKeGPZ4HbBqXhP6l 7o6orByskznxHAHuF+M35k4XmFA1mn8Q10mwd56ppFpHJO93vWKD+WtRpYANzjZV63cPR1E1q+l ATAPA9YLauwZ8gCbvOu1hdcddFuSJuLZajk5asxcEs2Npgsge+6ZDPdHf053lhhrxQnQikTyi0J EOowWVPY3u1I2Cqz25MUC5M2Sydz98q4oztMprLbx7IA== X-Gm-Gg: ASbGnctfPMMlcYnJsBBt49WLv18k5T4eGvh1/b+/DP/pd/q5qsKhCavhrOY92CuzrMa 3QUxNJi9w9bqus5VW2sDHP+vBKVmwRG4TlIDRCPquy9tyxapj5B5RUXrdQitO/sIN5sTAAAhXdQ hf05Ae/4t8UBpSX/SnKynaLYPkxNxJPe+xnLGNUUgbXZ+HSb3dY7u+zixn3aeOmXYz9RCu7841q j4MMHzXi6bcmss= X-Received: by 2002:a17:90b:5910:b0:33b:6650:57c3 with SMTP id 98e67ed59e1d1-340830553e6mr4302510a91.21.1761910383676; Fri, 31 Oct 2025 04:33:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEOZI7q1j4A8Q137UN4aynnhFq5im5MM3m9a4OGIlA5dwkz0a8qJZqWv80om9YOpHRJH/i1lTGqeeHpUeY7oJg= X-Received: by 2002:a17:90b:5910:b0:33b:6650:57c3 with SMTP id 98e67ed59e1d1-340830553e6mr4302459a91.21.1761910383136; Fri, 31 Oct 2025 04:33:03 -0700 (PDT) MIME-Version: 1.0 References: <20251030144927.2241109-1-berrange@redhat.com> <20251030144927.2241109-17-berrange@redhat.com> In-Reply-To: <20251030144927.2241109-17-berrange@redhat.com> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Fri, 31 Oct 2025 15:32:51 +0400 X-Gm-Features: AWmQ_blwecbO-p5U2A2z26xYJ7b7g8sGypoT1M8kdlAXI8urSCFcfhtTlyrd8TM Message-ID: Subject: Re: [PATCH 16/21] crypto: deprecate use of external dh-params.pem file To: =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= Cc: qemu-devel@nongnu.org, devel@lists.libvirt.org Content-Type: multipart/alternative; boundary="0000000000008367b6064272ba42" Received-SPF: pass client-ip=170.10.129.124; envelope-from=mlureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org --0000000000008367b6064272ba42 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi On Thu, Oct 30, 2025 at 6:50=E2=80=AFPM Daniel P. Berrang=C3=A9 wrote: > GNUTLS has deprecated use of externally provided diffie-hellman > parameters, since it will automatically negotiate DH params in > accordance with RFC7919. > The doc says: Since 3.6.0, DH parameters are negotiated following RFC7919. But QEMU doesn't require >=3D 3.6. Add a preliminary patch? > Signed-off-by: Daniel P. Berrang=C3=A9 > Reviewed-by: Marc-Andr=C3=A9 Lureau > --- > crypto/tlscreds.c | 24 ++++++++---------------- > crypto/tlscredsanon.c | 6 ++++-- > crypto/tlscredspsk.c | 6 ++++-- > crypto/tlscredsx509.c | 4 +++- > docs/about/deprecated.rst | 9 +++++++++ > docs/system/tls.rst | 12 +++++++----- > 6 files changed, 35 insertions(+), 26 deletions(-) > > diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c > index 798c9712fb..85268f3b57 100644 > --- a/crypto/tlscreds.c > +++ b/crypto/tlscreds.c > @@ -22,6 +22,7 @@ > #include "qapi/error.h" > #include "qapi-types-crypto.h" > #include "qemu/module.h" > +#include "qemu/error-report.h" > #include "tlscredspriv.h" > #include "trace.h" > > @@ -38,22 +39,7 @@ qcrypto_tls_creds_get_dh_params_file(QCryptoTLSCreds > *creds, > > trace_qcrypto_tls_creds_load_dh(creds, filename ? filename : > ""); > > - if (filename =3D=3D NULL) { > - ret =3D gnutls_dh_params_init(dh_params); > - if (ret < 0) { > - error_setg(errp, "Unable to initialize DH parameters: %s", > - gnutls_strerror(ret)); > - return -1; > - } > - ret =3D gnutls_dh_params_generate2(*dh_params, DH_BITS); > - if (ret < 0) { > - gnutls_dh_params_deinit(*dh_params); > - *dh_params =3D NULL; > - error_setg(errp, "Unable to generate DH parameters: %s", > - gnutls_strerror(ret)); > - return -1; > - } > - } else { > + if (filename !=3D NULL) { > GError *gerr =3D NULL; > gchar *contents; > gsize len; > @@ -67,6 +53,10 @@ qcrypto_tls_creds_get_dh_params_file(QCryptoTLSCreds > *creds, > g_error_free(gerr); > return -1; > } > + warn_report_once("Use of an external DH parameters file '%s' is = " > + "deprecated and will be removed in a future > release", > + filename); > + > data.data =3D (unsigned char *)contents; > data.size =3D len; > ret =3D gnutls_dh_params_init(dh_params); > @@ -87,6 +77,8 @@ qcrypto_tls_creds_get_dh_params_file(QCryptoTLSCreds > *creds, > filename, gnutls_strerror(ret)); > return -1; > } > + } else { > + *dh_params =3D NULL; > } > > return 0; > diff --git a/crypto/tlscredsanon.c b/crypto/tlscredsanon.c > index 69ed1d792a..777cc4f5bb 100644 > --- a/crypto/tlscredsanon.c > +++ b/crypto/tlscredsanon.c > @@ -68,8 +68,10 @@ qcrypto_tls_creds_anon_load(QCryptoTLSCredsAnon *creds= , > return -1; > } > > - gnutls_anon_set_server_dh_params(box->data.anonserver, > - box->dh_params); > + if (box->dh_params) { > + gnutls_anon_set_server_dh_params(box->data.anonserver, > + box->dh_params); > + } > } else { > ret =3D > gnutls_anon_allocate_client_credentials(&box->data.anonclient); > if (ret < 0) { > diff --git a/crypto/tlscredspsk.c b/crypto/tlscredspsk.c > index e437985260..801da50625 100644 > --- a/crypto/tlscredspsk.c > +++ b/crypto/tlscredspsk.c > @@ -129,8 +129,10 @@ qcrypto_tls_creds_psk_load(QCryptoTLSCredsPSK *creds= , > gnutls_strerror(ret)); > goto cleanup; > } > - gnutls_psk_set_server_dh_params(box->data.pskserver, > - box->dh_params); > + if (box->dh_params) { > + gnutls_psk_set_server_dh_params(box->data.pskserver, > + box->dh_params); > + } > } else { > box =3D qcrypto_tls_creds_box_new_client(GNUTLS_CRD_PSK); > > diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c > index 2fc0872627..7e79af4266 100644 > --- a/crypto/tlscredsx509.c > +++ b/crypto/tlscredsx509.c > @@ -684,7 +684,9 @@ qcrypto_tls_creds_x509_load(QCryptoTLSCredsX509 *cred= s, > errp) < 0) { > return -1; > } > - gnutls_certificate_set_dh_params(box->data.cert, box->dh_params)= ; > + if (box->dh_params) { > + gnutls_certificate_set_dh_params(box->data.cert, > box->dh_params); > + } > } > creds->parent_obj.box =3D g_steal_pointer(&box); > > diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst > index ca6b3769b5..694a69da64 100644 > --- a/docs/about/deprecated.rst > +++ b/docs/about/deprecated.rst > @@ -365,6 +365,15 @@ Options are: > - move backing file to NVDIMM storage and keep ``pmem=3Don`` > (to have NVDIMM with persistence guaranties). > > +Using an external DH (Diffie-Hellman) parameters file (since 10.2) > +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' > + > +Loading of external Diffie-Hellman parameters from a 'dh-params.pem' > +file is deprecated and will be removed with no replacement in a > +future release. Where no 'dh-params.pem' file is provided, the DH > +parameters will be automatically negotiated in accordance with > +RFC7919. > + > Device options > -------------- > > diff --git a/docs/system/tls.rst b/docs/system/tls.rst > index a4f6781d62..44c4bf04e9 100644 > --- a/docs/system/tls.rst > +++ b/docs/system/tls.rst > @@ -251,11 +251,13 @@ When specifying the object, the ``dir`` parameters > specifies which > directory contains the credential files. This directory is expected to > contain files with the names mentioned previously, ``ca-cert.pem``, > ``server-key.pem``, ``server-cert.pem``, ``client-key.pem`` and > -``client-cert.pem`` as appropriate. It is also possible to include a set > -of pre-generated Diffie-Hellman (DH) parameters in a file > -``dh-params.pem``, which can be created using the > -``certtool --generate-dh-params`` command. If omitted, QEMU will > -dynamically generate DH parameters when loading the credentials. > +``client-cert.pem`` as appropriate. > + > +While it is possible to include a set of pre-generated Diffie-Hellman > +(DH) parameters in a file ``dh-params.pem``, this facility is now > +deprecated and will be removed in a future release. When omitted the > +DH parameters will be automatically negotiated in accordance with > +RFC7919. > > The ``endpoint`` parameter indicates whether the credentials will be > used for a network client or server, and determines which PEM files are > -- > 2.51.1 > > --0000000000008367b6064272ba42 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Thu, Oct 30, 2025 at 6:50= =E2=80=AFPM Daniel P. Berrang=C3=A9 <berrange@redhat.com> wrote:
GNUTLS has deprecated use of externally provided dif= fie-hellman
parameters, since it will automatically negotiate DH params in
accordance with RFC7919.

The doc says:<= /div>
=C2=A0Since 3.6.0, DH parameters are negotiated following RFC7919.

But QEMU doesn't require &g= t;=3D 3.6. Add a preliminary patch?


Signed-off-by: Daniel P. Berrang=C3=A9 <berrange@redhat.com>

Reviewed-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>
=C2=A0
---
=C2=A0crypto/tlscreds.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 24 ++++++++-----= -----------
=C2=A0crypto/tlscredsanon.c=C2=A0 =C2=A0 =C2=A0|=C2=A0 6 ++++--
=C2=A0crypto/tlscredspsk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 6 ++++--
=C2=A0crypto/tlscredsx509.c=C2=A0 =C2=A0 =C2=A0|=C2=A0 4 +++-
=C2=A0docs/about/deprecated.rst |=C2=A0 9 +++++++++
=C2=A0docs/system/tls.rst=C2=A0 =C2=A0 =C2=A0 =C2=A0| 12 +++++++-----
=C2=A06 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c
index 798c9712fb..85268f3b57 100644
--- a/crypto/tlscreds.c
+++ b/crypto/tlscreds.c
@@ -22,6 +22,7 @@
=C2=A0#include "qapi/error.h"
=C2=A0#include "qapi-types-crypto.h"
=C2=A0#include "qemu/module.h"
+#include "qemu/error-report.h"
=C2=A0#include "tlscredspriv.h"
=C2=A0#include "trace.h"

@@ -38,22 +39,7 @@ qcrypto_tls_creds_get_dh_params_file(QCryptoTLSCreds *cr= eds,

=C2=A0 =C2=A0 =C2=A0trace_qcrypto_tls_creds_load_dh(creds, filename ? filen= ame : "<generated>");

-=C2=A0 =C2=A0 if (filename =3D=3D NULL) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 ret =3D gnutls_dh_params_init(dh_params);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ret < 0) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error_setg(errp, "Unable to= initialize DH parameters: %s",
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0gnutls_strerror(ret));
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return -1;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 ret =3D gnutls_dh_params_generate2(*dh_params,= DH_BITS);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ret < 0) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gnutls_dh_params_deinit(*dh_para= ms);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *dh_params =3D NULL;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error_setg(errp, "Unable to= generate DH parameters: %s",
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0gnutls_strerror(ret));
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return -1;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
-=C2=A0 =C2=A0 } else {
+=C2=A0 =C2=A0 if (filename !=3D NULL) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0GError *gerr =3D NULL;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gchar *contents;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gsize len;
@@ -67,6 +53,10 @@ qcrypto_tls_creds_get_dh_params_file(QCryptoTLSCreds *cr= eds,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0g_error_free(gerr);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -1;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 warn_report_once("Use of an external DH p= arameters file '%s' is "
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0"deprecated and will be removed in a future release&q= uot;,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0filename);
+
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0data.data =3D (unsigned char *)contents;<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0data.size =3D len;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D gnutls_dh_params_init(dh_params);=
@@ -87,6 +77,8 @@ qcrypto_tls_creds_get_dh_params_file(QCryptoTLSCreds *cre= ds,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 filename, gnutls_strerror(ret));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -1;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 } else {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 *dh_params =3D NULL;
=C2=A0 =C2=A0 =C2=A0}

=C2=A0 =C2=A0 =C2=A0return 0;
diff --git a/crypto/tlscredsanon.c b/crypto/tlscredsanon.c
index 69ed1d792a..777cc4f5bb 100644
--- a/crypto/tlscredsanon.c
+++ b/crypto/tlscredsanon.c
@@ -68,8 +68,10 @@ qcrypto_tls_creds_anon_load(QCryptoTLSCredsAnon *creds,<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -1;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}

-=C2=A0 =C2=A0 =C2=A0 =C2=A0 gnutls_anon_set_server_dh_params(box->data.= anonserver,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bo= x->dh_params);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (box->dh_params) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gnutls_anon_set_server_dh_params= (box->data.anonserver,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0box->dh_params);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0} else {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D gnutls_anon_allocate_client_crede= ntials(&box->data.anonclient);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (ret < 0) {
diff --git a/crypto/tlscredspsk.c b/crypto/tlscredspsk.c
index e437985260..801da50625 100644
--- a/crypto/tlscredspsk.c
+++ b/crypto/tlscredspsk.c
@@ -129,8 +129,10 @@ qcrypto_tls_creds_psk_load(QCryptoTLSCredsPSK *creds,<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 gnutls_strerror(ret));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto cleanup;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 gnutls_psk_set_server_dh_params(box->data.p= skserver,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 box->= dh_params);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (box->dh_params) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gnutls_psk_set_server_dh_params(= box->data.pskserver,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 box->dh_params);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0} else {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0box =3D qcrypto_tls_creds_box_new_client(= GNUTLS_CRD_PSK);

diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c
index 2fc0872627..7e79af4266 100644
--- a/crypto/tlscredsx509.c
+++ b/crypto/tlscredsx509.c
@@ -684,7 +684,9 @@ qcrypto_tls_creds_x509_load(QCryptoTLSCredsX509 *creds,=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 errp) < 0) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -1;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 gnutls_certificate_set_dh_params(box->data.= cert, box->dh_params);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (box->dh_params) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gnutls_certificate_set_dh_params= (box->data.cert, box->dh_params);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0creds->parent_obj.box =3D g_steal_pointer(&box);=

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index ca6b3769b5..694a69da64 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -365,6 +365,15 @@ Options are:
=C2=A0 =C2=A0 =C2=A0- move backing file to NVDIMM storage and keep ``pmem= =3Don``
=C2=A0 =C2=A0 =C2=A0 =C2=A0(to have NVDIMM with persistence guaranties).
+Using an external DH (Diffie-Hellman) parameters file (since 10.2)
+'''''''''''''''= ;'''''''''''''''= ;'''''''''''''''= ;'''''''''''''''= ;''''''
+
+Loading of external Diffie-Hellman parameters from a 'dh-params.pem= 9;
+file is deprecated and will be removed with no replacement in a
+future release. Where no 'dh-params.pem' file is provided, the DH<= br> +parameters will be automatically negotiated in accordance with
+RFC7919.
+
=C2=A0Device options
=C2=A0--------------

diff --git a/docs/system/tls.rst b/docs/system/tls.rst
index a4f6781d62..44c4bf04e9 100644
--- a/docs/system/tls.rst
+++ b/docs/system/tls.rst
@@ -251,11 +251,13 @@ When specifying the object, the ``dir`` parameters sp= ecifies which
=C2=A0directory contains the credential files. This directory is expected t= o
=C2=A0contain files with the names mentioned previously, ``ca-cert.pem``, =C2=A0``server-key.pem``, ``server-cert.pem``, ``client-key.pem`` and
-``client-cert.pem`` as appropriate. It is also possible to include a set -of pre-generated Diffie-Hellman (DH) parameters in a file
-``dh-params.pem``, which can be created using the
-``certtool --generate-dh-params`` command. If omitted, QEMU will
-dynamically generate DH parameters when loading the credentials.
+``client-cert.pem`` as appropriate.
+
+While it is possible to include a set of pre-generated Diffie-Hellman
+(DH) parameters in a file ``dh-params.pem``, this facility is now
+deprecated and will be removed in a future release. When omitted the
+DH parameters will be automatically negotiated in accordance with
+RFC7919.

=C2=A0The ``endpoint`` parameter indicates whether the credentials will be<= br> =C2=A0used for a network client or server, and determines which PEM files a= re
--
2.51.1

--0000000000008367b6064272ba42--