summaryrefslogtreecommitdiff
path: root/src/pkg/crypto/x509/x509.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/crypto/x509/x509.go')
-rw-r--r--src/pkg/crypto/x509/x509.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/crypto/x509/x509.go b/src/pkg/crypto/x509/x509.go
index 8dae7e7fc..c4d85e67f 100644
--- a/src/pkg/crypto/x509/x509.go
+++ b/src/pkg/crypto/x509/x509.go
@@ -388,10 +388,10 @@ func (c *Certificate) CheckSignature(algo SignatureAlgorithm, signed, signature
return ErrUnsupportedAlgorithm
}
- h := hashType.New()
- if h == nil {
+ if !hashType.Available() {
return ErrUnsupportedAlgorithm
}
+ h := hashType.New()
h.Write(signed)
digest := h.Sum(nil)