From 4807c0badb130ae70cf6f0887b4be1648f217f1a Mon Sep 17 00:00:00 2001 From: Tom Caputi Date: Tue, 12 Sep 2017 16:15:11 -0400 Subject: 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 --- cmd/zfs/zfs_main.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'cmd/zfs/zfs_main.c') diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index ef131f9b5..b9b53f22b 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -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 -- cgit v1.2.3