2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2015-12-03 18:31:24 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
typedef struct DnsTrustAnchor DnsTrustAnchor;
|
|
|
|
|
|
|
|
#include "hashmap.h"
|
|
|
|
#include "resolved-dns-answer.h"
|
|
|
|
#include "resolved-dns-rr.h"
|
|
|
|
|
|
|
|
/* This contains a fixed database mapping domain names to DS or DNSKEY records. */
|
|
|
|
|
|
|
|
struct DnsTrustAnchor {
|
2016-01-02 22:12:13 +01:00
|
|
|
Hashmap *positive_by_key;
|
|
|
|
Set *negative_by_name;
|
2016-01-07 20:33:31 +01:00
|
|
|
Set *revoked_by_rr;
|
2015-12-03 18:31:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
int dns_trust_anchor_load(DnsTrustAnchor *d);
|
|
|
|
void dns_trust_anchor_flush(DnsTrustAnchor *d);
|
|
|
|
|
2016-01-02 22:12:13 +01:00
|
|
|
int dns_trust_anchor_lookup_positive(DnsTrustAnchor *d, const DnsResourceKey* key, DnsAnswer **answer);
|
|
|
|
int dns_trust_anchor_lookup_negative(DnsTrustAnchor *d, const char *name);
|
2016-01-04 20:38:21 +01:00
|
|
|
|
2016-01-07 17:03:31 +01:00
|
|
|
int dns_trust_anchor_check_revoked(DnsTrustAnchor *d, DnsResourceRecord *dnskey, DnsAnswer *rrs);
|
2016-01-07 20:33:31 +01:00
|
|
|
int dns_trust_anchor_is_revoked(DnsTrustAnchor *d, DnsResourceRecord *rr);
|