]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Add OpenSSL compat definition for RSA_meth_set_sign
authorArne Schwabe <arne@rfc2549.org>
Fri, 5 Oct 2018 12:23:30 +0000 (14:23 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 5 Oct 2018 12:30:45 +0000 (14:30 +0200)
Commit 6b495dc4c5cfc118091ddc9c19330b3c9e3e3dff introduced
RSA_meth_set_sign, which is OpenSSL 1.1.0 and newer. Add a compatibility
definition.
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20181005122330.31431-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/search?l=mid&q=20181005122330.31431-1-arne@rfc2549.org

Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 720c880a8ca73e0f9e9b03e3c9d6031c026bccac)

configure.ac
src/openvpn/openssl_compat.h

index 88d1e097c9a68878aea545aaa64a67bc70aeb285..9d5fc3fd398d109349a4f8e6af15e2430e0a374a 100644 (file)
@@ -929,6 +929,7 @@ if test "${enable_crypto}" = "yes" -a "${with_crypto_library}" = "openssl"; then
                        RSA_meth_set_priv_enc \
                        RSA_meth_set_priv_dec \
                        RSA_meth_set_init \
+                       RSA_meth_set_sign \
                        RSA_meth_set_finish \
                        RSA_meth_set0_app_data \
                        RSA_meth_get0_app_data \
index 9f5306979cee73d440a01dd45c5a69a089524a2b..e680702acf957a8073ebe9d39f6e5a34ee3932d9 100644 (file)
@@ -584,6 +584,26 @@ RSA_meth_set_init(RSA_METHOD *meth, int (*init) (RSA *rsa))
 }
 #endif
 
+#if !defined (HAVE_RSA_METH_SET_SIGN)
+/**
+ * Set the sign function of an RSA_METHOD object
+ *
+ * @param meth               The RSA_METHOD object
+ * @param sign               The sign function
+ * @return                   1 on success, 0 on error
+ */
+static inline
+int RSA_meth_set_sign(RSA_METHOD *meth,
+                      int (*sign) (int type, const unsigned char *m,
+                                   unsigned int m_length,
+                                   unsigned char *sigret, unsigned int *siglen,
+                                   const RSA *rsa))
+{
+    meth->rsa_sign = sign;
+    return 1;
+}
+#endif
+
 #if !defined(HAVE_RSA_METH_SET_FINISH)
 /**
  * Set the finish function of an RSA_METHOD object