qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] crypto/secret: fix inconsequential errors.
@ 2020-04-15 20:13 Alexey Krasikov
  2020-04-15 20:13 ` [PATCH 2/2] crypto/secret: fix return logic of crypto_secret_prop_get_loaded() Alexey Krasikov
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alexey Krasikov @ 2020-04-15 20:13 UTC (permalink / raw)
  To: berrange, qemu-devel; +Cc: yc-core

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

Signed-off-by: Alexey Krasikov <alex-krasikov@yandex-team.ru>
---
 crypto/secret.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/secret.c b/crypto/secret.c
index 1cf0ad0ce8..546b965afe 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.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-22 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-15 20:13 [PATCH 1/2] crypto/secret: fix inconsequential errors Alexey Krasikov
2020-04-15 20:13 ` [PATCH 2/2] crypto/secret: fix return logic of crypto_secret_prop_get_loaded() Alexey Krasikov
2020-04-22 15:48   ` Daniel P. Berrangé
2020-04-22 15:50 ` [PATCH 1/2] crypto/secret: fix inconsequential errors Daniel P. Berrangé
2020-04-22 16:04 ` Philippe Mathieu-Daudé

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).