aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2022-06-14 21:20:48 +0200
committerRasmus Dahlberg <rasmus@mullvad.net>2022-06-21 19:46:54 +0200
commit722e48feb2aa85d8cb75069a06024e506367e34f (patch)
tree26d77f2b6cd73779ab9874693dc92fcafdbc1a3e /pkg
parentf28d4c28fc553506e01bee3488eaa772e683194b (diff)
add DummyResolverHEADv0.0.9main
Can be used to disable DNS checks.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/dns/dns.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/dns/dns.go b/pkg/dns/dns.go
index 606ce7b..9cac60e 100644
--- a/pkg/dns/dns.go
+++ b/pkg/dns/dns.go
@@ -31,6 +31,13 @@ func NewDefaultResolver() Verifier {
return &DefaultResolver{}
}
+type DummyResolver struct {
+}
+
+func NewDummyResolver() Verifier {
+ return &DummyResolver{}
+}
+
func (dr *DefaultResolver) Verify(ctx context.Context, name string, pub *types.PublicKey) error {
if err := validPrefix(name); err != nil {
return fmt.Errorf("dns: %s", err)
@@ -61,3 +68,7 @@ func validPrefix(name string) error {
}
return nil
}
+
+func (_ *DummyResolver) Verify(_ context.Context, _ string, _ *types.PublicKey) error {
+ return nil
+}