else
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result found: `%s'\n", n);
- if (0 != strcmp(n, s_name))
+ if ((n == NULL) || (0 != strcmp(n, s_name)))
{
fail = GNUNET_YES;
GNUNET_break (0);
fail = GNUNET_YES;
GNUNET_break (0);
}
- if (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))
+ if ((zone_key == NULL) || (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded))))
{
fail = GNUNET_YES;
GNUNET_break (0);
delete_existing_db(cfg);
endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
- GNUNET_asprintf(&s_name, "dummy.dummy.gnunet");
+ GNUNET_asprintf(&s_name, "dummy");
/* load privat key */
- privkey = GNUNET_CRYPTO_rsa_key_create_from_file("hostkey");
+ char *hostkey_file;
+ GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, "4UCICULTINKC87UO4326KEEDQ9MTEP2AJT88MJFVGTGNK12QNGMQI2S41VI07UUU6EO19BTB06PDL0HE6VP1OM50HOJEI75RHP4JP80.zkey");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
+ privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file);
+ GNUNET_free (hostkey_file);
GNUNET_assert (privkey != NULL);
/* get public key */
GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey);
GNUNET_break (NULL != nsh);
expire = GNUNET_TIME_absolute_get ();
- s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_name, &rd, 1);
+ s_signature = GNUNET_NAMESTORE_create_signature(privkey, rd.expiration, s_name, &rd, 1);
GNUNET_NAMESTORE_record_put(nsh, &pubkey, s_name, expire, 1, &rd, s_signature, put_cont, NULL);
GNUNET_free ((void *) rd.data);