diff --git a/plugins/qca-ossl/ossl110-compat.h b/plugins/qca-ossl/ossl110-compat.h --- a/plugins/qca-ossl/ossl110-compat.h +++ b/plugins/qca-ossl/ossl110-compat.h @@ -205,22 +205,6 @@ return 1; } -static 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)) -{ - if (!meth) return 0; - meth->rsa_sign = sign; - return 1; -} - -static int RSA_meth_set_verify(RSA_METHOD *meth, int (*verify) (int dtype, const unsigned char *m, - unsigned int m_length, const unsigned char *sigbuf, unsigned int siglen, const RSA *rsa)) -{ - if (!meth) return 0; - meth->rsa_verify = verify; - return 1; -} - static int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish) (RSA *rsa)) { if (!meth) return 0; @@ -272,4 +256,22 @@ #endif // OPENSSL_VERSION_NUMBER < 0x10100000L +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER) +static 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)) +{ + if (!meth) return 0; + meth->rsa_sign = sign; + return 1; +} + +static int RSA_meth_set_verify(RSA_METHOD *meth, int (*verify) (int dtype, const unsigned char *m, + unsigned int m_length, const unsigned char *sigbuf, unsigned int siglen, const RSA *rsa)) +{ + if (!meth) return 0; + meth->rsa_verify = verify; + return 1; +} +#endif // (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER) + #endif // OSSL110COMPAT_H diff --git a/plugins/qca-ossl/qca-ossl.cpp b/plugins/qca-ossl/qca-ossl.cpp --- a/plugins/qca-ossl/qca-ossl.cpp +++ b/plugins/qca-ossl/qca-ossl.cpp @@ -62,12 +62,12 @@ #endif // OpenSSL 1.1.0 compatibility macros -#ifdef OSSL_110 +#if defined(OSSL_110) && !defined(LIBRESSL_VERSION_NUMBER) #define M_ASN1_IA5STRING_new() ASN1_IA5STRING_new() #define RSA_F_RSA_EAY_PRIVATE_DECRYPT RSA_F_RSA_OSSL_PRIVATE_DECRYPT #endif -#ifdef OSSL_110 +#if defined(OSSL_110) && !defined(LIBRESSL_VERSION_NUMBER) #include #endif @@ -1280,7 +1280,7 @@ protected: }; -#ifdef OSSL_110 +#if defined(OSSL_110) && !defined(LIBRESSL_VERSION_NUMBER) class opensslHkdfContext : public HKDFContext { public: @@ -7416,7 +7416,7 @@ #endif list += "pbkdf1(sha1)"; list += "pbkdf2(sha1)"; -#ifdef OSSL_110 +#if defined(OSSL_110) && !defined(LIBRESSL_VERSION_NUMBER) list += "hkdf(sha256)"; #endif list += "pkey"; @@ -7489,7 +7489,7 @@ #endif else if ( type == "pbkdf2(sha1)" ) return new opensslPbkdf2Context( this, type ); -#ifdef OSSL_110 +#if defined(OSSL_110) && !defined(LIBRESSL_VERSION_NUMBER) else if ( type == "hkdf(sha256)" ) return new opensslHkdfContext( this, type ); #endif