From: "Daniel P. Berrange" <berrange@redhat.com>
To: "Longpeng(Mike)" <longpeng2@huawei.com>
Cc: wu.wubin@huawei.com, jianjay.zhou@huawei.com,
arei.gonglei@huawei.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.9 v3 4/6] crypto: support HMAC algorithms based on glibc
Date: Tue, 13 Dec 2016 09:34:31 +0000 [thread overview]
Message-ID: <20161213093431.GD12730@redhat.com> (raw)
In-Reply-To: <1481612513-28556-5-git-send-email-longpeng2@huawei.com>
On Tue, Dec 13, 2016 at 03:01:51PM +0800, Longpeng(Mike) wrote:
> This patch add glibc-backed HMAC algorithms support
s/glibc/glib/ and also in $SUBJECT
> diff --git a/crypto/hmac-glib.c b/crypto/hmac-glib.c
> index 3e2a933..f07c841 100644
> --- a/crypto/hmac-glib.c
> +++ b/crypto/hmac-glib.c
> @@ -16,8 +16,40 @@
> #include "qapi/error.h"
> #include "crypto/hmac.h"
>
> +static int qcrypto_hmac_alg_map[QCRYPTO_HASH_ALG__MAX] = {
> +/* Support for HMAC Algos has been added in GLib 2.30 */
> +#if GLIB_CHECK_VERSION(2, 30, 0)
> + [QCRYPTO_HASH_ALG_MD5] = G_CHECKSUM_MD5,
> + [QCRYPTO_HASH_ALG_SHA1] = G_CHECKSUM_SHA1,
> + [QCRYPTO_HASH_ALG_SHA256] = G_CHECKSUM_SHA256,
> +#else
> + [QCRYPTO_HASH_ALG_MD5] = -1,
> + [QCRYPTO_HASH_ALG_SHA1] = -1,
> + [QCRYPTO_HASH_ALG_SHA256] = -1,
> +#endif
> +/* Support for HMAC SHA-512 in GLib 2.42 */
> +#if GLIB_CHECK_VERSION(2, 42, 0)
> + [QCRYPTO_HASH_ALG_SHA512] = G_CHECKSUM_SHA512,
> +#else
> + [QCRYPTO_HASH_ALG_SHA512] = -1,
> +#endif
> + [QCRYPTO_HASH_ALG_SHA224] = -1,
> + [QCRYPTO_HASH_ALG_SHA384] = -1,
> + [QCRYPTO_HASH_ALG_RIPEMD160] = -1,
> +};
As mentioned in reply to the build failure - the 2.30.0 check
will have to surround the entire file...
> +
> +typedef struct QCryptoHmacGlib QCryptoHmacGlib;
> +struct QCryptoHmacGlib {
> + GHmac *ghmac;
...otherwise this triggers failure due to missing typedefs.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
next prev parent reply other threads:[~2016-12-13 9:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-13 7:01 [Qemu-devel] [PATCH for-2.9 v3 0/6] crypto: add HMAC algorithms support Longpeng(Mike)
2016-12-13 7:01 ` [Qemu-devel] [PATCH for-2.9 v3 1/6] configure: add CONFIG_GCRYPT_HMAC item Longpeng(Mike)
2016-12-13 7:01 ` [Qemu-devel] [PATCH for-2.9 v3 2/6] crypto: add HMAC algorithms framework Longpeng(Mike)
2016-12-13 7:01 ` [Qemu-devel] [PATCH for-2.9 v3 3/6] crypto: support HMAC algorithms based on libgcrypt Longpeng(Mike)
2016-12-13 7:01 ` [Qemu-devel] [PATCH for-2.9 v3 4/6] crypto: support HMAC algorithms based on glibc Longpeng(Mike)
2016-12-13 9:34 ` Daniel P. Berrange [this message]
2016-12-13 7:01 ` [Qemu-devel] [PATCH for-2.9 v3 5/6] crypto: support HMAC algorithms based on nettle Longpeng(Mike)
2016-12-13 7:01 ` [Qemu-devel] [PATCH for-2.9 v3 6/6] crypto: add HMAC algorithms testcases Longpeng(Mike)
2016-12-13 7:14 ` [Qemu-devel] [PATCH for-2.9 v3 0/6] crypto: add HMAC algorithms support no-reply
2016-12-13 7:35 ` Longpeng (Mike)
2016-12-13 9:30 ` Daniel P. Berrange
2016-12-13 9:35 ` Daniel P. Berrange
2016-12-13 9:36 ` Longpeng (Mike)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161213093431.GD12730@redhat.com \
--to=berrange@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=jianjay.zhou@huawei.com \
--cc=longpeng2@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=wu.wubin@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.