Received: from eggs.gnu.org ([2001:4830:134:3::10]:60468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi3a2-0006GN-As for qemu-devel@nongnu.org; Thu, 08 Sep 2016 13:57:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bi3a0-0003Oz-80 for qemu-devel@nongnu.org; Thu, 08 Sep 2016 13:57:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi3Zz-0003Ou-VQ for qemu-devel@nongnu.org; Thu, 08 Sep 2016 13:57:40 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7FA71800AF for ; Thu, 8 Sep 2016 17:57:39 +0000 (UTC) References: <1473352047-908-1-git-send-email-berrange@redhat.com> <1473352047-908-7-git-send-email-berrange@redhat.com> From: Eric Blake Message-ID: Date: Thu, 8 Sep 2016 12:57:38 -0500 MIME-Version: 1.0 In-Reply-To: <1473352047-908-7-git-send-email-berrange@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QuK6rxTltGxiWpfNPmEDP0iEo2snPfue9" Subject: Re: [Qemu-devel] [PATCH 6/6] crypto: support more hash algorithms for pbkdf List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QuK6rxTltGxiWpfNPmEDP0iEo2snPfue9 From: Eric Blake To: "Daniel P. Berrange" , qemu-devel@nongnu.org Message-ID: Subject: Re: [PATCH 6/6] crypto: support more hash algorithms for pbkdf References: <1473352047-908-1-git-send-email-berrange@redhat.com> <1473352047-908-7-git-send-email-berrange@redhat.com> In-Reply-To: <1473352047-908-7-git-send-email-berrange@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Daniel P. Berrange > --- > crypto/pbkdf-gcrypt.c | 12 +++++++++- > crypto/pbkdf-nettle.c | 61 +++++++++++++++++++++++++++++++++++++++= +------- > tests/test-crypto-pbkdf.c | 53 +++++++++++++++++++++++++++++++++++++++= - > 3 files changed, 115 insertions(+), 11 deletions(-) >=20 > =20 > if (hash >=3D G_N_ELEMENTS(hash_map) || > hash_map[hash] =3D=3D 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 > =20 > default: > error_setg_errno(errp, ENOSYS, > - "PBKDF does not support hash algorithm %d", h= ash); > + "PBKDF does not support hash algorithm %s", > + QCryptoHashAlgorithm_lookup[hash]); and again --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --QuK6rxTltGxiWpfNPmEDP0iEo2snPfue9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJX0aaSAAoJEKeha0olJ0Nq9koIAKUbywnMW9AJjIRZZTbCaUZa L1GjxCgjemf70NTyYtleerejJy2cz+a7JoGJZIrAI8dmMNJtaN6Pdk8utuylYJp/ j3mLlYQHWx6PyHzyExhEHe1zI/tQee7Q5IaOS/mAHrGDWAmbXzool5dlxScLSP0z oiR+KWs2AxVBT1OgfrwYS/WsgHBmIF1YsodrFpodDdM6RBDmu90sg2bubArAMtJR GWyXq1YUNIUKYBnpxLR3meHpe5/9ublMAnTuIamjN8on907QpklwJF8I42gYik/e A0q3HuZ9UXAXvZYBEGwEWysroUveWT+Y3PgqzI9xPRNbD5j8j23O28LEiMiLYl4= =YPeE -----END PGP SIGNATURE----- --QuK6rxTltGxiWpfNPmEDP0iEo2snPfue9--