Commit graph

2 commits

Author SHA1 Message Date
Daniel P. Berrange 7603289712 crypto: don't open-code qcrypto_hash_supports
Call the existing qcrypto_hash_supports method from
qcrypto_hash_bytesv instead of open-coding it again.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-07-21 10:46:27 +01:00
Daniel P. Berrange 2165477c0f crypto: use glib as fallback for hash algorithm
GLib >= 2.16 provides GChecksum API which is good enough
for md5, sha1, sha256 and sha512. Use this as a final
fallback if neither nettle or gcrypt are available. This
lets us remove the stub hash impl, and so callers can
be sure those 4 algs are always available at compile
time. They may still be disabled at runtime, so a check
for qcrypto_hash_supports() is still best practice to
report good error messages.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-07-21 10:46:27 +01:00