]>
Commit | Line | Data |
---|---|---|
a090187d DB |
1 | # -*- Mode: Python -*- |
2 | # | |
3 | # QAPI crypto definitions | |
4 | ||
5 | ## | |
c5927e7a | 6 | # @QCryptoTLSCredsEndpoint: |
a090187d DB |
7 | # |
8 | # The type of network endpoint that will be using the credentials. | |
9 | # Most types of credential require different setup / structures | |
10 | # depending on whether they will be used in a server versus a | |
11 | # client. | |
12 | # | |
13 | # @client: the network endpoint is acting as the client | |
14 | # | |
15 | # @server: the network endpoint is acting as the server | |
16 | # | |
17 | # Since: 2.5 | |
18 | ## | |
19 | { 'enum': 'QCryptoTLSCredsEndpoint', | |
20 | 'prefix': 'QCRYPTO_TLS_CREDS_ENDPOINT', | |
21 | 'data': ['client', 'server']} | |
ac1d8878 DB |
22 | |
23 | ||
24 | ## | |
c5927e7a | 25 | # @QCryptoSecretFormat: |
ac1d8878 DB |
26 | # |
27 | # The data format that the secret is provided in | |
28 | # | |
29 | # @raw: raw bytes. When encoded in JSON only valid UTF-8 sequences can be used | |
30 | # @base64: arbitrary base64 encoded binary data | |
31 | # Since: 2.6 | |
32 | ## | |
33 | { 'enum': 'QCryptoSecretFormat', | |
34 | 'prefix': 'QCRYPTO_SECRET_FORMAT', | |
35 | 'data': ['raw', 'base64']} | |
d84b79d3 DB |
36 | |
37 | ||
38 | ## | |
c5927e7a | 39 | # @QCryptoHashAlgorithm: |
d84b79d3 DB |
40 | # |
41 | # The supported algorithms for computing content digests | |
42 | # | |
43 | # @md5: MD5. Should not be used in any new code, legacy compat only | |
44 | # @sha1: SHA-1. Should not be used in any new code, legacy compat only | |
9164b897 | 45 | # @sha224: SHA-224. (since 2.7) |
d84b79d3 | 46 | # @sha256: SHA-256. Current recommended strong hash. |
9164b897 DB |
47 | # @sha384: SHA-384. (since 2.7) |
48 | # @sha512: SHA-512. (since 2.7) | |
49 | # @ripemd160: RIPEMD-160. (since 2.7) | |
d84b79d3 DB |
50 | # Since: 2.6 |
51 | ## | |
52 | { 'enum': 'QCryptoHashAlgorithm', | |
53 | 'prefix': 'QCRYPTO_HASH_ALG', | |
9164b897 | 54 | 'data': ['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'ripemd160']} |
d8c02bcc DB |
55 | |
56 | ||
57 | ## | |
c5927e7a | 58 | # @QCryptoCipherAlgorithm: |
d8c02bcc DB |
59 | # |
60 | # The supported algorithms for content encryption ciphers | |
61 | # | |
62 | # @aes-128: AES with 128 bit / 16 byte keys | |
63 | # @aes-192: AES with 192 bit / 24 byte keys | |
64 | # @aes-256: AES with 256 bit / 32 byte keys | |
65 | # @des-rfb: RFB specific variant of single DES. Do not use except in VNC. | |
084a85ee | 66 | # @cast5-128: Cast5 with 128 bit / 16 byte keys |
94318522 DB |
67 | # @serpent-128: Serpent with 128 bit / 16 byte keys |
68 | # @serpent-192: Serpent with 192 bit / 24 byte keys | |
69 | # @serpent-256: Serpent with 256 bit / 32 byte keys | |
50f6753e DB |
70 | # @twofish-128: Twofish with 128 bit / 16 byte keys |
71 | # @twofish-192: Twofish with 192 bit / 24 byte keys | |
72 | # @twofish-256: Twofish with 256 bit / 32 byte keys | |
d8c02bcc DB |
73 | # Since: 2.6 |
74 | ## | |
75 | { 'enum': 'QCryptoCipherAlgorithm', | |
76 | 'prefix': 'QCRYPTO_CIPHER_ALG', | |
084a85ee DB |
77 | 'data': ['aes-128', 'aes-192', 'aes-256', |
78 | 'des-rfb', | |
94318522 | 79 | 'cast5-128', |
50f6753e DB |
80 | 'serpent-128', 'serpent-192', 'serpent-256', |
81 | 'twofish-128', 'twofish-192', 'twofish-256']} | |
d8c02bcc DB |
82 | |
83 | ||
84 | ## | |
c5927e7a | 85 | # @QCryptoCipherMode: |
d8c02bcc DB |
86 | # |
87 | # The supported modes for content encryption ciphers | |
88 | # | |
89 | # @ecb: Electronic Code Book | |
90 | # @cbc: Cipher Block Chaining | |
eaec903c | 91 | # @xts: XEX with tweaked code book and ciphertext stealing |
3c28292f | 92 | # @ctr: Counter (Since 2.8) |
d8c02bcc DB |
93 | # Since: 2.6 |
94 | ## | |
95 | { 'enum': 'QCryptoCipherMode', | |
96 | 'prefix': 'QCRYPTO_CIPHER_MODE', | |
3c28292f | 97 | 'data': ['ecb', 'cbc', 'xts', 'ctr']} |
cb730894 DB |
98 | |
99 | ||
100 | ## | |
c5927e7a | 101 | # @QCryptoIVGenAlgorithm: |
cb730894 DB |
102 | # |
103 | # The supported algorithms for generating initialization | |
104 | # vectors for full disk encryption. The 'plain' generator | |
105 | # should not be used for disks with sector numbers larger | |
106 | # than 2^32, except where compatibility with pre-existing | |
107 | # Linux dm-crypt volumes is required. | |
108 | # | |
109 | # @plain: 64-bit sector number truncated to 32-bits | |
110 | # @plain64: 64-bit sector number | |
111 | # @essiv: 64-bit sector number encrypted with a hash of the encryption key | |
112 | # Since: 2.6 | |
113 | ## | |
114 | { 'enum': 'QCryptoIVGenAlgorithm', | |
115 | 'prefix': 'QCRYPTO_IVGEN_ALG', | |
116 | 'data': ['plain', 'plain64', 'essiv']} | |
7d969014 DB |
117 | |
118 | ## | |
c5927e7a | 119 | # @QCryptoBlockFormat: |
7d969014 DB |
120 | # |
121 | # The supported full disk encryption formats | |
122 | # | |
123 | # @qcow: QCow/QCow2 built-in AES-CBC encryption. Use only | |
124 | # for liberating data from old images. | |
3e308f20 | 125 | # @luks: LUKS encryption format. Recommended for new images |
7d969014 DB |
126 | # |
127 | # Since: 2.6 | |
128 | ## | |
129 | { 'enum': 'QCryptoBlockFormat', | |
130 | # 'prefix': 'QCRYPTO_BLOCK_FORMAT', | |
3e308f20 | 131 | 'data': ['qcow', 'luks']} |
7d969014 DB |
132 | |
133 | ## | |
c5927e7a | 134 | # @QCryptoBlockOptionsBase: |
7d969014 DB |
135 | # |
136 | # The common options that apply to all full disk | |
137 | # encryption formats | |
138 | # | |
139 | # @format: the encryption format | |
140 | # | |
141 | # Since: 2.6 | |
142 | ## | |
143 | { 'struct': 'QCryptoBlockOptionsBase', | |
144 | 'data': { 'format': 'QCryptoBlockFormat' }} | |
145 | ||
146 | ## | |
c5927e7a | 147 | # @QCryptoBlockOptionsQCow: |
7d969014 DB |
148 | # |
149 | # The options that apply to QCow/QCow2 AES-CBC encryption format | |
150 | # | |
151 | # @key-secret: #optional the ID of a QCryptoSecret object providing the | |
152 | # decryption key. Mandatory except when probing image for | |
153 | # metadata only. | |
154 | # | |
155 | # Since: 2.6 | |
156 | ## | |
157 | { 'struct': 'QCryptoBlockOptionsQCow', | |
158 | 'data': { '*key-secret': 'str' }} | |
159 | ||
3e308f20 | 160 | ## |
c5927e7a | 161 | # @QCryptoBlockOptionsLUKS: |
3e308f20 DB |
162 | # |
163 | # The options that apply to LUKS encryption format | |
164 | # | |
165 | # @key-secret: #optional the ID of a QCryptoSecret object providing the | |
166 | # decryption key. Mandatory except when probing image for | |
167 | # metadata only. | |
168 | # Since: 2.6 | |
169 | ## | |
170 | { 'struct': 'QCryptoBlockOptionsLUKS', | |
171 | 'data': { '*key-secret': 'str' }} | |
172 | ||
173 | ||
174 | ## | |
c5927e7a | 175 | # @QCryptoBlockCreateOptionsLUKS: |
3e308f20 DB |
176 | # |
177 | # The options that apply to LUKS encryption format initialization | |
178 | # | |
179 | # @cipher-alg: #optional the cipher algorithm for data encryption | |
180 | # Currently defaults to 'aes'. | |
181 | # @cipher-mode: #optional the cipher mode for data encryption | |
182 | # Currently defaults to 'cbc' | |
183 | # @ivgen-alg: #optional the initialization vector generator | |
184 | # Currently defaults to 'essiv' | |
185 | # @ivgen-hash-alg: #optional the initialization vector generator hash | |
186 | # Currently defaults to 'sha256' | |
187 | # @hash-alg: #optional the master key hash algorithm | |
188 | # Currently defaults to 'sha256' | |
3bd18890 DB |
189 | # @iter-time: #optional number of milliseconds to spend in |
190 | # PBKDF passphrase processing. Currently defaults | |
2ab66cd5 | 191 | # to 2000. (since 2.8) |
3e308f20 DB |
192 | # Since: 2.6 |
193 | ## | |
194 | { 'struct': 'QCryptoBlockCreateOptionsLUKS', | |
195 | 'base': 'QCryptoBlockOptionsLUKS', | |
196 | 'data': { '*cipher-alg': 'QCryptoCipherAlgorithm', | |
197 | '*cipher-mode': 'QCryptoCipherMode', | |
198 | '*ivgen-alg': 'QCryptoIVGenAlgorithm', | |
199 | '*ivgen-hash-alg': 'QCryptoHashAlgorithm', | |
3bd18890 DB |
200 | '*hash-alg': 'QCryptoHashAlgorithm', |
201 | '*iter-time': 'int'}} | |
3e308f20 DB |
202 | |
203 | ||
7d969014 | 204 | ## |
c5927e7a | 205 | # @QCryptoBlockOpenOptions: |
7d969014 DB |
206 | # |
207 | # The options that are available for all encryption formats | |
208 | # when opening an existing volume | |
209 | # | |
210 | # Since: 2.6 | |
211 | ## | |
212 | { 'union': 'QCryptoBlockOpenOptions', | |
213 | 'base': 'QCryptoBlockOptionsBase', | |
214 | 'discriminator': 'format', | |
3e308f20 DB |
215 | 'data': { 'qcow': 'QCryptoBlockOptionsQCow', |
216 | 'luks': 'QCryptoBlockOptionsLUKS' } } | |
7d969014 DB |
217 | |
218 | ||
219 | ## | |
c5927e7a | 220 | # @QCryptoBlockCreateOptions: |
7d969014 DB |
221 | # |
222 | # The options that are available for all encryption formats | |
223 | # when initializing a new volume | |
224 | # | |
225 | # Since: 2.6 | |
226 | ## | |
227 | { 'union': 'QCryptoBlockCreateOptions', | |
228 | 'base': 'QCryptoBlockOptionsBase', | |
229 | 'discriminator': 'format', | |
3e308f20 DB |
230 | 'data': { 'qcow': 'QCryptoBlockOptionsQCow', |
231 | 'luks': 'QCryptoBlockCreateOptionsLUKS' } } | |
40c85028 DB |
232 | |
233 | ||
234 | ## | |
c5927e7a | 235 | # @QCryptoBlockInfoBase: |
40c85028 DB |
236 | # |
237 | # The common information that applies to all full disk | |
238 | # encryption formats | |
239 | # | |
240 | # @format: the encryption format | |
241 | # | |
242 | # Since: 2.7 | |
243 | ## | |
244 | { 'struct': 'QCryptoBlockInfoBase', | |
245 | 'data': { 'format': 'QCryptoBlockFormat' }} | |
246 | ||
247 | ||
248 | ## | |
c5927e7a | 249 | # @QCryptoBlockInfoLUKSSlot: |
40c85028 DB |
250 | # |
251 | # Information about the LUKS block encryption key | |
252 | # slot options | |
253 | # | |
254 | # @active: whether the key slot is currently in use | |
255 | # @key-offset: offset to the key material in bytes | |
256 | # @iters: #optional number of PBKDF2 iterations for key material | |
257 | # @stripes: #optional number of stripes for splitting key material | |
258 | # | |
259 | # Since: 2.7 | |
260 | ## | |
261 | { 'struct': 'QCryptoBlockInfoLUKSSlot', | |
262 | 'data': {'active': 'bool', | |
263 | '*iters': 'int', | |
264 | '*stripes': 'int', | |
265 | 'key-offset': 'int' } } | |
266 | ||
267 | ||
268 | ## | |
c5927e7a | 269 | # @QCryptoBlockInfoLUKS: |
40c85028 DB |
270 | # |
271 | # Information about the LUKS block encryption options | |
272 | # | |
273 | # @cipher-alg: the cipher algorithm for data encryption | |
274 | # @cipher-mode: the cipher mode for data encryption | |
275 | # @ivgen-alg: the initialization vector generator | |
276 | # @ivgen-hash-alg: #optional the initialization vector generator hash | |
277 | # @hash-alg: the master key hash algorithm | |
278 | # @payload-offset: offset to the payload data in bytes | |
279 | # @master-key-iters: number of PBKDF2 iterations for key material | |
280 | # @uuid: unique identifier for the volume | |
281 | # @slots: information about each key slot | |
282 | # | |
283 | # Since: 2.7 | |
284 | ## | |
285 | { 'struct': 'QCryptoBlockInfoLUKS', | |
286 | 'data': {'cipher-alg': 'QCryptoCipherAlgorithm', | |
287 | 'cipher-mode': 'QCryptoCipherMode', | |
288 | 'ivgen-alg': 'QCryptoIVGenAlgorithm', | |
289 | '*ivgen-hash-alg': 'QCryptoHashAlgorithm', | |
290 | 'hash-alg': 'QCryptoHashAlgorithm', | |
291 | 'payload-offset': 'int', | |
292 | 'master-key-iters': 'int', | |
293 | 'uuid': 'str', | |
294 | 'slots': [ 'QCryptoBlockInfoLUKSSlot' ] }} | |
295 | ||
296 | ## | |
c5927e7a | 297 | # @QCryptoBlockInfoQCow: |
40c85028 DB |
298 | # |
299 | # Information about the QCow block encryption options | |
300 | # | |
301 | # Since: 2.7 | |
302 | ## | |
303 | { 'struct': 'QCryptoBlockInfoQCow', | |
304 | 'data': { }} | |
305 | ||
306 | ||
307 | ## | |
c5927e7a | 308 | # @QCryptoBlockInfo: |
40c85028 DB |
309 | # |
310 | # Information about the block encryption options | |
311 | # | |
312 | # Since: 2.7 | |
313 | ## | |
314 | { 'union': 'QCryptoBlockInfo', | |
315 | 'base': 'QCryptoBlockInfoBase', | |
316 | 'discriminator': 'format', | |
317 | 'data': { 'qcow': 'QCryptoBlockInfoQCow', | |
318 | 'luks': 'QCryptoBlockInfoLUKS' } } |