qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Alexey Krasikov" <alex-krasikov@yandex-team.ru>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-block@nongnu.org, "Max Reitz" <mreitz@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PULL 2/5] crypto/secret: fix inconsequential errors.
Date: Thu,  7 May 2020 12:58:00 +0100	[thread overview]
Message-ID: <20200507115803.1122661-3-berrange@redhat.com> (raw)
In-Reply-To: <20200507115803.1122661-1-berrange@redhat.com>

From: Alexey Krasikov <alex-krasikov@yandex-team.ru>

Change condition from QCRYPTO_SECRET_FORMAT_RAW
to QCRYPTO_SECRET_FORMAT_BASE64 in if-operator, because
this is potential error if you add another format value.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alexey Krasikov <alex-krasikov@yandex-team.ru>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 crypto/secret.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/secret.c b/crypto/secret.c
index 5fb6bbe59c..a846a3c87c 100644
--- a/crypto/secret.c
+++ b/crypto/secret.c
@@ -204,7 +204,7 @@ qcrypto_secret_prop_set_loaded(Object *obj,
             input = output;
             inputlen = outputlen;
         } else {
-            if (secret->format != QCRYPTO_SECRET_FORMAT_RAW) {
+            if (secret->format == QCRYPTO_SECRET_FORMAT_BASE64) {
                 qcrypto_secret_decode(input, inputlen,
                                       &output, &outputlen, &local_err);
                 g_free(input);
-- 
2.26.2



  parent reply	other threads:[~2020-05-07 12:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 11:57 [PULL 0/5] Misc crypto subsystem fixes Daniel P. Berrangé
2020-05-07 11:57 ` [PULL 1/5] crypto: fix getter of a QCryptoSecret's property Daniel P. Berrangé
2020-05-07 11:58 ` Daniel P. Berrangé [this message]
2020-05-07 11:58 ` [PULL 3/5] crypto: Redundant type conversion for AES_KEY pointer Daniel P. Berrangé
2020-05-07 11:58 ` [PULL 4/5] block: luks: better error message when creating too large files Daniel P. Berrangé
2020-05-07 11:58 ` [PULL 5/5] crypto: extend hash benchmark to cover more algorithms Daniel P. Berrangé
2020-05-07 15:21 ` [PULL 0/5] Misc crypto subsystem fixes Peter Maydell

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=20200507115803.1122661-3-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex-krasikov@yandex-team.ru \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).