From 9b4cbf96fb1c222fc7a3f0ff4bd6591df861feb2 Mon Sep 17 00:00:00 2001 From: Turbo Fredriksson Date: Mon, 29 Apr 2013 21:01:47 +0200 Subject: [PATCH] If keyformat == raw, we need to duplicate the value into tmpkeydata and tmpkeydatalen so that the tripple check at the bottom of key_hdl_to_zc() works. Fixes https://github.com/zfsrogue/zfs-crypto/issues/23. --- lib/libzfs/libzfs_crypto.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libzfs/libzfs_crypto.c b/lib/libzfs/libzfs_crypto.c index 1477d9246..351daabdd 100644 --- a/lib/libzfs/libzfs_crypto.c +++ b/lib/libzfs/libzfs_crypto.c @@ -821,6 +821,9 @@ key_hdl_to_zc(libzfs_handle_t *hdl, zfs_handle_t *zhp, char *keysource, bcopy(keydata, zc->zc_crypto.zic_keydata, keydatalen); zc->zc_crypto.zic_keydatalen = keydatalen; zc->zc_crypto.zic_salt = 0; + + tmpkeydata = strdup(keydata); + tmpkeydatalen = keydatalen; break; case KEY_FORMAT_HEX: /*