On Thu, Mar 24, 2016 at 11:06:21AM +0800, Wen Congyang wrote: > On 03/18/2016 12:53 AM, Daniel P. Berrange wrote: > > The LUKS data format includes use of PBKDF2 (Password-Based > > Key Derivation Function). The Nettle library can provide > > an implementation of this, but we don't want code directly > > depending on a specific crypto library backend. Introduce > > a new include/crypto/pbkdf.h header which defines a QEMU > > API for invoking PBKDK2. The initial implementations are > > backed by nettle & gcrypt, which are commonly available > > with distros shipping GNUTLS. > > > > The test suite data is taken from the cryptsetup codebase > > under the LGPLv2.1+ license. This merely aims to verify > > that whatever backend we provide for this function in QEMU > > will comply with the spec. > > > > Reviewed-by: Fam Zheng <f...@redhat.com> > > Reviewed-by: Eric Blake <ebl...@redhat.com> > > Signed-off-by: Daniel P. Berrange <berra...@redhat.com>
> > I get the following building error: > > CC crypto/pbkdf.o > CC crypto/pbkdf-nettle.o > CC crypto/ivgen.o > crypto/pbkdf-nettle.c:23:27: error: nettle/pbkdf2.h: No such file or directory > crypto/pbkdf-nettle.c: In function ‘qcrypto_pbkdf2’: > crypto/pbkdf-nettle.c:46: warning: implicit declaration of function > ‘pbkdf2_hmac_sha1’ > crypto/pbkdf-nettle.c:46: warning: nested extern declaration of > ‘pbkdf2_hmac_sha1’ > crypto/pbkdf-nettle.c:53: warning: implicit declaration of function > ‘pbkdf2_hmac_sha256’ > crypto/pbkdf-nettle.c:53: warning: nested extern declaration of > ‘pbkdf2_hmac_sha256’ > make: *** [crypto/pbkdf-nettle.o] Error 1 > make: *** Waiting for unfinished jobs.... > > rpm -qf /usr/include/nettle/ > libnettle-devel-2.4-8.1.2 > > The nettle version is very old...... > The OS is SUSE 11 SP3. Ok, I work on a patch to make this conditional on nettle version. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|