resolved-dns-trust-anchor.c revision 105e151299dc1208855380be2b22d0db2d66ebc6
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2015 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "alloc-util.h"
#include "resolved-dns-trust-anchor.h"
/* The DS RR from https://data.iana.org/root-anchors/root-anchors.xml */
static const uint8_t root_digest[] =
{ 0x49, 0xAA, 0xC1, 0x1D, 0x7B, 0x6F, 0x64, 0x46, 0x70, 0x2E, 0x54, 0xA1, 0x60, 0x73, 0x71, 0x60,
0x7A, 0x1A, 0x41, 0x85, 0x52, 0x00, 0xFD, 0x2C, 0xE1, 0xCD, 0xDE, 0x32, 0xF2, 0x4E, 0x8F, 0xB5 };
int dns_trust_anchor_load(DnsTrustAnchor *d) {
int r;
assert(d);
if (r < 0)
return r;
return 0;
/* Add the RR from https://data.iana.org/root-anchors/root-anchors.xml */
if (!rr)
return -ENOMEM;
return -ENOMEM;
if (!answer)
return -ENOMEM;
if (r < 0)
return r;
if (r < 0)
return r;
return 0;
}
void dns_trust_anchor_flush(DnsTrustAnchor *d) {
DnsAnswer *a;
assert(d);
while ((a = hashmap_steal_first(d->by_key)))
dns_answer_unref(a);
}
DnsAnswer *a;
assert(d);
/* We only serve DS and DNSKEY RRs. */
return 0;
if (!a)
return 0;
*ret = dns_answer_ref(a);
return 1;
}