diff --git a/auth.go b/auth.go index a9c6a66..f7c27d5 100644 --- a/auth.go +++ b/auth.go @@ -21,6 +21,9 @@ import ( // verifyHandshakeSignature verifies a signature against unhashed handshake contents. func verifyHandshakeSignature(sigType uint8, pubkey crypto.PublicKey, hashFunc crypto.Hash, signed, sig []byte) error { if hashFunc != directSigning { + if !hashFunc.Available() { + return fmt.Errorf("hash function unavailable: %v", hashFunc) + } h := hashFunc.New() h.Write(signed) signed = h.Sum(nil) diff --git a/cipher_suites.go b/cipher_suites.go index 3cb9fa3..bc508fe 100644 --- a/cipher_suites.go +++ b/cipher_suites.go @@ -13,6 +13,7 @@ import ( "crypto/rc4" "crypto/sha1" "crypto/sha256" + _ "crypto/sha512" // for crypto.SHA384 "fmt" "hash" "runtime"