- static const struct GNUNET_SERVER_MessageHandler handlers[] = {
- {&handle_get, NULL, GNUNET_MESSAGE_TYPE_W32RESOLVER_REQUEST, 0},
- {NULL, NULL, 0, 0}
- };
-
- char* keyfile;
- struct GNUNET_CRYPTO_EccPrivateKey *key = NULL;
- struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey;
- struct GNUNET_CRYPTO_ShortHashAsciiEncoded zonename;
-
- if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
- "ZONEKEY", &keyfile))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "No private key for root zone found, using default!\n");
- zone = NULL;
- }
- else
- {
- if (GNUNET_YES == GNUNET_DISK_file_test (keyfile))
- {
- key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
- GNUNET_CRYPTO_ecc_key_get_public (key, &pkey);
- GNUNET_CRYPTO_short_hash(&pkey,
- sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded),
- &user_zone);
- zone = &user_zone;
- GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Using zone: %s!\n", &zonename);
- GNUNET_CRYPTO_ecc_key_free(key);
- }
- GNUNET_free(keyfile);
- }
-
- if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
- "SHORTEN_ZONEKEY", &keyfile))