diff options
author | Jan-Michael Brummer <jan.brummer@tabos.org> | 2020-07-11 11:19:21 +0200 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@gnome.org> | 2020-07-11 12:35:58 +0000 |
commit | 413ad14298f22d125195c73a19d6186dc57abe13 (patch) | |
tree | 3240de1e0911e79959585131a33279317d061f96 /lib | |
parent | bc312dbad8a9936b45626458f0c8bcee7e392bde (diff) | |
download | epiphany-413ad14298f22d125195c73a19d6186dc57abe13.tar.gz |
ephy-sync-crypto: Change log output type
Move g_warnings to LOG in ephy_sync_crypto_decrypt_record as each caller
also has a g_warning in case this one fails.
Fixes: https://gitlab.gnome.org/GNOME/epiphany/-/issues/1019
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sync/ephy-sync-crypto.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/sync/ephy-sync-crypto.c b/lib/sync/ephy-sync-crypto.c index 05bf888b2..717164aa5 100644 --- a/lib/sync/ephy-sync-crypto.c +++ b/lib/sync/ephy-sync-crypto.c @@ -21,6 +21,7 @@ #include "config.h" #include "ephy-sync-crypto.h" +#include "ephy-debug.h" #include "ephy-string.h" #include "ephy-sync-utils.h" @@ -1108,19 +1109,19 @@ ephy_sync_crypto_decrypt_record (const char *payload, /* Extract ciphertext, iv and hmac from payload. */ node = json_from_string (payload, &error); if (error) { - g_warning ("Payload is not a valid JSON: %s", error->message); + LOG ("Payload is not a valid JSON: %s", error->message); goto out; } json = json_node_get_object (node); if (!json) { - g_warning ("JSON node does not hold a JSON object"); + LOG ("JSON node does not hold a JSON object"); goto out; } ciphertext_b64 = json_object_get_string_member (json, "ciphertext"); iv_b64 = json_object_get_string_member (json, "IV"); hmac = json_object_get_string_member (json, "hmac"); if (!ciphertext_b64 || !iv_b64 || !hmac) { - g_warning ("JSON object has missing or invalid members"); + LOG ("JSON object has missing or invalid members"); goto out; } @@ -1132,7 +1133,7 @@ ephy_sync_crypto_decrypt_record (const char *payload, * if the HMAC verification fails. */ if (!ephy_sync_crypto_hmac_is_valid (ciphertext_b64, hmac_key, hmac)) { - g_warning ("Incorrect HMAC value"); + LOG ("Incorrect HMAC value"); goto out; } |