From nobody Mon Feb 9 19:06:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1624896583; cv=none; d=zohomail.com; s=zohoarc; b=R3JtLVPzMuo3Dwvl8BuQp8FdlDI3sgfbJQF9SkUIg2i63RphQgUR9AIsiBT6Wg5V5nWYJ04xkdGMX+Vj4dA/Cfgz8JZnGz/57ziiD07Y9Jbf6sk7NJtslDJH/Tha9w4CUBg76CbNB+dpAaDouZTkALP0GCvyet70bo0b6+rR4qs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624896583; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=TD8DXvgsYWHHJcVzYutELY0M+7fBmJca4T5Y2PtlOCw=; b=mb85BMuBQhUACxC6Mf4fq+9CUZ769AYKgZxcfqu/avdq3eM8wv/rNVn9uF24DTBqIJlNjUFy7PFHlUeC0XOyorRXZQatoHgwbtY2c9BFJUDMu2NKB+m+xWZACZ6Z4vFYs13LEXSDRyIXipZonWkUEEemFAGhM28gu1Fv3t60KhI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1624896583737844.922316721571; Mon, 28 Jun 2021 09:09:43 -0700 (PDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-171-n9zsz36UM-iFDnXIfh_i8w-1; Mon, 28 Jun 2021 12:09:39 -0400 Received: by mail-wm1-f72.google.com with SMTP id r204-20020a1c44d50000b02901e993531cf2so180230wma.7 for ; Mon, 28 Jun 2021 09:09:38 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id c16sm6794852wmr.2.2021.06.28.09.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jun 2021 09:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624896582; 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: in-reply-to:in-reply-to:references:references; bh=TD8DXvgsYWHHJcVzYutELY0M+7fBmJca4T5Y2PtlOCw=; b=SfuV30Vu70bibvHOROmmAeG2a+CufZW1IvCzMXIPreFQp/CCvj1aslznXB4ZeSpnevJzQT fsjnksq9rFv63sw6UcUyJVbwgcMbfjxVigY3dyw7K0Ev1Xxmw2pQgkIN+K8opW7afP+PX8 EVXr2W7J42ykJCjcBabxwEW4xQnvSvo= X-MC-Unique: n9zsz36UM-iFDnXIfh_i8w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TD8DXvgsYWHHJcVzYutELY0M+7fBmJca4T5Y2PtlOCw=; b=TLk7pzjJ1j9l2WvJKdrdQBSYc7bp4t6nUhv2/Sedsf5x68fKA6mtc/iUjGfOCsIVjO VZ8eWDh0hPKAQ3J1NL83rknhu+swJ+B3B+6nvWpykWc5GGyAysCsE/m9Q+Ur2DHa+9nf Nedzxl0pz0vsadBgTSGTPINuyhHj7i2gH96mEo+QsMxJKQBrdD0Z2ShmLiZmDPTy1kt8 nBt/blb4+XuNgcn3Jmoiz/o+HBKJLc9oe7KyPnGcL6EOR2SRu044exOM3Zc4cgaLkAKM V+ZwG/AWTB2pRPegmL+O5nGkG+EYfdrMkgAqX0LzYhNZkuU0PagxYHikES9uGL5bBXX+ 6tZA== X-Gm-Message-State: AOAM5300xGUS7KWY/twQC3jcWQMDv6lieib5AjXSa60Vkt/4fFdhIf9V UkSbTStw5vxGj1L2eJs7d1lqHfZPRUKQRtD+vHcWOP8dtJPOs8nPunwgBfiDmaIRVjN/OL0zhNr sLCCcQ2Cm6npowA== X-Received: by 2002:a7b:cbcd:: with SMTP id n13mr5556208wmi.18.1624896577939; Mon, 28 Jun 2021 09:09:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypc3fmtal7SMGzFkjDJxNHml8cOxCAVRvW7WysYppdS4UPTDdJlhkl0TQtARgOisEjwJqzYg== X-Received: by 2002:a7b:cbcd:: with SMTP id n13mr5556196wmi.18.1624896577840; Mon, 28 Jun 2021 09:09:37 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-block@nongnu.org, Akihiko Odaki , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v6 5/7] migration/tls: Use qcrypto_tls_creds_check_endpoint() Date: Mon, 28 Jun 2021 18:09:12 +0200 Message-Id: <20210628160914.2461906-6-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210628160914.2461906-1-philmd@redhat.com> References: <20210628160914.2461906-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Avoid accessing QCryptoTLSCreds internals by using the qcrypto_tls_creds_check_endpoint() helper. Reviewed-by: Richard Henderson Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- migration/tls.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/migration/tls.c b/migration/tls.c index abb149d8325..ca1ea3bbdd4 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -49,11 +49,7 @@ migration_tls_get_creds(MigrationState *s, s->parameters.tls_creds); return NULL; } - if (ret->endpoint !=3D endpoint) { - error_setg(errp, - "Expected TLS credentials for a %s endpoint", - endpoint =3D=3D QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT ? - "client" : "server"); + if (!qcrypto_tls_creds_check_endpoint(ret, endpoint, errp)) { return NULL; } =20 --=20 2.31.1