MCPcopy Create free account
hub / github.com/foxcpp/maddy / AuthLookupTLSA

Method AuthLookupTLSA

framework/dns/dnssec.go:347–374  ·  view source on GitHub ↗
(ctx context.Context, service, network, domain string)

Source from the content-addressed store, hash-verified

345}
346
347func (e ExtResolver) AuthLookupTLSA(ctx context.Context, service, network, domain string) (ad bool, recs []TLSA, err error) {
348 name, err := dns.TLSAName(domain, service, network)
349 if err != nil {
350 return false, nil, err
351 }
352
353 msg := new(dns.Msg)
354 msg.SetQuestion(dns.Fqdn(name), dns.TypeTLSA)
355 msg.SetEdns0(4096, false)
356 msg.AuthenticatedData = true
357
358 resp, err := e.exchange(ctx, msg)
359 if err != nil {
360 return false, nil, err
361 }
362
363 ad = resp.AuthenticatedData
364 recs = make([]dns.TLSA, 0, len(resp.Answer))
365 for _, rr := range resp.Answer {
366 rr, ok := rr.(*dns.TLSA)
367 if !ok {
368 continue
369 }
370
371 recs = append(recs, *rr)
372 }
373 return
374}
375
376func NewExtResolver() (*ExtResolver, error) {
377 cfg, err := dns.ClientConfigFromFile("/etc/resolv.conf")

Callers

nothing calls this directly

Calls 1

exchangeMethod · 0.95

Tested by

no test coverage detected