Rethink the EVP_PKEY cache of provider side keys#11148
Rethink the EVP_PKEY cache of provider side keys#11148openssl-machine merged 4 commits intoopenssl:masterfrom
Conversation
|
A small note on evp_pkey_upgrade_to_provider(): This should never become a public function, for the simple reason that it's temporary, even though it's obvious that it will be around for a few years. The reason is that this duality between legacy keys and provider side keys is planned to go away when all the legacy stuff is gone, at which point the idea of an "upgrade" will be moot. |
|
This is WIP because I haven't updated the documentation yet. |
|
I'm pondering if the separation between legacy "origin" and provider "origin" is a bit too strong. A slightly different model would be to have an upgrade simply use the legacy key as a template, and keep it around in case someone changes something in it... |
0fe97bf to
22de7e1
Compare
|
My pondering lead to mods, not here, but in #11158. Key upgrades must be used very carefully, the majority of cases only need to have a cached export. |
bce4d61 to
690e195
Compare
|
I did some squashing, for cleanup |
|
Docs have been added, this is no longer WIP |
|
travis errors are relevant.. |
Fixed |
slontis
left a comment
There was a problem hiding this comment.
Approved - Provided the appveyor tests pass.
|
This pull request is ready to merge |
The role of this cache was two-fold:
1. It was a cache of key copies exported to providers with which an
operation was initiated.
2. If the EVP_PKEY didn't have a legacy key, item 0 of the cache was
the corresponding provider side origin, while the rest was the
actual cache.
This dual role for item 0 made the code a bit confusing, so we now
make a separate keymgmt / keydata pair outside of that cache, which is
the provider side "origin" key.
A hard rule is that an EVP_PKEY cannot hold a legacy "origin" and a
provider side "origin" at the same time.
Reviewed-by: Shane Lontis <[email protected]>
(Merged from openssl#11148)
This function "upgrades" a key from a legacy key container to a provider side key container. Reviewed-by: Shane Lontis <[email protected]> (Merged from openssl#11148)
Functions covered: - evp_pkey_export_to_provider() - evp_pkey_upgrade_to_provider() Reviewed-by: Shane Lontis <[email protected]> (Merged from openssl#11148)
Reviewed-by: Shane Lontis <[email protected]> (Merged from openssl#11148)
0026dbc to
e32c608
Compare
The role of this cache was two-fold:
operation was initiated.
the corresponding provider side origin, while the rest was the
actual cache.
This dual role for item 0 made the code a bit confusing, so we now
make a separate keymgmt / keydata pair outside of that cache, which is
the provider side "origin" key.
A hard rule is that an EVP_PKEY cannot hold a legacy "origin" and a
provider side "origin" at the same time.
This also adds evp_pkey_upgrade_to_provider(), for EVP_PKEY upgrades