[epiphany/wip/sync: 66/86] sync: The default sync keys should be obtained at sync time
- From: Gabriel Ivașcu <gabrielivascu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/sync: 66/86] sync: The default sync keys should be obtained at sync time
- Date: Wed, 22 Mar 2017 15:35:28 +0000 (UTC)
commit 27b8e1e95220e573efe614adcc43124096f24e06
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date: Sat Mar 11 01:00:49 2017 +0200
sync: The default sync keys should be obtained at sync time
src/sync/ephy-sync-secret.c | 4 ----
src/sync/ephy-sync-service.c | 15 +++------------
2 files changed, 3 insertions(+), 16 deletions(-)
---
diff --git a/src/sync/ephy-sync-secret.c b/src/sync/ephy-sync-secret.c
index 1a2ba2e..f9abdec 100644
--- a/src/sync/ephy-sync-secret.c
+++ b/src/sync/ephy-sync-secret.c
@@ -224,10 +224,6 @@ ephy_sync_secret_store_tokens (EphySyncService *service)
ephy_sync_service_get_token (service, TOKEN_SESSIONTOKEN),
ephy_sync_utils_token_name_from_type (TOKEN_KB),
ephy_sync_service_get_token (service, TOKEN_KB),
- ephy_sync_utils_token_name_from_type (TOKEN_DEFAULT_AES_KEY),
- ephy_sync_service_get_token (service, TOKEN_DEFAULT_AES_KEY),
- ephy_sync_utils_token_name_from_type (TOKEN_DEFAULT_HMAC_KEY),
- ephy_sync_service_get_token (service, TOKEN_DEFAULT_HMAC_KEY),
NULL);
value = secret_value_new (tokens, -1, "text/plain");
attributes = secret_attributes_build (EPHY_SYNC_TOKEN_SCHEMA, EMAIL_KEY,
diff --git a/src/sync/ephy-sync-service.c b/src/sync/ephy-sync-service.c
index 8a72275..759fde1 100644
--- a/src/sync/ephy-sync-service.c
+++ b/src/sync/ephy-sync-service.c
@@ -931,9 +931,6 @@ obtain_default_sync_keys_cb (SoupSession *session,
if (msg->status_code != 200) {
g_warning ("Failed to get crypto/keys record. Status code: %u, response: %s",
msg->status_code, msg->response_body->data);
- ephy_sync_service_report_sign_in_error (service,
- _("Something went wrong, please try again."),
- TRUE);
goto out;
}
@@ -958,10 +955,7 @@ obtain_default_sync_keys_cb (SoupSession *session,
* the record and retrieve the default sync keys. Otherwise, signal the error
* to the user.*/
if (!ephy_sync_crypto_sha256_hmac_is_valid (ciphertext_b64, hmac_key, hmac)) {
- LOG ("Failed to verify the HMAC value of the crypto/keys record");
- ephy_sync_service_report_sign_in_error (service,
- _("Failed to obtain the default sync keys"),
- TRUE);
+ g_warning ("Failed to verify the HMAC value of the crypto/keys record");
} else {
record = ephy_sync_crypto_decrypt_record (ciphertext_b64, iv_b64, aes_key);
json_parser_load_from_data (parser, record, -1, NULL);
@@ -978,9 +972,6 @@ obtain_default_sync_keys_cb (SoupSession *session,
ephy_sync_service_set_token (service, default_aes_key_hex, TOKEN_DEFAULT_AES_KEY);
ephy_sync_service_set_token (service, default_hmac_key_hex, TOKEN_DEFAULT_HMAC_KEY);
- /* Everything is OK, store the tokens in the secret schema. */
- ephy_sync_secret_store_tokens (service);
-
g_free (record);
g_free (default_aes_key);
g_free (default_hmac_key);
@@ -1039,10 +1030,10 @@ check_storage_version_cb (SoupSession *session,
json = json_node_get_object (json_parser_get_root (parser));
storage_version = json_object_get_int_member (json, "storageVersion");
- /* If the storage version is correct, proceed to obtain the default sync keys.
+ /* If the storage version is correct, proceed to store the tokens.
* Otherwise, signal the error to the user. */
if (storage_version == STORAGE_VERSION) {
- ephy_sync_service_obtain_default_sync_keys (service);
+ ephy_sync_secret_store_tokens (service);
} else {
LOG ("Unsupported storage version: %d", storage_version);
/* Translators: the %d is the storage version, the \n is a newline character. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]