Browse Source

undeprecate EVP_PKEY_cmp and EVP_PKEY_cmp_parameters

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12013)
Tim Hudson 4 years ago
parent
commit
eb750219f2
4 changed files with 13 additions and 16 deletions
  1. 0 4
      crypto/evp/p_lib.c
  2. 11 6
      doc/man3/EVP_PKEY_copy_parameters.pod
  3. 0 4
      include/openssl/evp.h
  4. 2 2
      util/libcrypto.num

+ 0 - 4
crypto/evp/p_lib.c

@@ -275,12 +275,10 @@ static int evp_pkey_cmp_any(const EVP_PKEY *a, const EVP_PKEY *b,
     return evp_keymgmt_match(keymgmt1, keydata1, keydata2, selection);
 }
 
-#ifndef OPENSSL_NO_DEPRECATED_3_0
 int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b)
 {
     return EVP_PKEY_parameters_eq(a, b);
 }
-#endif
 
 int EVP_PKEY_parameters_eq(const EVP_PKEY *a, const EVP_PKEY *b)
 {
@@ -300,12 +298,10 @@ int EVP_PKEY_parameters_eq(const EVP_PKEY *a, const EVP_PKEY *b)
     return -2;
 }
 
-#ifndef OPENSSL_NO_DEPRECATED_3_0
 int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
 {
     return EVP_PKEY_eq(a, b);
 }
-#endif
 
 int EVP_PKEY_eq(const EVP_PKEY *a, const EVP_PKEY *b)
 {

+ 11 - 6
doc/man3/EVP_PKEY_copy_parameters.pod

@@ -46,6 +46,11 @@ Since OpenSSL private keys contain public key components too the function
 EVP_PKEY_eq() can also be used to determine if a private key matches
 a public key.
 
+EVP_PKEY_cmp() and EVP_PKEY_cmp_parameters() differ in their return values 
+compared to other _cmp() functions. They are aliases for EVP_PKEY_eq() and 
+EVP_PKEY_parameters_eq() functions provided for backwards compatibility 
+with existing applications.
+
 =head1 RETURN VALUES
 
 The function EVP_PKEY_missing_parameters() returns 1 if the public key
@@ -55,7 +60,8 @@ doesn't use parameters.
 These functions EVP_PKEY_copy_parameters() returns 1 for success and 0 for
 failure.
 
-The function EVP_PKEY_parameters_eq() and EVP_PKEY_eq() return 1 if their
+The functions EVP_PKEY_cmp_parameters(), EVP_PKEY_parameters_eq(), 
+EVP_PKEY_cmp() and EVP_PKEY_eq() return 1 if their
 inputs match, 0 if they don't match, -1 if the key types are different and
 -2 if the operation is not supported.
 
@@ -66,11 +72,10 @@ L<EVP_PKEY_keygen(3)>
 
 =head1 HISTORY
 
-The function EVP_PKEY_cmp was deprecated and renamed to B<EVP_PKEY_eq> and
-EVP_PKEY_cmp_parameters was deprecated and renamed to B<EVP_PKEY_parameters_eq>
-(without changing semantics) in OpenSSL 3.0.
-This was done to avoid confusion on their return values with other _cmp()
-functions that return 0 in case their arguments are equal.
+EVP_PKEY_eq() and EVP_PKEY_parameters_eq() were added in OpenSSL 3.0 to 
+avoid confusion on the return values of EVP_PKEY_cmp() and 
+EVP_PKEY_cmp_parameters() which unlike other _cmp()
+functions do not return 0 in case their arguments are equal.
 
 =head1 COPYRIGHT
 

+ 0 - 4
include/openssl/evp.h

@@ -1281,14 +1281,10 @@ EVP_PKEY *d2i_KeyParams_bio(int type, EVP_PKEY **a, BIO *in);
 int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from);
 int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey);
 int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode);
-#ifndef OPENSSL_NO_DEPRECATED_3_0
 int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b);
-#endif
 int EVP_PKEY_parameters_eq(const EVP_PKEY *a, const EVP_PKEY *b);
 
-#ifndef OPENSSL_NO_DEPRECATED_3_0
 int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
-#endif
 int EVP_PKEY_eq(const EVP_PKEY *a, const EVP_PKEY *b);
 
 int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey,

+ 2 - 2
util/libcrypto.num

@@ -190,7 +190,7 @@ EVP_DigestInit                          193	3_0_0	EXIST::FUNCTION:
 EVP_PKEY_meth_find                      194	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
 X509_VERIFY_PARAM_get_count             195	3_0_0	EXIST::FUNCTION:
 ASN1_BIT_STRING_get_bit                 196	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_cmp                            197	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_cmp                            197	3_0_0	EXIST::FUNCTION:
 d2i_X509_ALGORS                         198	3_0_0	EXIST::FUNCTION:
 EVP_PKEY2PKCS8                          199	3_0_0	EXIST::FUNCTION:
 BN_nist_mod_256                         200	3_0_0	EXIST::FUNCTION:
@@ -3461,7 +3461,7 @@ ERR_print_errors_cb                     3531	3_0_0	EXIST::FUNCTION:
 ENGINE_set_default_string               3532	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
 BIO_number_read                         3533	3_0_0	EXIST::FUNCTION:
 CRYPTO_zalloc                           3534	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_cmp_parameters                 3535	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_cmp_parameters                 3535	3_0_0	EXIST::FUNCTION:
 EVP_PKEY_CTX_new_id                     3537	3_0_0	EXIST::FUNCTION:
 TLS_FEATURE_free                        3538	3_0_0	EXIST::FUNCTION:
 d2i_BASIC_CONSTRAINTS                   3539	3_0_0	EXIST::FUNCTION: