summaryrefslogtreecommitdiffstats
path: root/crypto/block-qcow.h
diff options
context:
space:
mode:
authorDaniel P. Berrange2015-10-24 12:44:13 +0200
committerDaniel P. Berrange2016-03-17 15:41:15 +0100
commit7d9690148ac25bc755a759adab7d63f517d092b1 (patch)
tree4d0602424dc0864328c4c6617f318d646a3a0f51 /crypto/block-qcow.h
parentcrypto: wire up XTS mode for cipher APIs (diff)
downloadqemu-7d9690148ac25bc755a759adab7d63f517d092b1.tar.gz
qemu-7d9690148ac25bc755a759adab7d63f517d092b1.tar.xz
qemu-7d9690148ac25bc755a759adab7d63f517d092b1.zip
crypto: add block encryption framework
Add a generic framework for supporting different block encryption formats. Upon instantiating a QCryptoBlock object, it will read the encryption header and extract the encryption keys. It is then possible to call methods to encrypt/decrypt data buffers. There is also a mode whereby it will create/initialize a new encryption header on a previously unformatted volume. The initial framework comes with support for the legacy QCow AES based encryption. This enables code in the QCow driver to be consolidated later. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'crypto/block-qcow.h')
-rw-r--r--crypto/block-qcow.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/crypto/block-qcow.h b/crypto/block-qcow.h
new file mode 100644
index 0000000000..569f836100
--- /dev/null
+++ b/crypto/block-qcow.h
@@ -0,0 +1,28 @@
+/*
+ * QEMU Crypto block device encryption QCow/QCow2 AES-CBC format
+ *
+ * Copyright (c) 2015-2016 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef QCRYPTO_BLOCK_QCOW_H__
+#define QCRYPTO_BLOCK_QCOW_H__
+
+#include "crypto/blockpriv.h"
+
+extern const QCryptoBlockDriver qcrypto_block_driver_qcow;
+
+#endif /* QCRYPTO_BLOCK_QCOW_H__ */