openssl / openssl

TLS/SSL and crypto library

Home Page:https://www.openssl.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A method for duplicating library context

afshinpir opened this issue · comments

Hi all

I think it will be really useful to have a method for duplicating library context.
For example you create a base library context, then duplicate it and load additional provider in the duplicated one. Somehow similar to how OSSL_LIB_CTX_new_child works, for non-provider developers. This one cannot be used directly at least because of its arguments.

Best Regards

Are you offering to create a pull request for this feature?

@nhorman
No sorry, this is too complex for me to implement. It will be great that someone with enough knowledge does this.

IMO this is a valid feature request that should be considered. It is possible that we might reject it because of the complexity or too low demand for it but it should at least stay opened for a while to be discussed.

I'm less convinced. An application that creates a library context knows what it is doing. Creating a second is just repeating the former.

Let's assume that you need to use legacy provider for a specific reason only and you don't want to use it in normal cases. You may create a main library context for your operations. Then for loading your legacy provider, you will duplicate library context that you have created and load legacy provider inside it. This way is much easier than creating two contexts and loading everything twice in both contexts and then load legacy provider in 2nd context.
But yes, I agree that it will not be used commonly and it is limited to rare cases that someone likes to use multiple contexts at same time.

Ok, based on feedback, moving to consideration