Skip to content

Commit

Permalink
If keyformat == raw, we need to duplicate the value
Browse files Browse the repository at this point in the history
into tmpkeydata and tmpkeydatalen so that the tripple check
at the bottom of key_hdl_to_zc() works.
Fixes zfsrogue#23.
  • Loading branch information
FransUrbo committed Apr 29, 2013
1 parent 9a920be commit 9b4cbf9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/libzfs/libzfs_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
/*
Expand Down

0 comments on commit 9b4cbf9

Please sign in to comment.