Yet another update to PKCS#11 engine patch
When working on 6540060 I found another race regarding engine use in multithreaded environment, for example Apache in a worker mode. I fixed it today in Nevada:
- 6558630 race in OpenSSL pkcs11 engine when using symetric block ciphers
Updated engine patches against latest source code releases of OpenSSL: pkcs11_engine-0.9.7m.patch.2007-05-25 (README), pkcs11_engine-0.9.8e.patch.2007-05-25 (README).
Escalations have been filed and I hope we might get that to upcoming S10u4, and also both CR's included in previous versions of the patch - 6540060, 6554248.
Posted by conormc on May 29, 2007 at 02:19 PM CEST #
Posted by Tony on June 17, 2007 at 11:04 PM CEST #
Posted by Tony on June 17, 2007 at 11:11 PM CEST #
Posted by Jan on June 17, 2007 at 11:15 PM CEST #
Posted by conormc on June 22, 2007 at 02:30 PM CEST #
Posted by John Dickinson on June 26, 2007 at 05:41 PM CEST #
Posted by Jan on June 28, 2007 at 07:14 PM CEST #
Posted by John Dickinson on June 29, 2007 at 10:21 AM CEST #
just to confirm - so far, we support SO_PATH control command only, not PIN or other commands as OpenSC does. The main reason for the engine was to access hardware crypto accelerators connected to the Solaris Crypto Framework.
Posted by Jan on July 03, 2007 at 04:13 PM CEST #
Hi Jan, Thanks for your PKCS11 engine for OpenSSL.
I am seeing its source code and have a question.
At hw_pk11.c:1992 [in pk11_choose_slot function], following if loop is there.
if (!found_candidate_slot && (slot_has_rsa || slot_has_dsa || slot_has_dh)). Documentation in the beginning of that function says that rsa, dsa and dh are required mechanisms for choosing slot. But in the code, you have put (slot_has_rsa || slot_has_dsa || slot_has_dh) which will be evaluated to true if one of either 3 algos is present. Once the control goes into if loop, values of pk11_have_rsa, pk11_have_dsa and pk11_have_dh are set and can't be changed as this if loop is entered only once. My question is whether this is a mistake in documentation or a bug in logic?
Please let me know if I am missing anything, if it is not a valid problem.
Thanks
DP
Posted by DP on August 22, 2007 at 01:25 PM CEST #
hi DP, I haven't written the code, but what I can see is that the slot with partial set of mechanisms is chosen only if it's the first slot that have at least "something"; see "!" in the condition predicate.
You can see in the code that follows that if there are slots that have more mechanisms, they are chosen after that.
It's logical - better to pick a slot that have, say, RSA/DH only (and not DSA) than no slot.
Yes, the comment is a little bit misleading.
Posted by Jan on September 04, 2007 at 06:55 PM CEST #