# HG changeset patch # User Huie-Ying Lee # Date 1321577941 28800 # Node ID a72cfdd57701f010990aae1b698c370bff3c48e8 # Parent 9cc973a7ad6263a8d357f9c135e2ae9b5e288f35 7101901 Apache HTTP server crashes when tested with TLSv1 using OpenSSL pkcs11 engine diff -r 9cc973a7ad62 -r a72cfdd57701 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 */