Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make EVP_PKEY_type into the identity function
This function exists because callers sometimes write EVP_PKEY_type(EVP_PKEY_id(pkey)), which is equivalent to EVP_PKEY_base_id(pkey). In OpenSSL, all this existed so that a type parsed as EVP_PKEY_RSA2 could still be mapped to EVP_PKEY_RSA. We haven't supported this since 2015, so this purely exists as a way to check that the key type exists. In doing so, it currently pulls in the full implementation of every key type. I could replicate the list of keys, but that is one more place we have to keep things up-to-date. Instead, just make this function the identity. Looking through callers, it did not appear anyone depended on the error condition. Update-Note: EVP_PKEY_type used to return NID_undef when given a garbage key type. Given it is only ever used in concert with EVP_PKEY_id, this is unlikely to impact anyone. If it does, we can do the more tedious option. Bug: 497 Change-Id: Ibf68a07ef6906398df0fec425c869c107b8c90f4 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/67109 Reviewed-by: Bob Beck <[email protected]> Commit-Queue: David Benjamin <[email protected]> (cherry picked from commit 8ede9514dac7cace2084d95502d4bd8ea39b08b6)
- Loading branch information