encryption: Add luks parsing for storageencryption

Add parse and format of the luks/passphrase secret including tests for
volume XML parsing.

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan
2016-06-01 15:01:31 -04:00
parent 47e88b33be
commit 9bbf0d7e64
15 changed files with 140 additions and 6 deletions

View File

@@ -56,8 +56,20 @@
the <code>secret</code> element is not present during volume creation,
a secret is automatically generated and attached to the volume.
</p>
<h3><a name="StorageEncryptionLuks">"luks" format</a></h3>
<p>
The <code>luks</code> format is specific to a luks encrypted volume
and the secret used in order to either encrypt or decrypt the volume.
A single <code>&lt;secret type='passphrase'...&gt;</code> element is
expected. The secret may be referenced via either a <code>uuid</code> or
<code>usage</code> attribute. One of the two must be present. When
present for volume creation, the secret will be used in order for
volume encryption. When present for domain usage, the secret will
be used as the passphrase to decrypt the volume.
<span class="since">Since 2.1.0</span>.
</p>
<h2><a name="example">Example</a></h2>
<h2><a name="example">Examples</a></h2>
<p>
Here is a simple example, specifying use of the <code>qcow</code> format:
@@ -67,5 +79,17 @@
&lt;encryption format='qcow'&gt;
&lt;secret type='passphrase' uuid='c1f11a6d-8c5d-4a3e-ac7a-4e171c5e0d4a' /&gt;
&lt;/encryption&gt;</pre>
<p>
Here is a simple example, specifying use of the <code>luks</code> format
where it's assumed that a <code>secret</code> has been defined using a
<code>usage</code> element with a <code>id</code> of "luks_example":
</p>
<pre>
&lt;encryption format='luks'&gt;
&lt;secret type='passphrase' usage='luks_example'/&gt;
&lt;/encryption&gt;
</pre>
</body>
</html>