[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/6] crypto: support more hash algorithms for pb
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 6/6] crypto: support more hash algorithms for pbkdf |
Date: |
Thu, 8 Sep 2016 12:57:38 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 09/08/2016 11:27 AM, Daniel P. Berrange wrote:
> Currently pbkdf is only supported with SHA1 and SHA256. Expand
> this to support all algorithms known to QEMU.
>
> Signed-off-by: Daniel P. Berrange <address@hidden>
> ---
> crypto/pbkdf-gcrypt.c | 12 +++++++++-
> crypto/pbkdf-nettle.c | 61
> ++++++++++++++++++++++++++++++++++++++++-------
> tests/test-crypto-pbkdf.c | 53 +++++++++++++++++++++++++++++++++++++++-
> 3 files changed, 115 insertions(+), 11 deletions(-)
>
>
> if (hash >= G_N_ELEMENTS(hash_map) ||
> hash_map[hash] == GCRY_MD_NONE) {
> - error_setg(errp, "Unexpected hash algorithm %d", hash);
> + error_setg_errno(errp, ENOSYS,
> + "PBKDF does not support hash algorithm %s",
> + QCryptoHashAlgorithm_lookup[hash]);
Can this access beyond bounds if hash > G_N_ELEMENTS(hash_map)?
> +++ b/crypto/pbkdf-nettle.c
>
> default:
> error_setg_errno(errp, ENOSYS,
> - "PBKDF does not support hash algorithm %d", hash);
> + "PBKDF does not support hash algorithm %s",
> + QCryptoHashAlgorithm_lookup[hash]);
and again
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 0/6] crypto: misc tweaks & improvements to pbkdf code, Daniel P. Berrange, 2016/09/08
- [Qemu-devel] [PATCH 2/6] crypto: clear out buffer after timing pbkdf algorithm, Daniel P. Berrange, 2016/09/08
- [Qemu-devel] [PATCH 1/6] crypto: make PBKDF iterations configurable for LUKS format, Daniel P. Berrange, 2016/09/08
- [Qemu-devel] [PATCH 3/6] crypto: use correct derived key size when timing pbkdf, Daniel P. Berrange, 2016/09/08
- [Qemu-devel] [PATCH 6/6] crypto: support more hash algorithms for pbkdf, Daniel P. Berrange, 2016/09/08
- Re: [Qemu-devel] [PATCH 6/6] crypto: support more hash algorithms for pbkdf,
Eric Blake <=
- [Qemu-devel] [PATCH 4/6] crypto: remove bogus /= 2 for pbkdf iterations, Daniel P. Berrange, 2016/09/08
- [Qemu-devel] [PATCH 5/6] crypto: increase default pbkdf2 time for luks to 2 seconds, Daniel P. Berrange, 2016/09/08
- Re: [Qemu-devel] [PATCH 0/6] crypto: misc tweaks & improvements to pbkdf code, no-reply, 2016/09/08