]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Add compat shims for EC_POINT affine_coordinates
authorDarren Tucker <dtucker@dtucker.net>
Tue, 20 May 2025 08:14:06 +0000 (18:14 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Tue, 20 May 2025 08:14:06 +0000 (18:14 +1000)
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.

configure.ac
openbsd-compat/openssl-compat.h

index 98d98594b5c8ea427b7e88d618549b0ee59651c9..94e782e1563bcc72e1fe6beab43b47f62278d737 100644 (file)
@@ -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 \
index 936f4068d84364f5ef8bacb84adaa0726678488b..4539d8d500020716eed686867bc94e19a4c8c7f8 100644 (file)
@@ -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