[epiphany] sync-service: Remove no longer used function



commit c28aba40ca54af8544a4ad7fc47d068869819962
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Thu Nov 24 01:03:37 2016 +0200

    sync-service: Remove no longer used function

 src/prefs-dialog.c           |    5 +++
 src/sync/ephy-sync-service.c |   76 ------------------------------------------
 src/sync/ephy-sync-service.h |    4 --
 3 files changed, 5 insertions(+), 80 deletions(-)
---
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index fa2528f..d79e724 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -363,6 +363,11 @@ server_message_received_cb (WebKitUserContentManager *manager,
       goto out;
     }
 
+    /* Derive tokenID, reqHMACkey, respHMACkey and respXORkey from the keyFetchToken.
+     * tokenID and reqHMACkey are used to make a HAWK request to the "GET /account/keys"
+     * API. The server looks up the stored table entry with tokenID, checks the request
+     * HMAC for validity, then returns the pre-encrypted response.
+     * See https://github.com/mozilla/fxa-auth-server/wiki/onepw-protocol#fetching-sync-keys */
     ephy_sync_crypto_process_key_fetch_token (keyFetchToken,
                                               &tokenID, &reqHMACkey,
                                               &respHMACkey, &respXORkey);
diff --git a/src/sync/ephy-sync-service.c b/src/sync/ephy-sync-service.c
index f4ec8d8..4ded2ef 100644
--- a/src/sync/ephy-sync-service.c
+++ b/src/sync/ephy-sync-service.c
@@ -930,82 +930,6 @@ ephy_sync_service_finish_sign_in (EphySyncService *self,
   g_free (unwrapKB);
 }
 
-gboolean
-ephy_sync_service_fetch_sync_keys (EphySyncService *self,
-                                   const char      *email,
-                                   const char      *keyFetchToken,
-                                   const char      *unwrapBKey)
-{
-  JsonNode *node;
-  JsonObject *json;
-  guint8 *unwrapKB;
-  guint8 *tokenID;
-  guint8 *reqHMACkey;
-  guint8 *respHMACkey;
-  guint8 *respXORkey;
-  guint8 *kA;
-  guint8 *kB;
-  char *tokenID_hex;
-  guint status_code;
-  gboolean retval = FALSE;
-
-  g_return_val_if_fail (EPHY_IS_SYNC_SERVICE (self), FALSE);
-  g_return_val_if_fail (email != NULL, FALSE);
-  g_return_val_if_fail (keyFetchToken != NULL, FALSE);
-  g_return_val_if_fail (unwrapBKey != NULL, FALSE);
-
-  unwrapKB = ephy_sync_crypto_decode_hex (unwrapBKey);
-
-  /* Derive tokenID, reqHMACkey, respHMACkey and respXORkey from the keyFetchToken.
-   * tokenID and reqHMACkey are used to make a HAWK request to the "GET /account/keys"
-   * API. The server looks up the stored table entry with tokenID, checks the request
-   * HMAC for validity, then returns the pre-encrypted response.
-   * See https://github.com/mozilla/fxa-auth-server/wiki/onepw-protocol#fetching-sync-keys */
-  ephy_sync_crypto_process_key_fetch_token (keyFetchToken,
-                                            &tokenID, &reqHMACkey, &respHMACkey, &respXORkey);
-  tokenID_hex = ephy_sync_crypto_encode_hex (tokenID, 0);
-  status_code = ephy_sync_service_fxa_hawk_get_sync (self, "account/keys", tokenID_hex,
-                                                     reqHMACkey, EPHY_SYNC_TOKEN_LENGTH,
-                                                     &node);
-  json = json_node_get_object (node);
-
-  if (status_code != 200) {
-    g_warning ("FxA server errno: %ld, errmsg: %s",
-               json_object_get_int_member (json, "errno"),
-               json_object_get_string_member (json, "message"));
-    goto out;
-  }
-
-  /* From the pre-encrypted response and respHMACkey, respXORkey, unwrapKB
-   * derive the sync keys. */
-  ephy_sync_crypto_compute_sync_keys (json_object_get_string_member (json, "bundle"),
-                                      respHMACkey, respXORkey, unwrapKB,
-                                      &kA, &kB);
-
-  /* Everything is okay, save the tokens. */
-  ephy_sync_service_set_user_email (self, email);
-  ephy_sync_service_set_and_store_tokens (self,
-                                          g_strdup (keyFetchToken), TOKEN_KEYFETCHTOKEN,
-                                          g_strdup (unwrapBKey), TOKEN_UNWRAPBKEY,
-                                          ephy_sync_crypto_encode_hex (kA, 0), TOKEN_KA,
-                                          ephy_sync_crypto_encode_hex (kB, 0), TOKEN_KB,
-                                          NULL);
-  g_free (kA);
-  g_free (kB);
-  retval = TRUE;
-
-out:
-  json_node_free (node);
-  g_free (unwrapKB);
-  g_free (tokenID);
-  g_free (reqHMACkey);
-  g_free (respHMACkey);
-  g_free (respXORkey);
-  g_free (tokenID_hex);
-
-  return retval;
-}
-
 void
 ephy_sync_service_send_storage_message (EphySyncService     *self,
                                         char                *endpoint,
diff --git a/src/sync/ephy-sync-service.h b/src/sync/ephy-sync-service.h
index 29fc494..333ac5d 100644
--- a/src/sync/ephy-sync-service.h
+++ b/src/sync/ephy-sync-service.h
@@ -65,10 +65,6 @@ void             ephy_sync_service_finish_sign_in               (EphySyncService
                                                                  char            *bundle,
                                                                  guint8          *respHMACkey,
                                                                  guint8          *respXORkey);
-gboolean         ephy_sync_service_fetch_sync_keys              (EphySyncService *self,
-                                                                 const char      *email,
-                                                                 const char      *keyFetchToken,
-                                                                 const char      *unwrapBKey);
 void             ephy_sync_service_send_storage_message         (EphySyncService     *self,
                                                                  char                *endpoint,
                                                                  const char          *method,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]