-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial fetching of MD and Cipher objects from OpenSSL(3) #1431
Conversation
We need init them and free them in one place to avoid threading issues.
Related: #1427 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need init them and free them in one place to avoid threading issues.
What about using
Line 197 in b1d42d6
OQS_API void OQS_init(void) { |
init
and close
to all OQS operations.
Thanks! It's quite reasonable |
But then again -- is this really sufficient? Are these EVP objects thread-safe? What if someone calls in different threads different OpenSSL APIs, all reaching into The documentation states
|
EVP_MD and EVP_CIPHER objects should be thread-safe - they are just sets of callbacks and flags. The problem may happen if the provider providing them is unloaded. |
Good. I don't see how this should be facilitated by an application that is using If |
I groomed the code according my understanding of how it goes. Consequence: |
At this point I'm waiting for your feedback whether we should follow this direction as a whole or not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point I'm waiting for your feedback whether we should follow this direction as a whole or not
As far as I'm concerned, it does. The one thing not looking good (also as per CI) is that the ossl_helper functions should be namespaced: Proposal would be "oqs_ossl_xyz" (instead of just "_xyz")
I will adjust namespace, but also init and free functions must be documented as mandatory... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much again for your contribution: Very much appreciated! Don't feel stopped to address/comment on the single comments I just made -- but if you have more urgent things to do, we'll follow up accordingly.
I'm going to add OQS_destroy function and call it in the tests. I'd like to finalize this issue if we have an agreement what should be done |
Good for me -- provided the comment here, gets updated (making the invocation of |
So. I finished what I understood was worth doing. Could you please specify what are the next steps to deal with it? Is there anything to be done by me just now or it can be merged as is and we could move forward? |
src/common/common.h
Outdated
* This currently only sets the values in the OQS_CPU_EXTENSIONS, | ||
* and so has effect only when OQS_DIST_BUILD is set. | ||
* This currently sets the values in the OQS_CPU_EXTENSIONS | ||
* and prefetches the OpenSSL obejcts if necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo. Can deal with when doing next doc review. Would also recommend phrasing more strongly along the lines of "Needs to be invoked to ensure proper operation of library."
Not really. Thanks again for the contribution.
Yes from my perspective but I leave the merge to another team member (@dstebila : Back again?) |
Hi @beldmit , would it make sense to replace EVP_aes_256_ecb() in src/common/rand/rand_nist.c? |
Probably yes, if this code is used multiple times. |
We need init them and free them in one place to avoid threading issues.