mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-26 04:07:45 +03:00
Encryption patch follow-up
* PBKDF2 implementation changed to OpenSSL implementation. * HKDF implementation moved to its own file and tests added to ensure correctness. * Removed libzfs's now unnecessary dependency on libzpool and libicp. * Ztest can now create and test encrypted datasets. This is currently disabled until issue #6526 is resolved, but otherwise functions as advertised. * Several small bug fixes discovered after enabling ztest to run on encrypted datasets. * Fixed coverity defects added by the encryption patch. * Updated man pages for encrypted send / receive behavior. * Fixed a bug where encrypted datasets could receive DRR_WRITE_EMBEDDED records. * Minor code cleanups / consolidation. Signed-off-by: Tom Caputi <tcaputi@datto.com>
This commit is contained in:
+11
-12
@@ -7267,28 +7267,27 @@ zfs_do_change_key(int argc, char **argv)
|
||||
keystatus = zfs_prop_get_int(zhp, ZFS_PROP_KEYSTATUS);
|
||||
if (keystatus != ZFS_KEYSTATUS_AVAILABLE) {
|
||||
ret = zfs_crypto_load_key(zhp, B_FALSE, NULL);
|
||||
if (ret != 0)
|
||||
goto error;
|
||||
if (ret != 0) {
|
||||
nvlist_free(props);
|
||||
zfs_close(zhp);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
/* refresh the properties so the new keystatus is visable */
|
||||
/* refresh the properties so the new keystatus is visible */
|
||||
zfs_refresh_properties(zhp);
|
||||
}
|
||||
|
||||
ret = zfs_crypto_rewrap(zhp, props, inheritkey);
|
||||
if (ret != 0)
|
||||
goto error;
|
||||
if (ret != 0) {
|
||||
nvlist_free(props);
|
||||
zfs_close(zhp);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
nvlist_free(props);
|
||||
zfs_close(zhp);
|
||||
return (0);
|
||||
|
||||
error:
|
||||
if (props != NULL)
|
||||
nvlist_free(props);
|
||||
if (zhp != NULL)
|
||||
zfs_close(zhp);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user