-lots
[oweals/gnunet.git] / src / fs / fs_uri.c
index d25c3a2e007580d998de0c72f4fa279a9aba5e5e..0f4168918328d932d3c79d58ea9c748afe09afd4 100644 (file)
@@ -355,7 +355,7 @@ static struct GNUNET_FS_Uri *
 uri_sks_parse (const char *s, char **emsg)
 {
   struct GNUNET_FS_Uri *ret;
-  struct GNUNET_HashCode namespace;
+  struct GNUNET_HashCode ns;
   char *identifier;
   unsigned int pos;
   size_t slen;
@@ -374,7 +374,7 @@ uri_sks_parse (const char *s, char **emsg)
   }
   memcpy (enc, &s[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded));
   enc[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] = '\0';
-  if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (enc, &namespace))
+  if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (enc, &ns))
   {
     *emsg = GNUNET_strdup (_("Malformed SKS URI"));
     return NULL;
@@ -383,7 +383,7 @@ uri_sks_parse (const char *s, char **emsg)
       GNUNET_strdup (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)]);
   ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
   ret->type = sks;
-  ret->data.sks.namespace = namespace;
+  ret->data.sks.ns = ns;
   ret->data.sks.identifier = identifier;
   return ret;
 }
@@ -903,8 +903,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
                 _("Lacking key configuration settings.\n"));
     return NULL;
   }
-  my_private_key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile);
-  if (my_private_key == NULL)
+  if (NULL == (my_private_key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 _("Could not access hostkey file `%s'.\n"), keyfile);
@@ -949,7 +948,7 @@ GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, const char *id,
   ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
   ns_uri->type = sks;
   GNUNET_CRYPTO_rsa_key_get_public (ns->key, &pk);
-  GNUNET_CRYPTO_hash (&pk, sizeof (pk), &ns_uri->data.sks.namespace);
+  GNUNET_CRYPTO_hash (&pk, sizeof (pk), &ns_uri->data.sks.ns);
   ns_uri->data.sks.identifier = GNUNET_strdup (id);
   return ns_uri;
 }
@@ -969,7 +968,7 @@ GNUNET_FS_uri_sks_create_from_nsid (struct GNUNET_HashCode * nsid, const char *i
 
   ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
   ns_uri->type = sks;
-  ns_uri->data.sks.namespace = *nsid;
+  ns_uri->data.sks.ns = *nsid;
   ns_uri->data.sks.identifier = GNUNET_strdup (id);
   return ns_uri;
 }
@@ -1272,7 +1271,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
     return GNUNET_NO;
   case sks:
     if ((0 ==
-         memcmp (&u1->data.sks.namespace, &u2->data.sks.namespace,
+         memcmp (&u1->data.sks.ns, &u2->data.sks.ns,
                  sizeof (struct GNUNET_HashCode))) &&
         (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier)))
 
@@ -1341,7 +1340,7 @@ GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
     GNUNET_break (0);
     return GNUNET_SYSERR;
   }
-  *nsid = uri->data.sks.namespace;
+  *nsid = uri->data.sks.ns;
   return GNUNET_OK;
 }
 
@@ -1382,9 +1381,9 @@ GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg,
 
   if (uri->type != sks)
     return NULL;
-  (void) GNUNET_PSEUDONYM_get_info (cfg, &uri->data.sks.namespace,
+  (void) GNUNET_PSEUDONYM_get_info (cfg, &uri->data.sks.ns,
                                    NULL, NULL, &name, NULL);
-  unique_name = GNUNET_PSEUDONYM_name_uniquify (cfg, &uri->data.sks.namespace, name, NULL);
+  unique_name = GNUNET_PSEUDONYM_name_uniquify (cfg, &uri->data.sks.ns, name, NULL);
   GNUNET_free (name);
   GNUNET_asprintf (&ret, "%s: %s", unique_name, uri->data.sks.identifier);
   GNUNET_free (unique_name);
@@ -1931,18 +1930,18 @@ uri_ksk_to_string (const struct GNUNET_FS_Uri *uri)
 static char *
 uri_sks_to_string (const struct GNUNET_FS_Uri *uri)
 {
-  const struct GNUNET_HashCode *namespace;
+  const struct GNUNET_HashCode *ns;
   const char *identifier;
   char *ret;
-  struct GNUNET_CRYPTO_HashAsciiEncoded ns;
+  struct GNUNET_CRYPTO_HashAsciiEncoded nsasc;
 
   if (uri->type != sks)
     return NULL;
-  namespace = &uri->data.sks.namespace;
+  ns = &uri->data.sks.ns;
   identifier = uri->data.sks.identifier;
-  GNUNET_CRYPTO_hash_to_enc (namespace, &ns);
+  GNUNET_CRYPTO_hash_to_enc (ns, &nsasc);
   GNUNET_asprintf (&ret, "%s%s%s/%s", GNUNET_FS_URI_PREFIX,
-                   GNUNET_FS_URI_SKS_INFIX, (const char *) &ns, identifier);
+                   GNUNET_FS_URI_SKS_INFIX, (const char *) &nsasc, identifier);
   return ret;
 }