10 # @QCryptoTLSCredsEndpoint:
12 # The type of network endpoint that will be using the credentials.
13 # Most types of credential require different setup / structures
14 # depending on whether they will be used in a server versus a
17 # @client: the network endpoint is acting as the client
19 # @server: the network endpoint is acting as the server
23 { 'enum': 'QCryptoTLSCredsEndpoint',
24 'prefix': 'QCRYPTO_TLS_CREDS_ENDPOINT',
25 'data': ['client', 'server']}
28 # @QCryptoSecretFormat:
30 # The data format that the secret is provided in
32 # @raw: raw bytes. When encoded in JSON only valid UTF-8 sequences can be used
33 # @base64: arbitrary base64 encoded binary data
37 { 'enum': 'QCryptoSecretFormat',
38 'prefix': 'QCRYPTO_SECRET_FORMAT',
39 'data': ['raw', 'base64']}
42 # @QCryptoHashAlgorithm:
44 # The supported algorithms for computing content digests
46 # @md5: MD5. Should not be used in any new code, legacy compat only
47 # @sha1: SHA-1. Should not be used in any new code, legacy compat only
48 # @sha224: SHA-224. (since 2.7)
49 # @sha256: SHA-256. Current recommended strong hash.
50 # @sha384: SHA-384. (since 2.7)
51 # @sha512: SHA-512. (since 2.7)
52 # @ripemd160: RIPEMD-160. (since 2.7)
56 { 'enum': 'QCryptoHashAlgorithm',
57 'prefix': 'QCRYPTO_HASH_ALG',
58 'data': ['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'ripemd160']}
61 # @QCryptoCipherAlgorithm:
63 # The supported algorithms for content encryption ciphers
65 # @aes-128: AES with 128 bit / 16 byte keys
66 # @aes-192: AES with 192 bit / 24 byte keys
67 # @aes-256: AES with 256 bit / 32 byte keys
68 # @des: DES with 56 bit / 8 byte keys. Do not use except in VNC. (since 6.1)
69 # @3des: 3DES(EDE) with 192 bit / 24 byte keys (since 2.9)
70 # @cast5-128: Cast5 with 128 bit / 16 byte keys
71 # @serpent-128: Serpent with 128 bit / 16 byte keys
72 # @serpent-192: Serpent with 192 bit / 24 byte keys
73 # @serpent-256: Serpent with 256 bit / 32 byte keys
74 # @twofish-128: Twofish with 128 bit / 16 byte keys
75 # @twofish-192: Twofish with 192 bit / 24 byte keys
76 # @twofish-256: Twofish with 256 bit / 32 byte keys
80 { 'enum': 'QCryptoCipherAlgorithm',
81 'prefix': 'QCRYPTO_CIPHER_ALG',
82 'data': ['aes-128', 'aes-192', 'aes-256',
85 'serpent-128', 'serpent-192', 'serpent-256',
86 'twofish-128', 'twofish-192', 'twofish-256']}
91 # The supported modes for content encryption ciphers
93 # @ecb: Electronic Code Book
94 # @cbc: Cipher Block Chaining
95 # @xts: XEX with tweaked code book and ciphertext stealing
96 # @ctr: Counter (Since 2.8)
100 { 'enum': 'QCryptoCipherMode',
101 'prefix': 'QCRYPTO_CIPHER_MODE',
102 'data': ['ecb', 'cbc', 'xts', 'ctr']}
105 # @QCryptoIVGenAlgorithm:
107 # The supported algorithms for generating initialization
108 # vectors for full disk encryption. The 'plain' generator
109 # should not be used for disks with sector numbers larger
110 # than 2^32, except where compatibility with pre-existing
111 # Linux dm-crypt volumes is required.
113 # @plain: 64-bit sector number truncated to 32-bits
114 # @plain64: 64-bit sector number
115 # @essiv: 64-bit sector number encrypted with a hash of the encryption key
119 { 'enum': 'QCryptoIVGenAlgorithm',
120 'prefix': 'QCRYPTO_IVGEN_ALG',
121 'data': ['plain', 'plain64', 'essiv']}
124 # @QCryptoBlockFormat:
126 # The supported full disk encryption formats
128 # @qcow: QCow/QCow2 built-in AES-CBC encryption. Use only
129 # for liberating data from old images.
130 # @luks: LUKS encryption format. Recommended for new images
134 { 'enum': 'QCryptoBlockFormat',
135 # 'prefix': 'QCRYPTO_BLOCK_FORMAT',
136 'data': ['qcow', 'luks']}
139 # @QCryptoBlockOptionsBase:
141 # The common options that apply to all full disk
144 # @format: the encryption format
148 { 'struct': 'QCryptoBlockOptionsBase',
149 'data': { 'format': 'QCryptoBlockFormat' }}
152 # @QCryptoBlockOptionsQCow:
154 # The options that apply to QCow/QCow2 AES-CBC encryption format
156 # @key-secret: the ID of a QCryptoSecret object providing the
157 # decryption key. Mandatory except when probing image for
162 { 'struct': 'QCryptoBlockOptionsQCow',
163 'data': { '*key-secret': 'str' }}
166 # @QCryptoBlockOptionsLUKS:
168 # The options that apply to LUKS encryption format
170 # @key-secret: the ID of a QCryptoSecret object providing the
171 # decryption key. Mandatory except when probing image for
176 { 'struct': 'QCryptoBlockOptionsLUKS',
177 'data': { '*key-secret': 'str' }}
180 # @QCryptoBlockCreateOptionsLUKS:
182 # The options that apply to LUKS encryption format initialization
184 # @cipher-alg: the cipher algorithm for data encryption
185 # Currently defaults to 'aes-256'.
186 # @cipher-mode: the cipher mode for data encryption
187 # Currently defaults to 'xts'
188 # @ivgen-alg: the initialization vector generator
189 # Currently defaults to 'plain64'
190 # @ivgen-hash-alg: the initialization vector generator hash
191 # Currently defaults to 'sha256'
192 # @hash-alg: the master key hash algorithm
193 # Currently defaults to 'sha256'
194 # @iter-time: number of milliseconds to spend in
195 # PBKDF passphrase processing. Currently defaults
196 # to 2000. (since 2.8)
200 { 'struct': 'QCryptoBlockCreateOptionsLUKS',
201 'base': 'QCryptoBlockOptionsLUKS',
202 'data': { '*cipher-alg': 'QCryptoCipherAlgorithm',
203 '*cipher-mode': 'QCryptoCipherMode',
204 '*ivgen-alg': 'QCryptoIVGenAlgorithm',
205 '*ivgen-hash-alg': 'QCryptoHashAlgorithm',
206 '*hash-alg': 'QCryptoHashAlgorithm',
207 '*iter-time': 'int'}}
210 # @QCryptoBlockOpenOptions:
212 # The options that are available for all encryption formats
213 # when opening an existing volume
217 { 'union': 'QCryptoBlockOpenOptions',
218 'base': 'QCryptoBlockOptionsBase',
219 'discriminator': 'format',
220 'data': { 'qcow': 'QCryptoBlockOptionsQCow',
221 'luks': 'QCryptoBlockOptionsLUKS' } }
224 # @QCryptoBlockCreateOptions:
226 # The options that are available for all encryption formats
227 # when initializing a new volume
231 { 'union': 'QCryptoBlockCreateOptions',
232 'base': 'QCryptoBlockOptionsBase',
233 'discriminator': 'format',
234 'data': { 'qcow': 'QCryptoBlockOptionsQCow',
235 'luks': 'QCryptoBlockCreateOptionsLUKS' } }
238 # @QCryptoBlockInfoBase:
240 # The common information that applies to all full disk
243 # @format: the encryption format
247 { 'struct': 'QCryptoBlockInfoBase',
248 'data': { 'format': 'QCryptoBlockFormat' }}
251 # @QCryptoBlockInfoLUKSSlot:
253 # Information about the LUKS block encryption key
256 # @active: whether the key slot is currently in use
257 # @key-offset: offset to the key material in bytes
258 # @iters: number of PBKDF2 iterations for key material
259 # @stripes: number of stripes for splitting key material
263 { 'struct': 'QCryptoBlockInfoLUKSSlot',
264 'data': {'active': 'bool',
267 'key-offset': 'int' } }
270 # @QCryptoBlockInfoLUKS:
272 # Information about the LUKS block encryption options
274 # @cipher-alg: the cipher algorithm for data encryption
275 # @cipher-mode: the cipher mode for data encryption
276 # @ivgen-alg: the initialization vector generator
277 # @ivgen-hash-alg: the initialization vector generator hash
278 # @hash-alg: the master key hash algorithm
279 # @payload-offset: offset to the payload data in bytes
280 # @master-key-iters: number of PBKDF2 iterations for key material
281 # @uuid: unique identifier for the volume
282 # @slots: information about each key slot
286 { 'struct': 'QCryptoBlockInfoLUKS',
287 'data': {'cipher-alg': 'QCryptoCipherAlgorithm',
288 'cipher-mode': 'QCryptoCipherMode',
289 'ivgen-alg': 'QCryptoIVGenAlgorithm',
290 '*ivgen-hash-alg': 'QCryptoHashAlgorithm',
291 'hash-alg': 'QCryptoHashAlgorithm',
292 'payload-offset': 'int',
293 'master-key-iters': 'int',
295 'slots': [ 'QCryptoBlockInfoLUKSSlot' ] }}
300 # Information about the block encryption options
304 { 'union': 'QCryptoBlockInfo',
305 'base': 'QCryptoBlockInfoBase',
306 'discriminator': 'format',
307 'data': { 'luks': 'QCryptoBlockInfoLUKS' } }
310 # @QCryptoBlockLUKSKeyslotState:
312 # Defines state of keyslots that are affected by the update
314 # @active: The slots contain the given password and marked as active
315 # @inactive: The slots are erased (contain garbage) and marked as inactive
319 { 'enum': 'QCryptoBlockLUKSKeyslotState',
320 'data': [ 'active', 'inactive' ] }
323 # @QCryptoBlockAmendOptionsLUKS:
325 # This struct defines the update parameters that activate/de-activate set
328 # @state: the desired state of the keyslots
330 # @new-secret: The ID of a QCryptoSecret object providing the password to be
331 # written into added active keyslots
333 # @old-secret: Optional (for deactivation only)
334 # If given will deactivate all keyslots that
335 # match password located in QCryptoSecret with this ID
337 # @iter-time: Optional (for activation only)
338 # Number of milliseconds to spend in
339 # PBKDF passphrase processing for the newly activated keyslot.
340 # Currently defaults to 2000.
342 # @keyslot: Optional. ID of the keyslot to activate/deactivate.
343 # For keyslot activation, keyslot should not be active already
344 # (this is unsafe to update an active keyslot),
345 # but possible if 'force' parameter is given.
346 # If keyslot is not given, first free keyslot will be written.
348 # For keyslot deactivation, this parameter specifies the exact
349 # keyslot to deactivate
351 # @secret: Optional. The ID of a QCryptoSecret object providing the
352 # password to use to retrieve current master key.
353 # Defaults to the same secret that was used to open the image
357 { 'struct': 'QCryptoBlockAmendOptionsLUKS',
358 'data': { 'state': 'QCryptoBlockLUKSKeyslotState',
359 '*new-secret': 'str',
360 '*old-secret': 'str',
366 # @QCryptoBlockAmendOptions:
368 # The options that are available for all encryption formats
369 # when amending encryption settings
373 { 'union': 'QCryptoBlockAmendOptions',
374 'base': 'QCryptoBlockOptionsBase',
375 'discriminator': 'format',
377 'luks': 'QCryptoBlockAmendOptionsLUKS' } }
380 # @SecretCommonProperties:
382 # Properties for objects of classes derived from secret-common.
384 # @loaded: if true, the secret is loaded immediately when applying this option
385 # and will probably fail when processing the next option. Don't use;
386 # only provided for compatibility. (default: false)
388 # @format: the data format that the secret is provided in (default: raw)
390 # @keyid: the name of another secret that should be used to decrypt the
391 # provided data. If not present, the data is assumed to be unencrypted.
393 # @iv: the random initialization vector used for encryption of this particular
394 # secret. Should be a base64 encrypted string of the 16-byte IV. Mandatory
395 # if @keyid is given. Ignored if @keyid is absent.
398 # @deprecated: Member @loaded is deprecated. Setting true doesn't make sense,
399 # and false is already the default.
403 { 'struct': 'SecretCommonProperties',
404 'data': { '*loaded': { 'type': 'bool', 'features': ['deprecated'] },
405 '*format': 'QCryptoSecretFormat',
412 # Properties for secret objects.
414 # Either @data or @file must be provided, but not both.
416 # @data: the associated with the secret from
418 # @file: the filename to load the data associated with the secret from
422 { 'struct': 'SecretProperties',
423 'base': 'SecretCommonProperties',
424 'data': { '*data': 'str',
428 # @SecretKeyringProperties:
430 # Properties for secret_keyring objects.
432 # @serial: serial number that identifies a key to get from the kernel
436 { 'struct': 'SecretKeyringProperties',
437 'base': 'SecretCommonProperties',
438 'data': { 'serial': 'int32' } }
441 # @TlsCredsProperties:
443 # Properties for objects of classes derived from tls-creds.
445 # @verify-peer: if true the peer credentials will be verified once the
446 # handshake is completed. This is a no-op for anonymous
447 # credentials. (default: true)
449 # @dir: the path of the directory that contains the credential files
451 # @endpoint: whether the QEMU network backend that uses the credentials will be
452 # acting as a client or as a server (default: client)
454 # @priority: a gnutls priority string as described at
455 # https://gnutls.org/manual/html_node/Priority-Strings.html
459 { 'struct': 'TlsCredsProperties',
460 'data': { '*verify-peer': 'bool',
462 '*endpoint': 'QCryptoTLSCredsEndpoint',
463 '*priority': 'str' } }
466 # @TlsCredsAnonProperties:
468 # Properties for tls-creds-anon objects.
470 # @loaded: if true, the credentials are loaded immediately when applying this
471 # option and will ignore options that are processed later. Don't use;
472 # only provided for compatibility. (default: false)
475 # @deprecated: Member @loaded is deprecated. Setting true doesn't make sense,
476 # and false is already the default.
480 { 'struct': 'TlsCredsAnonProperties',
481 'base': 'TlsCredsProperties',
482 'data': { '*loaded': { 'type': 'bool', 'features': ['deprecated'] } } }
485 # @TlsCredsPskProperties:
487 # Properties for tls-creds-psk objects.
489 # @loaded: if true, the credentials are loaded immediately when applying this
490 # option and will ignore options that are processed later. Don't use;
491 # only provided for compatibility. (default: false)
493 # @username: the username which will be sent to the server. For clients only.
494 # If absent, "qemu" is sent and the property will read back as an
498 # @deprecated: Member @loaded is deprecated. Setting true doesn't make sense,
499 # and false is already the default.
503 { 'struct': 'TlsCredsPskProperties',
504 'base': 'TlsCredsProperties',
505 'data': { '*loaded': { 'type': 'bool', 'features': ['deprecated'] },
506 '*username': 'str' } }
509 # @TlsCredsX509Properties:
511 # Properties for tls-creds-x509 objects.
513 # @loaded: if true, the credentials are loaded immediately when applying this
514 # option and will ignore options that are processed later. Don't use;
515 # only provided for compatibility. (default: false)
517 # @sanity-check: if true, perform some sanity checks before using the
518 # credentials (default: true)
520 # @passwordid: For the server-key.pem and client-key.pem files which contain
521 # sensitive private keys, it is possible to use an encrypted
522 # version by providing the @passwordid parameter. This provides
523 # the ID of a previously created secret object containing the
524 # password for decryption.
527 # @deprecated: Member @loaded is deprecated. Setting true doesn't make sense,
528 # and false is already the default.
532 { 'struct': 'TlsCredsX509Properties',
533 'base': 'TlsCredsProperties',
534 'data': { '*loaded': { 'type': 'bool', 'features': ['deprecated'] },
535 '*sanity-check': 'bool',
536 '*passwordid': 'str' } }