Add OpenSSL compat definition for RSA_meth_set_sign

Commit 6b495dc4c5 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>
This commit is contained in:
Arne Schwabe 2018-10-05 14:23:30 +02:00 committed by Gert Doering
parent 6b495dc4c5
commit 720c880a8c
2 changed files with 21 additions and 0 deletions

View File

@ -943,6 +943,7 @@ if test "${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 \

View File

@ -585,6 +585,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