From nobody Sat Apr 5 01:00:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1739204648; cv=none; d=zohomail.com; s=zohoarc; b=KrUoJuYN484bBujuPHC13aZgFhY8dLygGqkDaNLwOoLz84kngFIdXKwSzL4CrYcINA0mgtCeCggKIAKMkfkycMhwt0WhiXm8f4YsR33neNbc7Q4tbYHOMsPzGNdxs7JyTES9kKtJu99Jz1VWJ3pSaaTJIAFbNyNEHl9ZN+PrdZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1739204648; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jGsIufIqKlssjun5TXHkqohjkAkuZtcXK/WYSEIHmcE=; b=XSV52zp2dOhKzFByvQrE4qPE1xxMKwr3Ajz986/foXPm9oL+TggLJFQPSr7SknZNbfXqy6sL9sKUTekk6T+HXMweiACM8Szx9Ad/O7MB/fNiSd09G7AKxkSBa0DLUgf++vqkyxWltAaJT6P4hLoxmsGdaPkEIqjX9eQmjbsnX9w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1739204648125781.2158332076532; Mon, 10 Feb 2025 08:24:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1thWY6-00034Q-OB; Mon, 10 Feb 2025 11:22:19 -0500 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 1thWXa-0002Ty-3u for qemu-devel@nongnu.org; Mon, 10 Feb 2025 11:21:50 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1thWXY-0002lO-8R for qemu-devel@nongnu.org; Mon, 10 Feb 2025 11:21:45 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-43944181e68so12882475e9.0 for ; Mon, 10 Feb 2025 08:21:43 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4394328fcb8sm40812425e9.32.2025.02.10.08.21.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Feb 2025 08:21:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739204502; x=1739809302; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jGsIufIqKlssjun5TXHkqohjkAkuZtcXK/WYSEIHmcE=; b=sYr6vG0yEL1Frbl0mWNb2X2vqgL9AVX7/MSPpt62cqUqR9M0/dJXEh3UUc/d51hBt3 e57EtMwSJKitJHtINirfaVph+rzCKXIrJNrKaoRS+fjxhzKITNceXIz8KntKnUkSCqpW f32+dz1y8pr7P8C+jiQLdq1Gv20mKsjpsO8PxaKKWzyqASEPnTwYFzd3b8lk0Kpz4xPQ H5gV31Gsi0kt+QV4KUxGIQD1FLNwP/IVQsPYEDkfZKMntZNKjXZut+oXVwO/AWx4Aheo HEgdVa/qacqh2LHPQzO9XJvAMfWalx4+orwSSiWnVhHZWubO9E7pJ6UFQemcm/+P3mzr /w5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739204502; x=1739809302; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jGsIufIqKlssjun5TXHkqohjkAkuZtcXK/WYSEIHmcE=; b=opFmZTUjRuB+K3Ztv1QJ1l06TOvuTwqDiR4fkm3iHcUJ0mO632VrHwso2ZA0oXIojS PkewrTqwYuiCoRDHc8wq1AWgRp9hOOvYxNATev0Gei9cF+hhnICbHIdRZ1vl0/CcvTty gtFXc2S3jOV07WTyaTAF2500xMX0aLPum1tkyY9983Zfwo/KmH9lZ5aVeU2Ps9rrCxBo 8ZU4M5icYSpl7nEUcN1No1XamrxBqiXaKtohunq9h7YtNTN87iGQS+d7y/1IRRQqBdeK 72slzsIqRPTWRC96/Yb4M7B29lQ5nV6LlJ15y0GnlUAriITZhupTy1J0i+2HXi0pLWVA uw+A== X-Gm-Message-State: AOJu0YxedntLxy1ODavGtNpF+ta7LxjrkGs8I6Qb6M2/veGWf+nv+j1U l38wVLwdoP7Mpzr38C/BAHVsGOr1L8EOd8lllNg/oj7kHUJE1sxqZKS92rsg5Tn4tbEmki0yPaM auVM= X-Gm-Gg: ASbGncvs2EECIDmUJyCzcW8BS17VZXFJ5PPVWJARw45slKmYIY6o5hJrJEGWf4pkX8r MdV0wdJ9rmsJVRQQ0tcwZHvYcnyKuZYuxtAwraSxcmltKO1eENTcMJOgXZDtJfehp4azAUo0ho2 gcjwuuirV8MLkGUSiObhnWPOOICjWYKjxHfMuVsPTHvZWG+vNA6pMTr/HPUOYm/DMfF3Vq5utol qDFhrelHiIi+jpiyCCLtqTFDVOEitoFJtlHlzilIdBpuaeyk3sIawbcDdPIUhuZwfOTPJFJU0lr SyIgBladan1eun7vz0TUqukaFcglfMHAi+C2M+8a6bPQyCXmW/x1WLYP3q/Q5I1/Ow== X-Google-Smtp-Source: AGHT+IHsfwDJgQBfqY7PR/Fu+9BiYEwvsKbG2y5hVZePDUBBSJyIjll25pF+1vvmJuIPSwR1VlrpYQ== X-Received: by 2002:a05:600c:4f05:b0:434:a802:e9a6 with SMTP id 5b1f17b1804b1-43924989da5mr135420505e9.7.1739204502137; Mon, 10 Feb 2025 08:21:42 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/6] crypto/tlscredsx509: Rename 'creds' -> 'x509_creds' Date: Mon, 10 Feb 2025 17:21:30 +0100 Message-ID: <20250210162135.14123-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250210162135.14123-1-philmd@linaro.org> References: <20250210162135.14123-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1739204649549019000 In preparation of naming the QCryptoTLSCreds 'creds' in the next commit, rename QCryptoTLSCredsX509 creds as 'x509_creds'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- crypto/tlscredsx509.c | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c index 24ec5849222..eb197e145f3 100644 --- a/crypto/tlscredsx509.c +++ b/crypto/tlscredsx509.c @@ -531,7 +531,7 @@ qcrypto_tls_creds_x509_sanity_check(QCryptoTLSCredsX509= *creds, =20 =20 static int -qcrypto_tls_creds_x509_load(QCryptoTLSCredsX509 *creds, +qcrypto_tls_creds_x509_load(QCryptoTLSCredsX509 *x509_creds, Error **errp) { char *cacert =3D NULL, *cacrl =3D NULL, *cert =3D NULL, @@ -539,56 +539,56 @@ qcrypto_tls_creds_x509_load(QCryptoTLSCredsX509 *cred= s, int ret; int rv =3D -1; =20 - trace_qcrypto_tls_creds_x509_load(creds, - creds->parent_obj.dir ? creds->parent_obj.dir : ""); + trace_qcrypto_tls_creds_x509_load(x509_creds, + x509_creds->parent_obj.dir ? x509_creds->parent_obj.dir : ""); =20 - if (creds->parent_obj.endpoint =3D=3D QCRYPTO_TLS_CREDS_ENDPOINT_SERVE= R) { - if (qcrypto_tls_creds_get_path(&creds->parent_obj, + if (x509_creds->parent_obj.endpoint =3D=3D QCRYPTO_TLS_CREDS_ENDPOINT_= SERVER) { + if (qcrypto_tls_creds_get_path(&x509_creds->parent_obj, QCRYPTO_TLS_CREDS_X509_CA_CERT, true, &cacert, errp) < 0 || - qcrypto_tls_creds_get_path(&creds->parent_obj, + qcrypto_tls_creds_get_path(&x509_creds->parent_obj, QCRYPTO_TLS_CREDS_X509_CA_CRL, false, &cacrl, errp) < 0 || - qcrypto_tls_creds_get_path(&creds->parent_obj, + qcrypto_tls_creds_get_path(&x509_creds->parent_obj, QCRYPTO_TLS_CREDS_X509_SERVER_CERT, true, &cert, errp) < 0 || - qcrypto_tls_creds_get_path(&creds->parent_obj, + qcrypto_tls_creds_get_path(&x509_creds->parent_obj, QCRYPTO_TLS_CREDS_X509_SERVER_KEY, true, &key, errp) < 0 || - qcrypto_tls_creds_get_path(&creds->parent_obj, + qcrypto_tls_creds_get_path(&x509_creds->parent_obj, QCRYPTO_TLS_CREDS_DH_PARAMS, false, &dhparams, errp) < 0) { goto cleanup; } } else { - if (qcrypto_tls_creds_get_path(&creds->parent_obj, + if (qcrypto_tls_creds_get_path(&x509_creds->parent_obj, QCRYPTO_TLS_CREDS_X509_CA_CERT, true, &cacert, errp) < 0 || - qcrypto_tls_creds_get_path(&creds->parent_obj, + qcrypto_tls_creds_get_path(&x509_creds->parent_obj, QCRYPTO_TLS_CREDS_X509_CLIENT_CERT, false, &cert, errp) < 0 || - qcrypto_tls_creds_get_path(&creds->parent_obj, + qcrypto_tls_creds_get_path(&x509_creds->parent_obj, QCRYPTO_TLS_CREDS_X509_CLIENT_KEY, false, &key, errp) < 0) { goto cleanup; } } =20 - if (creds->sanityCheck && - qcrypto_tls_creds_x509_sanity_check(creds, - creds->parent_obj.endpoint =3D=3D QCRYPTO_TLS_CREDS_ENDPOINT_S= ERVER, + if (x509_creds->sanityCheck && + qcrypto_tls_creds_x509_sanity_check(x509_creds, + x509_creds->parent_obj.endpoint =3D=3D QCRYPTO_TLS_CREDS_ENDPO= INT_SERVER, cacert, cert, errp) < 0) { goto cleanup; } =20 - ret =3D gnutls_certificate_allocate_credentials(&creds->data); + ret =3D gnutls_certificate_allocate_credentials(&x509_creds->data); if (ret < 0) { error_setg(errp, "Cannot allocate credentials: '%s'", gnutls_strerror(ret)); goto cleanup; } =20 - ret =3D gnutls_certificate_set_x509_trust_file(creds->data, + ret =3D gnutls_certificate_set_x509_trust_file(x509_creds->data, cacert, GNUTLS_X509_FMT_PEM); if (ret < 0) { @@ -599,14 +599,14 @@ qcrypto_tls_creds_x509_load(QCryptoTLSCredsX509 *cred= s, =20 if (cert !=3D NULL && key !=3D NULL) { char *password =3D NULL; - if (creds->passwordid) { - password =3D qcrypto_secret_lookup_as_utf8(creds->passwordid, + if (x509_creds->passwordid) { + password =3D qcrypto_secret_lookup_as_utf8(x509_creds->passwor= did, errp); if (!password) { goto cleanup; } } - ret =3D gnutls_certificate_set_x509_key_file2(creds->data, + ret =3D gnutls_certificate_set_x509_key_file2(x509_creds->data, cert, key, GNUTLS_X509_FMT_PEM, password, @@ -620,7 +620,7 @@ qcrypto_tls_creds_x509_load(QCryptoTLSCredsX509 *creds, } =20 if (cacrl !=3D NULL) { - ret =3D gnutls_certificate_set_x509_crl_file(creds->data, + ret =3D gnutls_certificate_set_x509_crl_file(x509_creds->data, cacrl, GNUTLS_X509_FMT_PEM); if (ret < 0) { @@ -630,14 +630,14 @@ qcrypto_tls_creds_x509_load(QCryptoTLSCredsX509 *cred= s, } } =20 - if (creds->parent_obj.endpoint =3D=3D QCRYPTO_TLS_CREDS_ENDPOINT_SERVE= R) { - if (qcrypto_tls_creds_get_dh_params_file(&creds->parent_obj, dhpar= ams, - &creds->parent_obj.dh_par= ams, + if (x509_creds->parent_obj.endpoint =3D=3D QCRYPTO_TLS_CREDS_ENDPOINT_= SERVER) { + if (qcrypto_tls_creds_get_dh_params_file(&x509_creds->parent_obj, = dhparams, + &x509_creds->parent_obj.d= h_params, errp) < 0) { goto cleanup; } - gnutls_certificate_set_dh_params(creds->data, - creds->parent_obj.dh_params); + gnutls_certificate_set_dh_params(x509_creds->data, + x509_creds->parent_obj.dh_params); } =20 rv =3D 0; @@ -652,15 +652,15 @@ qcrypto_tls_creds_x509_load(QCryptoTLSCredsX509 *cred= s, =20 =20 static void -qcrypto_tls_creds_x509_unload(QCryptoTLSCredsX509 *creds) +qcrypto_tls_creds_x509_unload(QCryptoTLSCredsX509 *x509_creds) { - if (creds->data) { - gnutls_certificate_free_credentials(creds->data); - creds->data =3D NULL; + if (x509_creds->data) { + gnutls_certificate_free_credentials(x509_creds->data); + x509_creds->data =3D NULL; } - if (creds->parent_obj.dh_params) { - gnutls_dh_params_deinit(creds->parent_obj.dh_params); - creds->parent_obj.dh_params =3D NULL; + if (x509_creds->parent_obj.dh_params) { + gnutls_dh_params_deinit(x509_creds->parent_obj.dh_params); + x509_creds->parent_obj.dh_params =3D NULL; } } =20 --=20 2.47.1