Die earlier if we have no hash function.
authorBen Laurie <ben@openssl.org>
Mon, 29 Dec 2008 11:46:44 +0000 (11:46 +0000)
committerBen Laurie <ben@openssl.org>
Mon, 29 Dec 2008 11:46:44 +0000 (11:46 +0000)
ssl/s3_enc.c

index 8e484d3..701ac57 100644 (file)
@@ -709,6 +709,8 @@ int ssl3_mac(SSL *ssl, unsigned char *md, int send)
                hash=ssl->read_hash;
                }
 
                hash=ssl->read_hash;
                }
 
+       /* If hash is NULL, then a crash will follow anyway */
+       OPENSSL_assert(hash);
        md_size=EVP_MD_CTX_size(hash);
        npad=(48/md_size)*md_size;
 
        md_size=EVP_MD_CTX_size(hash);
        npad=(48/md_size)*md_size;