summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-rr.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-08-03 16:44:49 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-08-03 22:02:32 -0400
commitff3d6560bead6879a2fed1bf99bfe8273b3723f1 (patch)
tree4d69e1598f16bc613e6fd7d9febe0665184abcd2 /src/resolve/resolved-dns-rr.c
parent8db0d2f5c37e7e8f5bfce016cfdad7947a3ea939 (diff)
downloadsystemd-ff3d6560bead6879a2fed1bf99bfe8273b3723f1.tar.gz
resolved: add identifiers for dnssec algorithms
Diffstat (limited to 'src/resolve/resolved-dns-rr.c')
-rw-r--r--src/resolve/resolved-dns-rr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c
index ada7333a69..bc0cbef92e 100644
--- a/src/resolve/resolved-dns-rr.c
+++ b/src/resolve/resolved-dns-rr.c
@@ -584,19 +584,25 @@ int dns_resource_record_to_string(const DnsResourceRecord *rr, char **ret) {
return -ENOMEM;
break;
- case DNS_TYPE_DNSKEY:
+ case DNS_TYPE_DNSKEY: {
+ const char *alg;
+
+ alg = dnssec_algorithm_to_string(rr->dnskey.algorithm);
+
t = hexmem(rr->dnskey.key, rr->dnskey.key_size);
if (!t)
return -ENOMEM;
- r = asprintf(&s, "%s %u 3 %u %s",
+ r = asprintf(&s, "%s %u 3 %.*s%.*u %s",
k,
dnskey_to_flags(rr),
- rr->dnskey.algorithm,
+ alg ? -1 : 0, alg,
+ alg ? 0 : 1, alg ? 0u : (unsigned) rr->dnskey.algorithm,
t);
if (r < 0)
return -ENOMEM;
break;
+ }
default:
t = hexmem(rr->generic.data, rr->generic.size);