7101901 Apache HTTP server crashes when tested with TLSv1 using OpenSSL pkcs11 engine
authorHuie-Ying Lee <huieying.lee@oracle.com>
Thu, 17 Nov 2011 16:59:01 -0800
changeset 588 a72cfdd57701
parent 587 9cc973a7ad62
child 589 beabcdec3918
7101901 Apache HTTP server crashes when tested with TLSv1 using OpenSSL pkcs11 engine
components/openssl/openssl-1.0.0/engines/pkcs11/hw_pk11.c
--- a/components/openssl/openssl-1.0.0/engines/pkcs11/hw_pk11.c	Thu Nov 17 14:40:44 2011 -0800
+++ b/components/openssl/openssl-1.0.0/engines/pkcs11/hw_pk11.c	Thu Nov 17 16:59:01 2011 -0800
@@ -2911,9 +2911,12 @@
 	CK_BYTE_PTR pstate = NULL;
 	CK_ULONG ul_state_len;
 
+	if (from->md_data == NULL || to->digest->ctx_size == 0)
+		return (1);
+
 	/* The copy-from state */
 	state = (PK11_CIPHER_STATE *) from->md_data;
-	if (state == NULL || state->sp == NULL)
+	if (state->sp == NULL)
 		goto err;
 
 	/* Initialize the copy-to state */