From: "Daniel P. Berrange" <berrange@redhat.com>
To: Gonglei <arei.gonglei@huawei.com>
Cc: qemu-devel@nongnu.org, wu.wubin@huawei.com
Subject: Re: [Qemu-devel] [PATCH v2 3/3] crypto: add mode check in qcrypto_cipher_new() for cipher-builtin
Date: Mon, 26 Sep 2016 09:13:30 +0100 [thread overview]
Message-ID: <20160926081330.GA18393@redhat.com> (raw)
In-Reply-To: <1474683000-346560-4-git-send-email-arei.gonglei@huawei.com>
On Sat, Sep 24, 2016 at 10:10:00AM +0800, Gonglei wrote:
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
> crypto/cipher-builtin.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c
> index fd59a9e..d710608 100644
> --- a/crypto/cipher-builtin.c
> +++ b/crypto/cipher-builtin.c
> @@ -433,6 +433,16 @@ QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg,
> {
> QCryptoCipher *cipher;
>
> + switch (mode) {
> + case QCRYPTO_CIPHER_MODE_ECB:
> + case QCRYPTO_CIPHER_MODE_CBC:
> + case QCRYPTO_CIPHER_MODE_XTS:
Presumably you intended to have 'break' here, otherwise this
code rejects everything
> + default:
> + error_setg(errp, "Unsupported cipher mode %s",
> + QCryptoCipherMode_lookup[mode]);
> + return NULL;
> + }
> +
> cipher = g_new0(QCryptoCipher, 1);
> cipher->alg = alg;
> cipher->mode = mode;
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 :|
next prev parent reply other threads:[~2016-09-26 8:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-24 2:09 [Qemu-devel] [PATCH v2 0/3] crypto: add ctr mode support and little inprovement Gonglei
2016-09-24 2:09 ` [Qemu-devel] [PATCH v2 1/3] crypto: add CTR mode support Gonglei
2016-09-24 2:09 ` [Qemu-devel] [PATCH v2 2/3] crypto: extend mode as a parameter in qcrypto_cipher_supports() Gonglei
2016-09-24 2:10 ` [Qemu-devel] [PATCH v2 3/3] crypto: add mode check in qcrypto_cipher_new() for cipher-builtin Gonglei
2016-09-26 8:13 ` Daniel P. Berrange [this message]
2016-09-26 8:50 ` Gonglei (Arei)
2016-09-24 2:21 ` [Qemu-devel] [PATCH v2 0/3] crypto: add ctr mode support and little inprovement no-reply
2016-09-24 2:29 ` Gonglei (Arei)
2016-09-26 8:14 ` Daniel P. Berrange
2016-09-26 8:52 ` Gonglei (Arei)
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=20160926081330.GA18393@redhat.com \
--to=berrange@redhat.com \
--cc=arei.gonglei@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.