From 6142025a50a3d22cd323d693085e7198dd328214 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Fri, 14 Sep 2012 14:29:52 +0200 Subject: [PATCH] more DANE stuff --- tlsa.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tlsa.go b/tlsa.go index 3ddf56e1..297873c3 100644 --- a/tlsa.go +++ b/tlsa.go @@ -50,7 +50,6 @@ func (r *RR_TLSA) Sign(usage, selector, matchingType int, cert *x509.Certificate r.Usage = uint8(usage) r.Selector = uint8(selector) r.MatchingType = uint8(matchingType) - // Checks on the value!? r.Certificate = certToTLSACert(r.Selector, r.MatchingType, cert) return nil @@ -65,16 +64,16 @@ func (r *RR_TLSA) Verify(cert *x509.Certificate) error { return ErrSig // ErrSig, really? } -// Name set the ownername of the TLSA record according to the -// rules specified in RFC 6698, Section 3. -func (r *RR_TLSA) Name(name, service, network string) bool { +// TLSAName returns the ownername of a TLSA resource record as per the +// rules specified in RFC 6698, Section 3. When an erros occurs the +// empty string is returned. +func TLSAName(name, service, network string) string { if !IsFqdn(name) { - return false + return "" } p, e := net.LookupPort(network, service) if e != nil { - return false + return "" } - r.Hdr.Name = "_" + strconv.Itoa(p) + "_" + network + "." + name - return true + return "_" + strconv.Itoa(p) + "_" + network + "." + name }