Browse code

Add OpenSSL compat definition for RSA_meth_set_sign

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>

Arne Schwabe authored on 2018/10/05 21:23:30
Showing 2 changed files
... ...
@@ -943,6 +943,7 @@ if test "${with_crypto_library}" = "openssl"; then
943 943
 			RSA_meth_set_priv_enc \
944 944
 			RSA_meth_set_priv_dec \
945 945
 			RSA_meth_set_init \
946
+			RSA_meth_set_sign \
946 947
 			RSA_meth_set_finish \
947 948
 			RSA_meth_set0_app_data \
948 949
 			RSA_meth_get0_app_data \
... ...
@@ -585,6 +585,26 @@ RSA_meth_set_init(RSA_METHOD *meth, int (*init) (RSA *rsa))
585 585
 }
586 586
 #endif
587 587
 
588
+#if !defined (HAVE_RSA_METH_SET_SIGN)
589
+/**
590
+ * Set the sign function of an RSA_METHOD object
591
+ *
592
+ * @param meth               The RSA_METHOD object
593
+ * @param sign               The sign function
594
+ * @return                   1 on success, 0 on error
595
+ */
596
+static inline
597
+int RSA_meth_set_sign(RSA_METHOD *meth,
598
+                      int (*sign) (int type, const unsigned char *m,
599
+                                   unsigned int m_length,
600
+                                   unsigned char *sigret, unsigned int *siglen,
601
+                                   const RSA *rsa))
602
+{
603
+    meth->rsa_sign = sign;
604
+    return 1;
605
+}
606
+#endif
607
+
588 608
 #if !defined(HAVE_RSA_METH_SET_FINISH)
589 609
 /**
590 610
  * Set the finish function of an RSA_METHOD object