From nobody Sun Feb 8 21:27:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@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 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600275912; cv=none; d=zohomail.com; s=zohoarc; b=YnwQVkjpwsXnzujkLODVVYjZ8kxpXUgLkZ/zAtwZQWDFIFoUDmunI4m257HDK6RAqKEWlInPF4IfBHEAS+7T87p0b5PrJUXaRH6NiywNcPll8wxXVZaJaZ9ooWqF5EmimpM4TO011KWF9Rl9RMM8AJaSgwWk9NjnOc1+/n3EJ+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600275912; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iVVmX+51BjKBaIAfYt/noeTC/412bku+PBHaBVi8Jw4=; b=ZZ1udPaUwrczHvCZf7N/mRWo7SXmPISsy7QIqz4HcpGe+cvhBBvanlVPE6KZgSNFe6BYKAAhvXhlLMu6NtH681s6mXZ8MOg/+oxhRm7GYM9Ge4HY7lVsUyDmakH8x153DY1z/mKjMhizcwUdM0ItldEjbtjLjlt4qy3G1MXoobY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600275912765898.1452114587447; Wed, 16 Sep 2020 10:05:12 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-532-1RjUWiXKPmu8XIcc5Zv85g-1; Wed, 16 Sep 2020 13:05:09 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 87EE01018724; Wed, 16 Sep 2020 17:05:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 63A0B5DEB3; Wed, 16 Sep 2020 17:05:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1322944A6A; Wed, 16 Sep 2020 17:05:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08GH4xDi001727 for ; Wed, 16 Sep 2020 13:04:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4987E7EB7C; Wed, 16 Sep 2020 17:04:59 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-113-248.ams2.redhat.com [10.36.113.248]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7695E76E16; Wed, 16 Sep 2020 17:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600275911; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=iVVmX+51BjKBaIAfYt/noeTC/412bku+PBHaBVi8Jw4=; b=aEUGt+rX8U9ZB77rYimcZkoiQH8e3Mc4hJCvwgNvA/EfTLBHhhy+r2deLT8S18PiP5mJNZ 7mHbrfSpAjRxje2eLCcEvzjNO/3svQFmLHDNcSqtVUb9H/Uj7c9V5AafByIt2mVDwJovkW 6UYXAEh1RvrQIPzeAvocBPlIpb99ifE= X-MC-Unique: 1RjUWiXKPmu8XIcc5Zv85g-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] util: detect LUKS encryption scheme in qcow2 files Date: Wed, 16 Sep 2020 18:04:51 +0100 Message-Id: <20200916170452.1564481-2-berrange@redhat.com> In-Reply-To: <20200916170452.1564481-1-berrange@redhat.com> References: <20200916170452.1564481-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Crypt method number 2 indicates LUKS format. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/util/virstoragefile.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 97a346db28..42341150e5 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -290,6 +290,22 @@ static struct FileEncryptionInfo const qcow2Encryption= Info[] =3D { =20 .payloadOffset =3D -1, }, + { + .format =3D VIR_STORAGE_ENCRYPTION_FORMAT_LUKS, + + .magicOffset =3D 0, + .magic =3D NULL, + .endian =3D LV_BIG_ENDIAN, + + .versionOffset =3D -1, + .versionSize =3D 0, + .versionNumbers =3D {}, + + .modeOffset =3D QCOW2_HDR_CRYPT, + .modeValue =3D 2, + + .payloadOffset =3D -1, + }, { 0 } }; =20 --=20 2.26.2