Skip to content

Comments

WIP: OSSL_STORE for providers#9389

Closed
levitte wants to merge 5 commits intoopenssl:masterfrom
levitte:ossl_store-for-providers
Closed

WIP: OSSL_STORE for providers#9389
levitte wants to merge 5 commits intoopenssl:masterfrom
levitte:ossl_store-for-providers

Conversation

@levitte
Copy link
Member

@levitte levitte commented Jul 15, 2019

This is a very early draft, just to show a line of thought to implement this.

@levitte levitte added the branch: master Applies to master branch label Jul 15, 2019
@levitte
Copy link
Member Author

levitte commented Jul 15, 2019

@petrovr, I think you're interested. It should start to answer questions you have asked recently.

@petrovr
Copy link

petrovr commented Jul 17, 2019 via email

@levitte
Copy link
Member Author

levitte commented Jul 17, 2019

Right now it look like separate functionality and at moment I cannot see relation to key management.

It's for internal management of keys that are stored in the provider. Without that, we would have to replicate its functionality in every public key operation type (such as keyexch) we create.

I could have placed the OSSL_STORE stuff in KEYMGMT, but since OSSL_STORE handles more than just keys, that doesn't seem appropriate.

@levitte
Copy link
Member Author

levitte commented Jul 17, 2019

What I just failed to say is that there's a need for something that manages the relationship between an EVP_PKEY and the key data that the provider modules hold. That's what KEYMGMT does.

@levitte levitte mentioned this pull request Jul 22, 2019
2 tasks
@opensignature
Copy link
Contributor

Well, I like that something moves about Providers / STORE / KEYMGMT.
To actively participate I still need time but I will follow this PR with interest.

This is made in the same fashion as the EVP_PKEY_*_fromdata functions,
for uniformity.
This adds a new function, OSSL_STORE_open_ex(), which works like
OSSL_STORE_open(), but also takes a library context and a property
query string.
@levitte levitte force-pushed the ossl_store-for-providers branch from 249aa54 to cea5f6a Compare January 5, 2020 20:33
@levitte
Copy link
Member Author

levitte commented Jan 5, 2020

I've done a bit of an update. It's not at all ready yet to get out of WIP, but getting closer.

One thing I added today was the provider interface documentation, doc/man7/provider-store.pod. I would very much appreciate if some would read it and comment on it, as I hope it will answer some questions that have been left unanswered. @petrovr, that may interest you specifically, I do hope that with I've written makes better sense to you.


A STORE implementation may pass an object in raw encoded form in the
"rawdata" form, and indicate the encoding with "rawencoding".
Currently, the only supported encoding is "DER".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we specifically reject non-DER BER/etc.?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are certain non-DER features that we don't support, yeah

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not a terribly confidence-inspiring answer -- if we claim to only support "DER" I would interpret that to be "strict DER" and that we reject all non-DER features, not just some of them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, strictly speaking, we will support whatever the d2i functions support. I think it's strict DER, but am not 100% sure.

In both cases, the identity is a byte string. Exactly what that byte
string contains is undefined here. This depends on the provider and
what it handles.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page would probably benefit from an example of some form (not necessarily a worked example of using the API; a concrete statement of what parameters are created from a particular identity string might suffice).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand. Doesn''t "The result is written to I<*ppkey>." answer that question?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking in the general vein of "such as DSA parameters p, q, and g L<openssl-dsaparam(1)>"

Copy link
Member Author

@levitte levitte Jan 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So basically, what we actually need is a general description of an EVP_PKEY, and link to that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That description could match something quite useful, yes. (It could also match something else, so ... I'll try to look at a PR if one appears.)

@petrovr
Copy link

petrovr commented Jan 13, 2020

Hi @levitte ,
I did not have time to review in details proposed modification.

After quick review I wonder how to deal with specific key "handle" (a reference to external data that allows key to be identified).
How to store "handle" on EVP key?

Next I cannot see why is responsible for UI prompts? The external provider(device) may require password/pin to access data. It could be for whole "store" or for "certain" elements. Next pass may be requested on each key use (FIPS requirement).

I'm not familiar with provider API so may be above questions are not relevant.

@levitte
Copy link
Member Author

levitte commented Jul 22, 2020

Closing this in favour of #12512

@levitte levitte closed this Jul 22, 2020
@levitte levitte deleted the ossl_store-for-providers branch July 22, 2020 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch: master Applies to master branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants