* [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
* [PATCH 2/2] crypto/secret: fix return logic of crypto_secret_prop_get_loaded()
2020-04-15 20:13 [PATCH 1/2] crypto/secret: fix inconsequential errors Alexey Krasikov
@ 2020-04-15 20:13 ` 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é
2 siblings, 1 reply; 5+ messages in thread
From: Alexey Krasikov @ 2020-04-15 20:13 UTC (permalink / raw)
To: berrange, qemu-devel; +Cc: yc-core
* Get function returned value of properties 'data' insteed of returning
value of raw data internal field. This error did not affect anyone,
because no one called the get function.
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 546b965afe..79b9b4ce0c 100644
--- a/crypto/secret.c
+++ b/crypto/secret.c
@@ -231,7 +231,7 @@ qcrypto_secret_prop_get_loaded(Object *obj,
Error **errp G_GNUC_UNUSED)
{
QCryptoSecret *secret = QCRYPTO_SECRET(obj);
- return secret->data != NULL;
+ return secret->rawdata != NULL;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] crypto/secret: fix return logic of crypto_secret_prop_get_loaded()
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é
0 siblings, 0 replies; 5+ messages in thread
From: Daniel P. Berrangé @ 2020-04-22 15:48 UTC (permalink / raw)
To: Alexey Krasikov; +Cc: qemu-devel, yc-core
On Wed, Apr 15, 2020 at 11:13:36PM +0300, Alexey Krasikov wrote:
> * Get function returned value of properties 'data' insteed of returning
> value of raw data internal field. This error did not affect anyone,
> because no one called the get function.
>
> 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 546b965afe..79b9b4ce0c 100644
> --- a/crypto/secret.c
> +++ b/crypto/secret.c
> @@ -231,7 +231,7 @@ qcrypto_secret_prop_get_loaded(Object *obj,
> Error **errp G_GNUC_UNUSED)
> {
> QCryptoSecret *secret = QCRYPTO_SECRET(obj);
> - return secret->data != NULL;
> + return secret->rawdata != NULL;
> }
I already have this change queued from another user, so I'll drop this
dupe.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] crypto/secret: fix inconsequential errors.
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:50 ` Daniel P. Berrangé
2020-04-22 16:04 ` Philippe Mathieu-Daudé
2 siblings, 0 replies; 5+ messages in thread
From: Daniel P. Berrangé @ 2020-04-22 15:50 UTC (permalink / raw)
To: Alexey Krasikov; +Cc: qemu-devel, yc-core
On Wed, Apr 15, 2020 at 11:13:35PM +0300, Alexey Krasikov wrote:
> * 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.
I'll drop the bullet point.
>
> Signed-off-by: Alexey Krasikov <alex-krasikov@yandex-team.ru>
> ---
> crypto/secret.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
and queued.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] crypto/secret: fix inconsequential errors.
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:50 ` [PATCH 1/2] crypto/secret: fix inconsequential errors Daniel P. Berrangé
@ 2020-04-22 16:04 ` Philippe Mathieu-Daudé
2 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-04-22 16:04 UTC (permalink / raw)
To: Alexey Krasikov, berrange, qemu-devel; +Cc: yc-core
On 4/15/20 10:13 PM, Alexey Krasikov wrote:
> * 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);
>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
^ permalink raw reply [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).