Conversation
3d2fd03 to
8200c35
Compare
8200c35 to
e5632c2
Compare
|
I've put down quite a lot of work in this, and there are multiple parts this change affects. The EVP_MAC API itselfBecause the EVP_MAC API is completely new and unreleased, I chose to throw away all the legacy stuff and make this completely provider based. Most notably, this means that MACs are always fetched and that control functions are replaced with parameter passing functions. Information services
TODO
|
|
A note on these functions: const OSSL_PARAM *EVP_MAC_CTX_get_param_types(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_CTX_set_param_types(const EVP_MAC *mac);According to design discussions, these should return OSSL_ITEM arrays. However, that type is poor in information, especially regarding expected value sizes, and rather than creating yet another type, I thought that re-using I submit this as a proposal of a common manner to figure out available parameters. |
|
I would appreciate some commentary on this |
e5632c2 to
6f8126a
Compare
|
Current TLS implementation refers to MAC NIDs. How can we change it to avoid this reference for future algorithms? |
Refer to them by name and use |
|
I mean places similar to ssl_cipher_get_evp() and ssl_load_ciphers(). So for TLS < 1.3 we either have to refactor this code or register NIDs for new primitives. It seems not a problem but should be taken into account. |
7d9a649 to
e4e1561
Compare
TODO
|
a05d833 to
c3ef44a
Compare
c3ef44a to
836f845
Compare
|
OPENSSL_CTX passing was pretty much solved in #9160. I need to work a little bit more on this PR to integrate that, but it's getting close. It currently builds, at least on my machine, and tests pretty fine, except for the BLAKE2 MACs... |
041ab3d to
6d1e72f
Compare
|
This is no longer a draft |
|
Argh, of course, the OSSL_PARAM return size change makes it all go belly up... It might take a week before I get to this... |
|
Apologies :( |
|
I approved it, so it's as much on me. |
c130139 to
b2b2629
Compare
This avoids getting them confused with the MAC implementations.
For information processing.
ea8bc66 to
85f7480
Compare
|
I did a larger squashing job and pushed here to ensure that CIs are still happy. Feel free to have a new look through to see if I messed up... I don't think I did. If nothing goes wrong and no one complains, I'll use the approvals made so far. |
|
Merged. e74bd29 Prepare EVP_MAC infrastructure for moving all MACs to providers |
Quite a few adaptations are needed, most prominently the added code to allow provider based MACs. As part of this, all the old information functions are gone, except for EVP_MAC_name(). Some of them will reappear later, for example EVP_MAC_do_all() in some form. MACs by EVP_PKEY was particularly difficult to deal with, as they need to allocate and deallocate EVP_MAC_CTXs "under the hood", and thereby implicitly fetch the corresponding EVP_MAC. This means that EVP_MACs can't be constant in a EVP_MAC_CTX, as their reference count may need to be incremented and decremented as part of the allocation or deallocation of the EVP_MAC_CTX. It may be that other provider based EVP operation types may need to be handled in a similar manner. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
This also moves the remaining parts of BLAKE2 digests to the default provider, and removes the legacy EVP implementation. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
Instead of using evp_keccak_kmac128() and evp_keccak_kmac256(), we refer to the hash implementation by name, and fetch it, which should get us the implementation from providers/common/digests/sha3_prov.c. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
Now that all our MACs have moved to the default provider, we let it take over completely Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
CRMF, SSKDF, TLS1_PRF and SIV are affected by this. This also forces the need to check MAC names, which leads to storing the names in the created methods, which affects all EVP APIs, not just EVP_MAC. We will want that kind of information anyway (for example for 'openssl list')... Consequently, EVP_MAC_name() is re-implemented. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
BLAKE2 MACs came with a set of new reason codes. Those talking about lengths are consistently called PROV_R_INVALID_FOO_LENGTH, for any name FOO. The cipher messages were briefer. In the interest of having more humanly readable messages, we adjust the reasons used by the ciphers (that's just IV length and key length). Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
This avoids getting them confused with the MAC implementations. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
For information processing. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from #8877)
|
Should be moved to "Done" in the project board. |
|
Done |
Because EVP_MAC is a new API, there is no legacy code to keep around, and the API is entirely adapted to support provider based implementations. This affects code in all kinds of places, all the way up to how
openssl list -mac-algorithmsdoes its work.It's recommended to read the commit messages for explanation of some of the changes.
This currently depends on #9303