freebsd-dev/contrib/pyzfs/libzfs_core
Rob N b988f32c70
Better handling for future crypto parameters
The intent is that this is like ENOTSUP, but specifically for when
something can't be done because we have no support for the requested
crypto parameters; eg unlocking a dataset or receiving a stream
encrypted with a suite we don't support.

Its not intended to be recoverable without upgrading ZFS itself.
If the request could be made to work by enabling a feature or modifying
some other configuration item, then some other code should be used.

load-key: In the future we might have more crypto suites (ie new values
for the `encryption` property. Right now trying to load a key on such
a future crypto suite will look up suite parameters off the end of the
crypto table, resulting in misbehaviour and/or crashes (or, with debug
enabled, trip the assertion in `zio_crypt_key_unwrap`).

Instead, lets check the value we got from the dataset, and if we can't
handle it, abort early.

recv: When receiving a raw stream encrypted with an unknown crypto
suite, `zfs recv` would report a generic `invalid backup stream`
(EINVAL). While technically correct, its not super helpful, so lets
ship a more specific error code and message.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #14577
2023-03-07 14:05:14 -08:00
..
bindings Implement a new type of zfs receive: corrective receive (-c) 2022-07-28 15:52:46 -07:00
test Implement a new type of zfs receive: corrective receive (-c) 2022-07-28 15:52:46 -07:00
__init__.py Implement a new type of zfs receive: corrective receive (-c) 2022-07-28 15:52:46 -07:00
_constants.py Better handling for future crypto parameters 2023-03-07 14:05:14 -08:00
_error_translation.py Implement a new type of zfs receive: corrective receive (-c) 2022-07-28 15:52:46 -07:00
_libzfs_core.py Implement a new type of zfs receive: corrective receive (-c) 2022-07-28 15:52:46 -07:00
_nvlist.py Fix typos in contrib/ 2019-08-30 09:44:43 -07:00
ctypes.py pyzfs: python3 support (library 2/2) 2019-01-06 10:39:41 -08:00
exceptions.py Fix cstyle warnings 2020-03-17 15:42:27 -07:00