]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
crypto/secret: fix inconsequential errors.
authorAlexey Krasikov <alex-krasikov@yandex-team.ru>
Wed, 15 Apr 2020 20:13:35 +0000 (23:13 +0300)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 7 May 2020 11:48:41 +0000 (12:48 +0100)
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

index 5fb6bbe59c55edb87576b2b1ca7adbf9891049dc..a846a3c87cbed283bef681fe8d1b2442253b1c14 100644 (file)
@@ -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);