EVP: Add support for comparing provided EVP_PKEYs
authorRichard Levitte <levitte@openssl.org>
Wed, 5 Feb 2020 11:55:43 +0000 (12:55 +0100)
committerRichard Levitte <levitte@openssl.org>
Mon, 2 Mar 2020 02:27:03 +0000 (03:27 +0100)
commit1e9101c404b92b1fd32e8f0308ddc20742285135
treec079330956bbf65069928a624b6d77bcbf591ea7
parentbee5d6cd3fa2f8bcc7e1153e4dc26aa26144bee0
EVP: Add support for comparing provided EVP_PKEYs

This adds evp_keymgmt_util_match() and affects EVP_PKEY_cmp() and
EVP_PKEY_cmp_parameters().

The word 'match' was used for the new routines because many associate
'cmp' with comparison functions that allows sorting, i.e. return -1, 0
or 1 depending on the order in which the two compared elements should
be sorted.  EVP_PKEY_cmp() and EVP_PKEY_cmp_parameters() don't quite
do that.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11158)
crypto/evp/keymgmt_lib.c
crypto/evp/p_lib.c
include/crypto/evp.h