mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
openssl3: handle EC_POINT_get_affine_coordinates api change
This commit is contained in:
parent
555c34b044
commit
45f2c9f9f8
4 changed files with 10 additions and 0 deletions
|
@ -1747,6 +1747,7 @@ CHECK_FUNCTION_EXISTS(EVP_MD_CTX_free LWS_HAVE_EVP_MD_CTX_free)
|
|||
CHECK_FUNCTION_EXISTS(ECDSA_SIG_set0 LWS_HAVE_ECDSA_SIG_set0)
|
||||
CHECK_FUNCTION_EXISTS(BN_bn2binpad LWS_HAVE_BN_bn2binpad)
|
||||
CHECK_FUNCTION_EXISTS(EVP_aes_128_wrap LWS_HAVE_EVP_aes_128_wrap)
|
||||
CHECK_FUNCTION_EXISTS(EC_POINT_get_affine_coordinates LWS_HAVE_EC_POINT_get_affine_coordinates)
|
||||
endif()
|
||||
if (LWS_WITH_MBEDTLS)
|
||||
set(LWS_HAVE_TLS_CLIENT_METHOD 1)
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#cmakedefine LWS_HAVE__ATOI64
|
||||
#cmakedefine LWS_HAVE_ATOLL
|
||||
#cmakedefine LWS_HAVE_BN_bn2binpad
|
||||
#cmakedefine LWS_HAVE_EC_POINT_get_affine_coordinates
|
||||
#cmakedefine LWS_HAVE_ECDSA_SIG_set0
|
||||
#cmakedefine LWS_HAVE_EVP_MD_CTX_free
|
||||
#cmakedefine LWS_HAVE_EVP_aes_128_wrap
|
||||
|
|
|
@ -352,7 +352,11 @@ lws_genec_new_keypair(struct lws_genec_ctx *ctx, enum enum_lws_dh_side side,
|
|||
bn[1] = (BIGNUM *)EC_KEY_get0_private_key(ec);
|
||||
bn[2] = BN_new();
|
||||
|
||||
#if defined(LWS_HAVE_EC_POINT_get_affine_coordinates)
|
||||
if (EC_POINT_get_affine_coordinates(EC_KEY_get0_group(ec),
|
||||
#else
|
||||
if (EC_POINT_get_affine_coordinates_GFp(EC_KEY_get0_group(ec),
|
||||
#endif
|
||||
pubkey, bn[0], bn[2], NULL) != 1) {
|
||||
lwsl_err("%s: EC_POINT_get_affine_coordinates_GFp failed\n",
|
||||
__func__);
|
||||
|
|
|
@ -375,7 +375,11 @@ lws_x509_public_to_jwk(struct lws_jwk *jwk, struct lws_x509_cert *x509,
|
|||
mpi[LWS_GENCRYPTO_EC_KEYEL_D] = NULL;
|
||||
mpi[LWS_GENCRYPTO_EC_KEYEL_Y] = BN_new(); /* Y */
|
||||
|
||||
#if defined(LWS_HAVE_EC_POINT_get_affine_coordinates)
|
||||
if (EC_POINT_get_affine_coordinates(ecgroup, ecpoint,
|
||||
#else
|
||||
if (EC_POINT_get_affine_coordinates_GFp(ecgroup, ecpoint,
|
||||
#endif
|
||||
mpi[LWS_GENCRYPTO_EC_KEYEL_X],
|
||||
mpi[LWS_GENCRYPTO_EC_KEYEL_Y],
|
||||
NULL) != 1) {
|
||||
|
|
Loading…
Add table
Reference in a new issue