if (NULL != (colon = strchr (lookup_name, ':')))
*colon = '\0';
}
-#ifdef LSD001
- Idna_rc rc;
+
/**
* If DNS compatibility is requested, we first verify that the
* lookup_name is in a DNS format. If yes, we convert it to UTF-8.
*/
if (GNUNET_YES == dns_compat)
{
-#endif
+ Idna_rc rc;
+
if (GNUNET_OK != GNUNET_DNSPARSER_check_name (lookup_name))
{
fprintf (stderr,
global_ret = 3;
return;
}
-#ifdef LSD001
if (IDNA_SUCCESS !=
(rc = idna_to_unicode_8z8z (lookup_name, &idna_name,
IDNA_ALLOW_UNASSIGNED)))
}
lookup_name = idna_name;
}
-#endif
+
if (GNUNET_YES !=
GNUNET_CLIENT_test (cfg,
"arm"))
if (0 == rh->name_resolution_pos)
{
GNUNET_asprintf (&res,
- "%.*s",
- strlen (cname) - (strlen (tld) + 1),
- cname);
+ "%.*s",
+ strlen (cname) - (strlen (tld) + 1),
+ cname);
}
else
{
"%.*s.%.*s",
(int) rh->name_resolution_pos,
rh->name,
- (int) strlen (cname) - (strlen(tld)+1),
+ (int) strlen (cname) - (strlen (tld) + 1),
cname);
}
rh->name_resolution_pos = strlen (res);
n = GNUNET_DNSPARSER_parse_name (rd[i].data,
rd[i].data_size,
&off);
-#ifdef LSD001
ip = GNUNET_strdup (&rd[i].data[off]);
off += strlen (ip) + 1;
-#else
- ip = GNUNET_DNSPARSER_parse_name (rd[i].data,
- rd[i].data_size,
- &off);
-#endif
if ((NULL == n) ||
(NULL == ip) ||
(0 != rh->name_resolution_pos) ? "." : "",
ns);
GNUNET_free (ns);
-#ifdef LSD001
- /* the GNS name is UTF-8 and may include multibyte chars.
- * We have to convert the combined name to a DNS-compatible IDNA.
- */
- char *tmp = ac->label;
- if (IDNA_SUCCESS != idna_to_ascii_8z (tmp, &ac->label, IDNA_ALLOW_UNASSIGNED))
+
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- _ ("Name `%s' cannot be converted to IDNA."), tmp);
- return GNUNET_SYSERR;
+ /* the GNS name is UTF-8 and may include multibyte chars.
+ * We have to convert the combined name to a DNS-compatible IDNA.
+ */
+ char *tmp = ac->label;
+
+ if (IDNA_SUCCESS != idna_to_ascii_8z (tmp,
+ &ac->label,
+ IDNA_ALLOW_UNASSIGNED))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ _ ("Name `%s' cannot be converted to IDNA."),
+ tmp);
+ return GNUNET_SYSERR;
+ }
+ GNUNET_free (tmp);
}
- GNUNET_free (tmp);
-#endif
GNUNET_CONTAINER_DLL_insert_tail (rh->ac_head,
rh->ac_tail,
{
char *argv[] = { "gnunet-gns",
"-r", /* Raw output for easier parsing */
-#ifdef LSD001
"-d", /* DNS compatibility (allow IDNA names, no UTF-8) */
-#endif
"-t",
(AF_INET6 == af) ? "AAAA" : "A",
"-u",
GNUNET_free_non_null (ns);
return NULL;
}
-#ifdef LSD001 //DNS server IP/name must be UTF-8
- ip = GNUNET_strdup((char*) &data[off]);
-#else
- // Must be IP or DNS name
- ip = GNUNET_DNSPARSER_parse_name (data, data_size, &off);
- if ((NULL == ip) || (off != data_size))
- {
- GNUNET_break_op (0);
- GNUNET_free_non_null (ns);
- GNUNET_free_non_null (ip);
- return NULL;
- }
-#endif
+ /* DNS server IP/name must be UTF-8 */
+ ip = GNUNET_strdup ((char*) &data[off]);
GNUNET_asprintf (&nstr, "%s@%s", ns, ip);
GNUNET_free_non_null (ns);
GNUNET_free_non_null (ip);
off = 0;
if (GNUNET_OK != GNUNET_DNSPARSER_builder_add_name (nsbuf,
- sizeof(nsbuf),
- &off,
- cpy))
+ sizeof(nsbuf),
+ &off,
+ cpy))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_ (
GNUNET_free (cpy);
return GNUNET_SYSERR;
}
-#ifdef LSD001 //The DNS server location/name is in UTF-8
+ /* The DNS server location/name is in UTF-8 */
GNUNET_memcpy (&nsbuf[off], at, strlen (at) + 1);
off += strlen (at) + 1;
-#else
- if (GNUNET_OK !=
- GNUNET_DNSPARSER_builder_add_name (nsbuf, sizeof(nsbuf), &off, at))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _ (
- "Failed to serialize GNS2DNS record with value `%s': Not a DNS name\n"),
- s);
- GNUNET_free (cpy);
- return GNUNET_SYSERR;
- }
-#endif
GNUNET_free (cpy);
*data_size = off;
*data = GNUNET_malloc (off);
{
static const char ctx_key[] = "gns-aes-ctx-key";
static const char ctx_iv[] = "gns-aes-ctx-iv";
-/**
- * Next time we break protocol (v12) we harmonize the KDF usage in GNS:
- * We use the strings above as salt and the public key as IKM similar to
- * how derive_h is done in crypto_ecc.c.
- */
-#ifdef LSD001
+
GNUNET_CRYPTO_kdf (skey, sizeof(struct GNUNET_CRYPTO_SymmetricSessionKey),
ctx_key, strlen (ctx_key),
pub, sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
pub, sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
label, strlen (label),
NULL, 0);
-#else
- GNUNET_CRYPTO_kdf (skey, sizeof(struct GNUNET_CRYPTO_SymmetricSessionKey),
- pub, sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
- label, strlen (label),
- ctx_key, strlen (ctx_key),
- NULL, 0);
- GNUNET_CRYPTO_kdf (iv, sizeof(struct
- GNUNET_CRYPTO_SymmetricInitializationVector),
- pub, sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
- label, strlen (label),
- ctx_iv, strlen (ctx_iv),
- NULL, 0);
-#endif
}