/**
* Front page. (/)
*/
-#define MAIN_PAGE "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><html><head><title>GNUnet FCFS Authority Name Registration Service</title></head><body><form action=\"S\" method=\"post\">What is your desired domain name? (63 characters, no dots allowed.) <input type=\"text\" name=\"domain\" /> <p> What is your public key? (Copy from gnunet-setup.) <input type=\"text\" name=\"pkey\" /> <input type=\"submit\" value=\"Next\" /><br/><a href=/fcfs/Zoneinfo> List of all registered names </a></body></html>"
+#define MAIN_PAGE "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><html><head><title>GNUnet FCFS Authority Name Registration Service</title></head><body><form action=\"S\" method=\"post\">What is your desired domain name? (at most 63 lowercase characters, no dots allowed.) <input type=\"text\" name=\"domain\" /> <p> What is your public key? (Copy from gnunet-setup.) <input type=\"text\" name=\"pkey\" /> <input type=\"submit\" value=\"Next\" /><br/><a href=./Zoneinfo> List of all registered names </a></body></html>"
/**
* Second page (/S)
/**
* Fcfs zoneinfo page (/Zoneinfo)
*/
-#define ZONEINFO_PAGE "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><html><head><title>%s</title></head><body><h1> FCFS Zoneinfo </h1><table border=\"1\"><th>name</th><th>PKEY</th>%s</table></body></html>"
+#define ZONEINFO_PAGE "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><html><head><title>FCFS Zoneinfo</title></head><body><h1> FCFS Zoneinfo </h1><table border=\"1\"><th>name</th><th>PKEY</th>%s</table></body></html>"
#define FCFS_ZONEINFO_URL "/Zoneinfo"
/**
* Private key for the fcfsd zone.
*/
-static struct GNUNET_CRYPTO_RsaPrivateKey *fcfs_zone_pkey;
+static struct GNUNET_CRYPTO_EccPrivateKey *fcfs_zone_pkey;
/**
static void
iterate_cb (void *cls,
- const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key,
+ const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key,
struct GNUNET_TIME_Absolute expire,
const char *name,
unsigned int rd_len,
const struct GNUNET_NAMESTORE_RecordData *rd,
- const struct GNUNET_CRYPTO_RsaSignature *signature)
+ const struct GNUNET_CRYPTO_EccSignature *signature)
{
struct ZoneinfoRequest *zr = cls;
struct MHD_Response *response;
rd->data,
rd->data_size);
- if (bytes_free < (strlen (name) + strlen (pkey) + 10))
+ if (bytes_free < (strlen (name) + strlen (pkey) + 40))
{
new_buf = GNUNET_malloc (zr->buf_len * 2);
memcpy (new_buf, zr->zoneinfo, zr->write_offset);
GNUNET_free (zr->zoneinfo);
zr->zoneinfo = new_buf;
+ zr->buf_len *= 2;
}
-
- sprintf (zr->zoneinfo+zr->write_offset, "<tr><td>%s</td><td>%s</td></tr>", name, pkey);
-
+ sprintf (zr->zoneinfo + zr->write_offset,
+ "<tr><td>%s</td><td>%s</td></tr>",
+ name,
+ pkey);
zr->write_offset = strlen (zr->zoneinfo);
GNUNET_NAMESTORE_zone_iterator_next (zr->list_it);
GNUNET_free (pkey);
*/
static void
zone_to_name_cb (void *cls,
- const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key,
+ const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key,
struct GNUNET_TIME_Absolute expire,
const char *name,
unsigned int rd_count,
const struct GNUNET_NAMESTORE_RecordData *rd,
- const struct GNUNET_CRYPTO_RsaSignature *signature)
+ const struct GNUNET_CRYPTO_EccSignature *signature)
{
struct Request *request = cls;
struct GNUNET_NAMESTORE_RecordData r;
*/
static void
lookup_result_processor (void *cls,
- const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key,
+ const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key,
struct GNUNET_TIME_Absolute expire,
const char *name,
unsigned int rd_count,
const struct GNUNET_NAMESTORE_RecordData *rd,
- const struct GNUNET_CRYPTO_RsaSignature *signature)
+ const struct GNUNET_CRYPTO_EccSignature *signature)
{
struct Request *request = cls;
struct GNUNET_CRYPTO_ShortHashCode pub;
}
+#define UNSIGNED_MHD_LONG_LONG unsigned MHD_LONG_LONG
+
+
/**
* Schedule tasks to run MHD server.
*/
struct GNUNET_NETWORK_FDSet *wes;
int max;
int haveto;
- unsigned MHD_LONG_LONG timeout;
+ UNSIGNED_MHD_LONG_LONG timeout;
struct GNUNET_TIME_Relative tv;
FD_ZERO (&rs);
}
if (NULL != fcfs_zone_pkey)
{
- GNUNET_CRYPTO_rsa_key_free (fcfs_zone_pkey);
+ GNUNET_CRYPTO_ecc_key_free (fcfs_zone_pkey);
fcfs_zone_pkey = NULL;
}
}
{
char *keyfile;
unsigned long long port;
- struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pub;
+ struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pub;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_number (cfg,
"HTTPPORT",
&port))
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Option `%s' not specified in configuration section `%s'\n"),
- "HTTPPORT",
- "fcfsd");
- return;
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "fcfsd", "HTTPPORT");
+ return;
}
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (cfg,
"ZONEKEY",
&keyfile))
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Option `%s' not specified in configuration section `%s'\n"),
- "ZONEKEY",
- "fcfsd");
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "fcfsd", "ZONEKEY");
return;
}
- fcfs_zone_pkey = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile);
+ fcfs_zone_pkey = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
GNUNET_free (keyfile);
if (NULL == fcfs_zone_pkey)
{
_("Failed to read or create private zone key\n"));
return;
}
- GNUNET_CRYPTO_rsa_key_get_public (fcfs_zone_pkey,
+ GNUNET_CRYPTO_ecc_key_get_public (fcfs_zone_pkey,
&pub);
GNUNET_CRYPTO_short_hash (&pub, sizeof (pub), &fcfsd_zone);
ns = GNUNET_NAMESTORE_connect (cfg);
_("GNUnet GNS first come first serve registration service"),
options,
&run, NULL)) ? 0 : 1;
-
+ GNUNET_free ((void*) argv);
return ret;
}