summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/miekg/dns/dane.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/miekg/dns/dane.go')
-rw-r--r--vendor/github.com/miekg/dns/dane.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/vendor/github.com/miekg/dns/dane.go b/vendor/github.com/miekg/dns/dane.go
index cdaa833ff..8c4a14ef1 100644
--- a/vendor/github.com/miekg/dns/dane.go
+++ b/vendor/github.com/miekg/dns/dane.go
@@ -6,7 +6,6 @@ import (
"crypto/x509"
"encoding/hex"
"errors"
- "io"
)
// CertificateToDANE converts a certificate to a hex string as used in the TLSA or SMIMEA records.
@@ -23,20 +22,20 @@ func CertificateToDANE(selector, matchingType uint8, cert *x509.Certificate) (st
h := sha256.New()
switch selector {
case 0:
- io.WriteString(h, string(cert.Raw))
+ h.Write(cert.Raw)
return hex.EncodeToString(h.Sum(nil)), nil
case 1:
- io.WriteString(h, string(cert.RawSubjectPublicKeyInfo))
+ h.Write(cert.RawSubjectPublicKeyInfo)
return hex.EncodeToString(h.Sum(nil)), nil
}
case 2:
h := sha512.New()
switch selector {
case 0:
- io.WriteString(h, string(cert.Raw))
+ h.Write(cert.Raw)
return hex.EncodeToString(h.Sum(nil)), nil
case 1:
- io.WriteString(h, string(cert.RawSubjectPublicKeyInfo))
+ h.Write(cert.RawSubjectPublicKeyInfo)
return hex.EncodeToString(h.Sum(nil)), nil
}
}