Draft: Update OpenSSL
DO NOT MERGE YET - fingerprint not working
This MR updates the vfs0090.c
file to be compatible with OpenSSL 3.0 by replacing all deprecated OpenSSL functions with their modern equivalents. Here's a summary of the changes made:
1. Updated Function Signatures
- Changed
load_key()
function to returnEVP_PKEY*
instead ofEC_KEY*
- Updated
sign2()
function to acceptEVP_PKEY*
instead ofEC_KEY*
2. Replaced Deprecated OpenSSL Functions
- EC_KEY_new_by_curve_name() → EVP_PKEY_fromdata() with OSSL_PARAM_BLD
- EC_KEY_set_public_key_affine_coordinates() → OSSL_PARAM_BLD_push_BN() for X/Y coordinates
- EC_KEY_set_private_key() → OSSL_PARAM_BLD_push_BN() for private key
- EC_KEY_check_key() → EVP_PKEY_check()
- ECDSA_do_sign() → EVP_DigestSign()
- EVP_PKEY_set1_EC_KEY() → Direct use of EVP_PKEY from load_key()
- ECDH_compute_key() → EVP_PKEY_derive()
- EC_KEY_get0_public_key() → Eliminated by using EVP_PKEY directly
3. Added Required Headers
- Added
#include <openssl/param_build.h>
- Added
#include <openssl/core_names.h>
4. Updated Parameter Names
- Used correct OpenSSL 3.0 parameter names:
OSSL_PKEY_PARAM_EC_PUB_X
,OSSL_PKEY_PARAM_EC_PUB_Y
,OSSL_PKEY_PARAM_PRIV_KEY
5. Modernized Key Operations
- Added the missing autoptr cleanup function definition
- Replaced low-level EC_KEY operations with high-level EVP_PKEY operations
- Used OSSL_PARAM_BLD for constructing key parameters
- Implemented proper error handling for all new OpenSSL 3.0 functions
Edited by Gustavo