* grub-core/fs/zfs/zfscrypt.c (grub_ccm_decrypt): Return right error
type. (grub_gcm_decrypt): Likewise. (algo_decrypt): Likewise. (grub_zfs_decrypt_real): Transform error type.
This commit is contained in:
parent
5d17fd0fec
commit
8b66bb5d8d
2 changed files with 17 additions and 8 deletions
|
@ -1,3 +1,11 @@
|
|||
2013-11-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/fs/zfs/zfscrypt.c (grub_ccm_decrypt): Return right error
|
||||
type.
|
||||
(grub_gcm_decrypt): Likewise.
|
||||
(algo_decrypt): Likewise.
|
||||
(grub_zfs_decrypt_real): Transform error type.
|
||||
|
||||
2013-11-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/geli.c (geli_rekey): Fix error return type.
|
||||
|
|
|
@ -143,7 +143,7 @@ grub_ccm_decrypt (grub_crypto_cipher_handle_t cipher,
|
|||
return err;
|
||||
if (mac_out)
|
||||
grub_crypto_xor (mac_out, mac, mul, m);
|
||||
return GRUB_ERR_NONE;
|
||||
return GPG_ERR_NO_ERROR;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -244,7 +244,7 @@ grub_gcm_decrypt (grub_crypto_cipher_handle_t cipher,
|
|||
if (mac_out)
|
||||
grub_crypto_xor (mac_out, mac, mac_xor, m);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
return GPG_ERR_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
|
@ -258,13 +258,14 @@ algo_decrypt (grub_crypto_cipher_handle_t cipher, grub_uint64_t algo,
|
|||
switch (algo)
|
||||
{
|
||||
case 0:
|
||||
return grub_ccm_decrypt (cipher, out, in, psize, mac_out, nonce, l, m);
|
||||
return grub_ccm_decrypt (cipher, out, in, psize,
|
||||
mac_out, nonce, l, m);
|
||||
case 1:
|
||||
return grub_gcm_decrypt (cipher, out, in, psize, mac_out, nonce,
|
||||
return grub_gcm_decrypt (cipher, out, in, psize,
|
||||
mac_out, nonce,
|
||||
15 - l, m);
|
||||
default:
|
||||
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "algorithm %lld is not supported yet",
|
||||
(long long) algo);
|
||||
return GPG_ERR_CIPHER_ALGO;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -279,7 +280,7 @@ grub_zfs_decrypt_real (grub_crypto_cipher_handle_t cipher,
|
|||
grub_uint32_t mac[4];
|
||||
unsigned i;
|
||||
grub_uint32_t sw[4];
|
||||
grub_err_t err;
|
||||
gcry_err_code_t err;
|
||||
|
||||
grub_memcpy (sw, nonce, 16);
|
||||
if (endian != GRUB_ZFS_BIG_ENDIAN)
|
||||
|
@ -295,7 +296,7 @@ grub_zfs_decrypt_real (grub_crypto_cipher_handle_t cipher,
|
|||
size, mac,
|
||||
sw + 1, 3, 12);
|
||||
if (err)
|
||||
return err;
|
||||
return grub_crypto_gcry_error (err);
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
if (grub_zfs_to_cpu32 (expected_mac[i], endian)
|
||||
|
|
Loading…
Reference in a new issue