From: Darren Tucker Date: Tue, 20 May 2025 08:14:06 +0000 (+1000) Subject: Add compat shims for EC_POINT affine_coordinates X-Git-Tag: V_10_1_P1~287 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a9b1cfa4e8b807c7f82fdba8f730c2abdbba071;p=thirdparty%2Fopenssh-portable.git Add compat shims for EC_POINT affine_coordinates LibreSSL <3.4 does not have EC_POINT_[gs]et_affine_coordinates but does have the now-deprecated _GFp variantes. We still support LibreSSL back as far as 3.2.x so add a compat shim. --- diff --git a/configure.ac b/configure.ac index 98d98594b..94e782e15 100644 --- a/configure.ac +++ b/configure.ac @@ -3107,6 +3107,10 @@ if test "x$openssl" = "xyes" ; then # LibreSSL/OpenSSL API differences AC_CHECK_FUNCS([ \ + EC_POINT_get_affine_coordinates \ + EC_POINT_get_affine_coordinates_GFp \ + EC_POINT_set_affine_coordinates \ + EC_POINT_set_affine_coordinates_GFp \ EVP_CIPHER_CTX_iv \ EVP_CIPHER_CTX_iv_noconst \ EVP_CIPHER_CTX_get_iv \ diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index 936f4068d..4539d8d50 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h @@ -60,6 +60,20 @@ void ssh_libcrypto_init(void); # define BN_set_flags(a, b) #endif +/* LibreSSL <3.4 has the _GFp variants but not the equivalent modern ones. */ +#ifndef HAVE_EC_POINT_GET_AFFINE_COORDINATES +# ifdef HAVE_EC_POINT_GET_AFFINE_COORDINATES_GFP +# define EC_POINT_get_affine_coordinates(a, b, c, d, e) \ + (EC_POINT_get_affine_coordinates_GFp(a, b, c, d, e)) +# endif +#endif +#ifndef HAVE_EC_POINT_SET_AFFINE_COORDINATES +# ifdef HAVE_EC_POINT_SET_AFFINE_COORDINATES_GFP +# define EC_POINT_set_affine_coordinates(a, b, c, d, e) \ + (EC_POINT_set_affine_coordinates_GFp(a, b, c, d, e)) +# endif +#endif + #ifndef HAVE_EVP_CIPHER_CTX_GET_IV # ifdef HAVE_EVP_CIPHER_CTX_GET_UPDATED_IV # define EVP_CIPHER_CTX_get_iv EVP_CIPHER_CTX_get_updated_iv