1.6.17
+ * New RR types NINFO, RKEY, CDS, EUI48, EUI64 & TA.
+ * Fix b{32,64}_{ntop,pton} detection and handling.
+ * -T option for ldns-dane that has specific exit status for PKIX
+ validated connections without (secure) TLSA records.
+ * Bind to source address for resolvers. drill binds to source with -I.
+ Thanks Bryan Duff.
* README now shows preferred way to configure for examples and drill.
* Miscellaneous prototype fixes. Thanks Dag-Erling Smørgrav.
+ * Make sure executables are linked against libcrypto with the
+ LIBSSL_LDFLAGS. Thanks Leo Baltus.
* Add --disable-dane option to configure and check availability of the
for dane needed X509_check_ca function in openssl.
* Fix ldns_dnssec_zone_new_frm_fp_l to allow the last parsed line of a
zone to be an NSEC3 (or its RRSIG) covering an empty non terminal.
- * Make sure executables are linked against libcrypto with the
- LIBSSL_LDFLAGS. Thanks Leo Baltus.
1.6.16 2012-11-13
* Fix Makefile to build pyldns with BSD make
"did not end in a self-signed certificate" },
{ LDNS_STATUS_INVALID_ILNP64,
"Conversion error, 4 colon seperated hex numbers expected" },
+ { LDNS_STATUS_INVALID_EUI48,
+ "Conversion error, 6 two character hex numbers "
+ "seperated by dashes expected (i.e. xx-xx-xx-xx-xx-xx" },
+ { LDNS_STATUS_INVALID_EUI64,
+ "Conversion error, 8 two character hex numbers "
+ "seperated by dashes expected (i.e. xx-xx-xx-xx-xx-xx-xx-xx" },
{ 0, NULL }
};
return ldns_buffer_status(output);
}
+ldns_status
+ldns_rdf2buffer_str_eui48(ldns_buffer *output, const ldns_rdf *rdf)
+{
+ ldns_buffer_printf(output,"%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
+ ldns_rdf_data(rdf)[0], ldns_rdf_data(rdf)[1],
+ ldns_rdf_data(rdf)[2], ldns_rdf_data(rdf)[3],
+ ldns_rdf_data(rdf)[4], ldns_rdf_data(rdf)[5]);
+ return ldns_buffer_status(output);
+}
+
+ldns_status
+ldns_rdf2buffer_str_eui64(ldns_buffer *output, const ldns_rdf *rdf)
+{
+ ldns_buffer_printf(output,"%.2x-%.2x-%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
+ ldns_rdf_data(rdf)[0], ldns_rdf_data(rdf)[1],
+ ldns_rdf_data(rdf)[2], ldns_rdf_data(rdf)[3],
+ ldns_rdf_data(rdf)[4], ldns_rdf_data(rdf)[5],
+ ldns_rdf_data(rdf)[6], ldns_rdf_data(rdf)[7]);
+ return ldns_buffer_status(output);
+}
+
ldns_status
ldns_rdf2buffer_str(ldns_buffer *buffer, const ldns_rdf *rdf)
{
case LDNS_RDF_TYPE_ILNP64:
res = ldns_rdf2buffer_str_ilnp64(buffer, rdf);
break;
+ case LDNS_RDF_TYPE_EUI48:
+ res = ldns_rdf2buffer_str_eui48(buffer, rdf);
+ break;
+ case LDNS_RDF_TYPE_EUI64:
+ res = ldns_rdf2buffer_str_eui64(buffer, rdf);
+ break;
}
} else {
/** This will write mangled RRs */
LDNS_STATUS_DANE_PKIX_DID_NOT_VALIDATE,
LDNS_STATUS_DANE_PKIX_NO_SELF_SIGNED_TRUST_ANCHOR,
LDNS_STATUS_EXISTS_ERR,
- LDNS_STATUS_INVALID_ILNP64
+ LDNS_STATUS_INVALID_ILNP64,
+ LDNS_STATUS_INVALID_EUI48,
+ LDNS_STATUS_INVALID_EUI64
};
typedef enum ldns_enum_status ldns_status;
ldns_status ldns_rdf2buffer_str_ilnp64(ldns_buffer *output,
const ldns_rdf *rdf);
+/**
+ * Converts an LDNS_RDF_TYPE_EUI48 rdata element to 6 hexadecimal numbers
+ * seperated by dashes and adds it to the output buffer
+ * \param[in] *rdf The rdata to convert
+ * \param[in] *output The buffer to add the data to
+ * \return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_eui48(ldns_buffer *output,
+ const ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_EUI64 rdata element to 8 hexadecimal numbers
+ * seperated by dashes and adds it to the output buffer
+ * \param[in] *rdf The rdata to convert
+ * \param[in] *output The buffer to add the data to
+ * \return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_eui64(ldns_buffer *output,
+ const ldns_rdf *rdf);
+
/**
* Converts the data in the rdata field to presentation format and
* returns that as a char *.
/** nsec3 base32 string (with length byte on wire */
LDNS_RDF_TYPE_NSEC3_NEXT_OWNER,
/** 4 shorts represented as 4 * 16 bit hex numbers seperated by colons */
- LDNS_RDF_TYPE_ILNP64
+ LDNS_RDF_TYPE_ILNP64,
+ /** EUI48; 6 * 8 bit hex numbers seperated by dashes */
+ LDNS_RDF_TYPE_EUI48,
+ /** EUI64; 8 * 8 bit hex numbers seperated by dashes */
+ LDNS_RDF_TYPE_EUI64
};
typedef enum ldns_enum_rdf_type ldns_rdf_type;
LDNS_RR_TYPE_L64 = 106, /* RFC 6742 */
LDNS_RR_TYPE_LP = 107, /* RFC 6742 */
+ /** draft-jabley-dnsext-eui48-eui64-rrtypes */
+ LDNS_RR_TYPE_EUI48 = 108,
+ LDNS_RR_TYPE_EUI64 = 109,
+
LDNS_RR_TYPE_TSIG = 250,
LDNS_RR_TYPE_IXFR = 251,
LDNS_RR_TYPE_AXFR = 252,
*/
ldns_status ldns_str2rdf_ilnp64(ldns_rdf **rd, const char *str);
+/**
+ * convert 6 hex bytes seperated by dashes into wireformat
+ * \param[in] rd the rdf where to put the data
+ * \param[in] str the string to be converted
+ * \return ldns_status
+ */
+ldns_status ldns_str2rdf_eui48(ldns_rdf **rd, const char *str);
+
+/**
+ * convert 8 hex bytes seperated by dashes into wireformat
+ * \param[in] rd the rdf where to put the data
+ * \param[in] str the string to be converted
+ * \return ldns_status
+ */
+ldns_status ldns_str2rdf_eui64(ldns_rdf **rd, const char *str);
+
#ifdef __cplusplus
}
#endif
case LDNS_RDF_TYPE_ILNP64:
status = ldns_str2rdf_ilnp64(&rdf, str);
break;
+ case LDNS_RDF_TYPE_EUI48:
+ status = ldns_str2rdf_eui48(&rdf, str);
+ break;
+ case LDNS_RDF_TYPE_EUI64:
+ status = ldns_str2rdf_eui64(&rdf, str);
+ break;
case LDNS_RDF_TYPE_NONE:
default:
/* default default ??? */
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_DNAME
};
+static const ldns_rdf_type type_eui48_wireformat[] = {
+ LDNS_RDF_TYPE_EUI48
+};
+static const ldns_rdf_type type_eui64_wireformat[] = {
+ LDNS_RDF_TYPE_EUI64
+};
/** \endcond */
/** \cond */
{LDNS_RR_TYPE_L64, "L64", 2, 2, type_l64_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 107 */
{LDNS_RR_TYPE_LP, "LP", 2, 2, type_lp_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
-{LDNS_RR_TYPE_NULL, "TYPE108", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE109", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* 108 */
+{LDNS_RR_TYPE_EUI48, "EUI48", 1, 1, type_eui48_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* 109 */
+{LDNS_RR_TYPE_EUI64, "EUI64", 1, 1, type_eui64_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE110", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE111", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE112", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
}
return *rd ? LDNS_STATUS_OK : LDNS_STATUS_MEM_ERR;
}
+
+ldns_status
+ldns_str2rdf_eui48(ldns_rdf **rd, const char *str)
+{
+ unsigned int a, b, c, d, e, f;
+ uint8_t bytes[6];
+ int l;
+
+ if (sscanf(str, "%2x-%2x-%2x-%2x-%2x-%2x%n",
+ &a, &b, &c, &d, &e, &f, &l) != 6 ||
+ l != (int)strlen(str) || /* more data to read */
+ strpbrk(str, "+-") /* signed hexes */
+ ) {
+ return LDNS_STATUS_INVALID_EUI48;
+ } else {
+ bytes[0] = a;
+ bytes[1] = b;
+ bytes[2] = c;
+ bytes[3] = d;
+ bytes[4] = e;
+ bytes[5] = f;
+ *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_EUI48, 6, &bytes);
+ }
+ return *rd ? LDNS_STATUS_OK : LDNS_STATUS_MEM_ERR;
+}
+
+ldns_status
+ldns_str2rdf_eui64(ldns_rdf **rd, const char *str)
+{
+ unsigned int a, b, c, d, e, f, g, h;
+ uint8_t bytes[8];
+ int l;
+
+ if (sscanf(str, "%2x-%2x-%2x-%2x-%2x-%2x-%2x-%2x%n",
+ &a, &b, &c, &d, &e, &f, &g, &h, &l) != 8 ||
+ l != (int)strlen(str) || /* more data to read */
+ strpbrk(str, "+-") /* signed hexes */
+ ) {
+ return LDNS_STATUS_INVALID_EUI64;
+ } else {
+ bytes[0] = a;
+ bytes[1] = b;
+ bytes[2] = c;
+ bytes[3] = d;
+ bytes[4] = e;
+ bytes[5] = f;
+ bytes[6] = g;
+ bytes[7] = h;
+ *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_EUI64, 8, &bytes);
+ }
+ return *rd ? LDNS_STATUS_OK : LDNS_STATUS_MEM_ERR;
+}
cur_rdf_length = LDNS_RDF_SIZE_DOUBLEWORD;
break;
case LDNS_RDF_TYPE_TSIGTIME:
+ case LDNS_RDF_TYPE_EUI48:
cur_rdf_length = LDNS_RDF_SIZE_6BYTES;
break;
case LDNS_RDF_TYPE_ILNP64:
+ case LDNS_RDF_TYPE_EUI64:
cur_rdf_length = LDNS_RDF_SIZE_8BYTES;
break;
case LDNS_RDF_TYPE_AAAA: