summaryrefslogtreecommitdiffstats
path: root/module/zfs/zio_crypt.c
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2018-05-02 18:36:20 -0400
committerBrian Behlendorf <[email protected]>2018-05-02 15:36:20 -0700
commitbe9a5c355c819ac0f2aca1f8c30dc75164e10322 (patch)
treede57c7d931764c3abfc94422c14311b12f83c5e3 /module/zfs/zio_crypt.c
parent9464b9591ea5cd61a4d6ef8e29c4597b48d16a77 (diff)
Add support for decryption faults in zinject
This patch adds the ability for zinject to trigger decryption and authentication faults in the ZIO and ARC layers. This functionality is exposed via the new "decrypt" error type, which may be provided for "data" object types. This patch also refactors some of the core encryption / decryption functions so that they have consistent prototypes, handle errors consistently, and do not have unused arguments. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tom Caputi <[email protected]> Closes #7474
Diffstat (limited to 'module/zfs/zio_crypt.c')
-rw-r--r--module/zfs/zio_crypt.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/module/zfs/zio_crypt.c b/module/zfs/zio_crypt.c
index d9e88404f..2e6176782 100644
--- a/module/zfs/zio_crypt.c
+++ b/module/zfs/zio_crypt.c
@@ -1860,9 +1860,9 @@ error:
* Primary encryption / decryption entrypoint for zio data.
*/
int
-zio_do_crypt_data(boolean_t encrypt, zio_crypt_key_t *key, uint8_t *salt,
- dmu_object_type_t ot, uint8_t *iv, uint8_t *mac, uint_t datalen,
- boolean_t byteswap, uint8_t *plainbuf, uint8_t *cipherbuf,
+zio_do_crypt_data(boolean_t encrypt, zio_crypt_key_t *key,
+ dmu_object_type_t ot, boolean_t byteswap, uint8_t *salt, uint8_t *iv,
+ uint8_t *mac, uint_t datalen, uint8_t *plainbuf, uint8_t *cipherbuf,
boolean_t *no_crypt)
{
int ret;
@@ -1984,9 +1984,9 @@ error:
* linear buffers.
*/
int
-zio_do_crypt_abd(boolean_t encrypt, zio_crypt_key_t *key, uint8_t *salt,
- dmu_object_type_t ot, uint8_t *iv, uint8_t *mac, uint_t datalen,
- boolean_t byteswap, abd_t *pabd, abd_t *cabd, boolean_t *no_crypt)
+zio_do_crypt_abd(boolean_t encrypt, zio_crypt_key_t *key, dmu_object_type_t ot,
+ boolean_t byteswap, uint8_t *salt, uint8_t *iv, uint8_t *mac,
+ uint_t datalen, abd_t *pabd, abd_t *cabd, boolean_t *no_crypt)
{
int ret;
void *ptmp, *ctmp;
@@ -1999,8 +1999,8 @@ zio_do_crypt_abd(boolean_t encrypt, zio_crypt_key_t *key, uint8_t *salt,
ctmp = abd_borrow_buf_copy(cabd, datalen);
}
- ret = zio_do_crypt_data(encrypt, key, salt, ot, iv, mac,
- datalen, byteswap, ptmp, ctmp, no_crypt);
+ ret = zio_do_crypt_data(encrypt, key, ot, byteswap, salt, iv, mac,
+ datalen, ptmp, ctmp, no_crypt);
if (ret != 0)
goto error;