freebsd-dev/contrib
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
..
bash_completion.d Ubuntu 22.04 integration: ShellCheck 2022-11-18 11:24:48 -08:00
bpftrace Replace EXTRA_DIST with dist_noinst_DATA 2022-05-26 09:24:50 -07:00
coverity Coverity Model Update 2022-11-29 10:00:56 -08:00
debian Fix github build failures because of vdevprops.7 2023-02-28 14:02:48 -08:00
dracut contrib: dracut: Do not timeout waiting for pw 2023-01-05 12:07:43 -08:00
initramfs initramfs: fix zpool get argument order 2023-03-06 17:07:01 -08:00
intel_qat Add intel_QAT patches 2020-09-30 13:17:30 -07:00
pam_zfs_key zfs list: Allow more fields in ZFS_ITER_SIMPLE mode 2022-12-13 17:27:54 -08:00
pyzfs Better handling for future crypto parameters 2023-03-07 14:05:14 -08:00
zcp Replace EXTRA_DIST with dist_noinst_DATA 2022-05-26 09:24:50 -07:00
Makefile.am autoconf: use include directives instead of recursing down contrib 2022-05-10 10:19:44 -07:00