Ensure ssl3_final_finish_mac() returns failure if either the MD5 or SHA1
handshake MAC calculation fails. Currently, the result from both
ssl3_handshake_mac() calls is added together. This means that unless both
MD5 and SHA1 fail, a positive value will be returned to the caller,
indicating success rather than failure.

ok deraadt@ miod@ sthen@
Multiple fixes for ssl3_digest_cached_records() - if EVP_MD_CTX_create()
fails, the NULL check will add an error but it does not abort. This will
result in EVP_DigestInit_ex() being called with a NULL context.
Also ensure that we check the return values from EVP_DigestInit_ex() and
EVP_DigestUpdate().

ok deraadt@ miod@
Avoid potential NULL pointer function calls in n_ssl3_mac() by checking
the return value of EVP_MD_CTX_copy_ex(). If the copy fails early then
EVP_DigestUpdate() will invoke md_ctx.update(), which will be a NULL
function pointer.

Analysis and patch from David Ramos.

ok deraadt@