GNUNET_free (uric);
if (uri2 == NULL)
{
+ fprintf (stderr, "URI parsing failed: %s\n", emsg);
GNUNET_break (0);
GNUNET_FS_uri_destroy (uri);
GNUNET_CONFIGURATION_destroy (cfg);
char *uri;
struct GNUNET_FS_Uri *ret;
char *emsg;
+ struct GNUNET_CRYPTO_EccPrivateKey *ph;
+ struct GNUNET_CRYPTO_EccPublicKey id;
+ char buf[1024];
+ char ubuf[1024];
+ char *sret;
if (NULL !=
(ret =
GNUNET_assert (0);
}
GNUNET_free (emsg);
- ret =
- GNUNET_FS_uri_parse
- ("gnunet://fs/sks/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820/test",
- &emsg);
- if (ret == NULL)
+ ph = GNUNET_CRYPTO_ecc_key_create ();
+ GNUNET_CRYPTO_ecc_key_get_public (ph, &id);
+ sret = GNUNET_STRINGS_data_to_string (&id, sizeof (id),
+ ubuf, sizeof (ubuf) - 1);
+ GNUNET_assert (NULL != sret);
+ sret[0] = '\0';
+ GNUNET_snprintf (buf, sizeof (buf),
+ "gnunet://fs/sks/%s/test",
+ ubuf);
+ ret = GNUNET_FS_uri_parse (buf, &emsg);
+ if (NULL == ret)
{
GNUNET_free (emsg);
GNUNET_assert (0);
uri = GNUNET_FS_uri_to_string (ret);
if (0 !=
strcmp (uri,
- "gnunet://fs/sks/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820/test"))
+ buf))
{
GNUNET_FS_uri_destroy (ret);
GNUNET_free (uri);
return 0;
}
+
static int
testFile (int i)
{
GNUNET_log_setup ("test_fs_uri",
"WARNING",
NULL);
- GNUNET_CRYPTO_random_disable_entropy_gathering ();
failureCount += testKeyword ();
failureCount += testLocation ();
for (i = 0; i < 255; i++)