[epiphany/wip/sync: 52/86] sync-crypto: Rename defined structs
- From: Gabriel Ivașcu <gabrielivascu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/sync: 52/86] sync-crypto: Rename defined structs
- Date: Wed, 22 Mar 2017 15:34:18 +0000 (UTC)
commit 37164d64a95f3e1ebbbc75098b2b48170b5b73c0
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date: Wed Mar 8 14:25:49 2017 +0200
sync-crypto: Rename defined structs
src/sync/ephy-sync-crypto.c | 92 +++++++++++++++++++++---------------------
src/sync/ephy-sync-crypto.h | 52 ++++++++++++------------
src/sync/ephy-sync-service.c | 18 ++++----
3 files changed, 81 insertions(+), 81 deletions(-)
---
diff --git a/src/sync/ephy-sync-crypto.c b/src/sync/ephy-sync-crypto.c
index 7e37cb2..d8ba368 100644
--- a/src/sync/ephy-sync-crypto.c
+++ b/src/sync/ephy-sync-crypto.c
@@ -34,7 +34,7 @@
static const char hex_digits[] = "0123456789abcdef";
-EphySyncCryptoHawkOptions *
+SyncCryptoHawkOptions *
ephy_sync_crypto_hawk_options_new (const char *app,
const char *dlg,
const char *ext,
@@ -45,9 +45,9 @@ ephy_sync_crypto_hawk_options_new (const char *app,
const char *payload,
const char *timestamp)
{
- EphySyncCryptoHawkOptions *options;
+ SyncCryptoHawkOptions *options;
- options = g_slice_new (EphySyncCryptoHawkOptions);
+ options = g_slice_new (SyncCryptoHawkOptions);
options->app = g_strdup (app);
options->dlg = g_strdup (dlg);
options->ext = g_strdup (ext);
@@ -62,7 +62,7 @@ ephy_sync_crypto_hawk_options_new (const char *app,
}
void
-ephy_sync_crypto_hawk_options_free (EphySyncCryptoHawkOptions *options)
+ephy_sync_crypto_hawk_options_free (SyncCryptoHawkOptions *options)
{
g_return_if_fail (options);
@@ -76,10 +76,10 @@ ephy_sync_crypto_hawk_options_free (EphySyncCryptoHawkOptions *options)
g_free (options->payload);
g_free (options->timestamp);
- g_slice_free (EphySyncCryptoHawkOptions, options);
+ g_slice_free (SyncCryptoHawkOptions, options);
}
-static EphySyncCryptoHawkArtifacts *
+static SyncCryptoHawkArtifacts *
ephy_sync_crypto_hawk_artifacts_new (const char *app,
const char *dlg,
const char *ext,
@@ -91,9 +91,9 @@ ephy_sync_crypto_hawk_artifacts_new (const char *app,
const char *resource,
gint64 ts)
{
- EphySyncCryptoHawkArtifacts *artifacts;
+ SyncCryptoHawkArtifacts *artifacts;
- artifacts = g_slice_new (EphySyncCryptoHawkArtifacts);
+ artifacts = g_slice_new (SyncCryptoHawkArtifacts);
artifacts->app = g_strdup (app);
artifacts->dlg = g_strdup (dlg);
artifacts->ext = g_strdup (ext);
@@ -109,7 +109,7 @@ ephy_sync_crypto_hawk_artifacts_new (const char *app,
}
static void
-ephy_sync_crypto_hawk_artifacts_free (EphySyncCryptoHawkArtifacts *artifacts)
+ephy_sync_crypto_hawk_artifacts_free (SyncCryptoHawkArtifacts *artifacts)
{
g_assert (artifacts);
@@ -124,16 +124,16 @@ ephy_sync_crypto_hawk_artifacts_free (EphySyncCryptoHawkArtifacts *artifacts)
g_free (artifacts->resource);
g_free (artifacts->ts);
- g_slice_free (EphySyncCryptoHawkArtifacts, artifacts);
+ g_slice_free (SyncCryptoHawkArtifacts, artifacts);
}
-static EphySyncCryptoHawkHeader *
-ephy_sync_crypto_hawk_header_new (char *header,
- EphySyncCryptoHawkArtifacts *artifacts)
+static SyncCryptoHawkHeader *
+ephy_sync_crypto_hawk_header_new (char *header,
+ SyncCryptoHawkArtifacts *artifacts)
{
- EphySyncCryptoHawkHeader *hheader;
+ SyncCryptoHawkHeader *hheader;
- hheader = g_slice_new (EphySyncCryptoHawkHeader);
+ hheader = g_slice_new (SyncCryptoHawkHeader);
hheader->header = header;
hheader->artifacts = artifacts;
@@ -141,23 +141,23 @@ ephy_sync_crypto_hawk_header_new (char *header,
}
void
-ephy_sync_crypto_hawk_header_free (EphySyncCryptoHawkHeader *hheader)
+ephy_sync_crypto_hawk_header_free (SyncCryptoHawkHeader *hheader)
{
g_return_if_fail (hheader);
g_free (hheader->header);
ephy_sync_crypto_hawk_artifacts_free (hheader->artifacts);
- g_slice_free (EphySyncCryptoHawkHeader, hheader);
+ g_slice_free (SyncCryptoHawkHeader, hheader);
}
-static EphySyncCryptoRSAKeyPair *
+static SyncCryptoRSAKeyPair *
ephy_sync_crypto_rsa_key_pair_new (struct rsa_public_key public,
struct rsa_private_key private)
{
- EphySyncCryptoRSAKeyPair *keypair;
+ SyncCryptoRSAKeyPair *keypair;
- keypair = g_slice_new (EphySyncCryptoRSAKeyPair);
+ keypair = g_slice_new (SyncCryptoRSAKeyPair);
keypair->public = public;
keypair->private = private;
@@ -165,14 +165,14 @@ ephy_sync_crypto_rsa_key_pair_new (struct rsa_public_key public,
}
void
-ephy_sync_crypto_rsa_key_pair_free (EphySyncCryptoRSAKeyPair *keypair)
+ephy_sync_crypto_rsa_key_pair_free (SyncCryptoRSAKeyPair *keypair)
{
g_return_if_fail (keypair);
rsa_public_key_clear (&keypair->public);
rsa_private_key_clear (&keypair->private);
- g_slice_free (EphySyncCryptoRSAKeyPair, keypair);
+ g_slice_free (SyncCryptoRSAKeyPair, keypair);
}
static char *
@@ -219,8 +219,8 @@ ephy_sync_crypto_equals (guint8 *a,
}
static char *
-ephy_sync_crypto_normalize_string (const char *type,
- EphySyncCryptoHawkArtifacts *artifacts)
+ephy_sync_crypto_normalize_string (const char *type,
+ SyncCryptoHawkArtifacts *artifacts)
{
char *host;
char *info;
@@ -311,10 +311,10 @@ ephy_sync_crypto_calculate_payload_hash (const char *payload,
}
static char *
-ephy_sync_crypto_calculate_mac (const char *type,
- guint8 *key,
- gsize key_len,
- EphySyncCryptoHawkArtifacts *artifacts)
+ephy_sync_crypto_calculate_mac (const char *type,
+ guint8 *key,
+ gsize key_len,
+ SyncCryptoHawkArtifacts *artifacts)
{
guint8 *digest;
char *digest_hex;
@@ -602,15 +602,15 @@ ephy_sync_crypto_compute_sync_keys (const char *bundle,
g_free (respMAC2_hex);
}
-EphySyncCryptoHawkHeader *
-ephy_sync_crypto_compute_hawk_header (const char *url,
- const char *method,
- const char *id,
- guint8 *key,
- gsize key_len,
- EphySyncCryptoHawkOptions *options)
+SyncCryptoHawkHeader *
+ephy_sync_crypto_compute_hawk_header (const char *url,
+ const char *method,
+ const char *id,
+ guint8 *key,
+ gsize key_len,
+ SyncCryptoHawkOptions *options)
{
- EphySyncCryptoHawkArtifacts *artifacts;
+ SyncCryptoHawkArtifacts *artifacts;
SoupURI *uri;
char *resource;
char *hash;
@@ -716,7 +716,7 @@ ephy_sync_crypto_compute_hawk_header (const char *url,
return ephy_sync_crypto_hawk_header_new (header, artifacts);
}
-EphySyncCryptoRSAKeyPair *
+SyncCryptoRSAKeyPair *
ephy_sync_crypto_generate_rsa_key_pair (void)
{
struct rsa_public_key public;
@@ -744,10 +744,10 @@ ephy_sync_crypto_generate_rsa_key_pair (void)
}
char *
-ephy_sync_crypto_create_assertion (const char *certificate,
- const char *audience,
- guint64 duration,
- EphySyncCryptoRSAKeyPair *keypair)
+ephy_sync_crypto_create_assertion (const char *certificate,
+ const char *audience,
+ guint64 duration,
+ SyncCryptoRSAKeyPair *keypair)
{
mpz_t signature;
const char *header = "{\"alg\": \"RS256\"}";
@@ -900,11 +900,11 @@ ephy_sync_crypto_base64_urlsafe_decode (const char *text,
}
guint8 *
-ephy_sync_crypto_aes_256 (EphySyncCryptoAES256Mode mode,
- const guint8 *key,
- const guint8 *data,
- gsize data_len,
- gsize *out_len)
+ephy_sync_crypto_aes_256 (SyncCryptoAES256Mode mode,
+ const guint8 *key,
+ const guint8 *data,
+ gsize data_len,
+ gsize *out_len)
{
struct aes256_ctx aes;
gsize padded_len = data_len;
diff --git a/src/sync/ephy-sync-crypto.h b/src/sync/ephy-sync-crypto.h
index 18368c4..4b041fc 100644
--- a/src/sync/ephy-sync-crypto.h
+++ b/src/sync/ephy-sync-crypto.h
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
typedef enum {
AES_256_MODE_ENCRYPT,
AES_256_MODE_DECRYPT
-} EphySyncCryptoAES256Mode;
+} SyncCryptoAES256Mode;
typedef struct {
char *app;
@@ -42,7 +42,7 @@ typedef struct {
char *nonce;
char *payload;
char *timestamp;
-} EphySyncCryptoHawkOptions;
+} SyncCryptoHawkOptions;
typedef struct {
char *app;
@@ -55,19 +55,19 @@ typedef struct {
char *port;
char *resource;
char *ts;
-} EphySyncCryptoHawkArtifacts;
+} SyncCryptoHawkArtifacts;
typedef struct {
char *header;
- EphySyncCryptoHawkArtifacts *artifacts;
-} EphySyncCryptoHawkHeader;
+ SyncCryptoHawkArtifacts *artifacts;
+} SyncCryptoHawkHeader;
typedef struct {
struct rsa_public_key public;
struct rsa_private_key private;
-} EphySyncCryptoRSAKeyPair;
+} SyncCryptoRSAKeyPair;
-EphySyncCryptoHawkOptions *ephy_sync_crypto_hawk_options_new (const char *app,
+SyncCryptoHawkOptions *ephy_sync_crypto_hawk_options_new (const char *app,
const char *dlg,
const char *ext,
const char *content_type,
@@ -76,9 +76,9 @@ EphySyncCryptoHawkOptions *ephy_sync_crypto_hawk_options_new (const char
const char *nonce,
const char *payload,
const char *timestamp);
-void ephy_sync_crypto_hawk_options_free (EphySyncCryptoHawkOptions *options);
-void ephy_sync_crypto_hawk_header_free (EphySyncCryptoHawkHeader *header);
-void ephy_sync_crypto_rsa_key_pair_free (EphySyncCryptoRSAKeyPair *keypair);
+void ephy_sync_crypto_hawk_options_free (SyncCryptoHawkOptions *options);
+void ephy_sync_crypto_hawk_header_free (SyncCryptoHawkHeader *header);
+void ephy_sync_crypto_rsa_key_pair_free (SyncCryptoRSAKeyPair *keypair);
void ephy_sync_crypto_process_key_fetch_token (const char *keyFetchToken,
guint8 **tokenID,
guint8 **reqHMACkey,
@@ -94,17 +94,17 @@ void ephy_sync_crypto_compute_sync_keys (const char
guint8 *unwrapBKey,
guint8 **kA,
guint8 **kB);
-EphySyncCryptoHawkHeader *ephy_sync_crypto_compute_hawk_header (const char *url,
- const char *method,
- const char *id,
- guint8 *key,
- gsize key_len,
- EphySyncCryptoHawkOptions *options);
-EphySyncCryptoRSAKeyPair *ephy_sync_crypto_generate_rsa_key_pair (void);
-char *ephy_sync_crypto_create_assertion (const char *certificate,
- const char *audience,
- guint64 duration,
- EphySyncCryptoRSAKeyPair *keypair);
+SyncCryptoHawkHeader *ephy_sync_crypto_compute_hawk_header (const char *url,
+ const char *method,
+ const char *id,
+ guint8 *key,
+ gsize key_len,
+ SyncCryptoHawkOptions *options);
+SyncCryptoRSAKeyPair *ephy_sync_crypto_generate_rsa_key_pair (void);
+char *ephy_sync_crypto_create_assertion (const char *certificate,
+ const char *audience,
+ guint64 duration,
+ SyncCryptoRSAKeyPair *keypair);
void ephy_sync_crypto_random_hex_gen (void *ctx,
gsize length,
guint8 *dst);
@@ -114,11 +114,11 @@ char *ephy_sync_crypto_base64_urlsafe_encode (guint8 *d
guint8 *ephy_sync_crypto_base64_urlsafe_decode (const char *text,
gsize *out_len,
gboolean fill);
-guint8 *ephy_sync_crypto_aes_256 (EphySyncCryptoAES256Mode mode,
- const guint8 *key,
- const guint8 *data,
- gsize data_len,
- gsize *out_len);
+guint8 *ephy_sync_crypto_aes_256 (SyncCryptoAES256Mode mode,
+ const guint8 *key,
+ const guint8 *data,
+ gsize data_len,
+ gsize *out_len);
char *ephy_sync_crypto_encode_hex (guint8 *data,
gsize data_len);
guint8 *ephy_sync_crypto_decode_hex (const char *hex);
diff --git a/src/sync/ephy-sync-service.c b/src/sync/ephy-sync-service.c
index 0347d28..c2c905f 100644
--- a/src/sync/ephy-sync-service.c
+++ b/src/sync/ephy-sync-service.c
@@ -67,8 +67,8 @@ struct _EphySyncService {
gint64 storage_credentials_expiry_time;
GQueue *storage_queue;
- char *certificate;
- EphySyncCryptoRSAKeyPair *keypair;
+ char *certificate;
+ SyncCryptoRSAKeyPair *keypair;
};
G_DEFINE_TYPE (EphySyncService, ephy_sync_service, G_TYPE_OBJECT);
@@ -213,8 +213,8 @@ ephy_sync_service_fxa_hawk_post_async (EphySyncService *self,
SoupSessionCallback callback,
gpointer user_data)
{
- EphySyncCryptoHawkOptions *hoptions;
- EphySyncCryptoHawkHeader *hheader;
+ SyncCryptoHawkOptions *hoptions;
+ SyncCryptoHawkHeader *hheader;
SoupMessage *msg;
char *url;
const char *content_type = "application/json";
@@ -251,7 +251,7 @@ ephy_sync_service_fxa_hawk_get_async (EphySyncService *self,
SoupSessionCallback callback,
gpointer user_data)
{
- EphySyncCryptoHawkHeader *hheader;
+ SyncCryptoHawkHeader *hheader;
SoupMessage *msg;
char *url;
@@ -513,8 +513,8 @@ static void
ephy_sync_service_send_storage_request (EphySyncService *self,
StorageRequestAsyncData *data)
{
- EphySyncCryptoHawkOptions *hoptions = NULL;
- EphySyncCryptoHawkHeader *hheader;
+ SyncCryptoHawkOptions *hoptions = NULL;
+ SyncCryptoHawkHeader *hheader;
SoupMessage *msg;
char *url;
char *if_modified_since = NULL;
@@ -864,8 +864,8 @@ void
ephy_sync_service_destroy_session (EphySyncService *self,
const char *sessionToken)
{
- EphySyncCryptoHawkOptions *hoptions;
- EphySyncCryptoHawkHeader *hheader;
+ SyncCryptoHawkOptions *hoptions;
+ SyncCryptoHawkHeader *hheader;
SoupMessage *msg;
guint8 *tokenID;
guint8 *reqHMACkey;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]