This is an automated email from the ASF dual-hosted git repository. damjan pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit f3025b08c40161265442c34e2b50bc05aa5388c6 Author: Damjan Jovanovic <dam...@apache.org> AuthorDate: Sun Mar 17 09:36:50 2024 +0200 Add compatibility with OpenSSL 1.0.x. Patch by: me --- main/oox/inc/oox/helper/openssl_wrapper.hxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main/oox/inc/oox/helper/openssl_wrapper.hxx b/main/oox/inc/oox/helper/openssl_wrapper.hxx index fdb2c690c0..88d6bf2143 100644 --- a/main/oox/inc/oox/helper/openssl_wrapper.hxx +++ b/main/oox/inc/oox/helper/openssl_wrapper.hxx @@ -28,6 +28,7 @@ #include "com/sun/star/uno/Exception.hpp" #include <openssl/evp.h> +#include <openssl/opensslv.h> namespace oox { @@ -41,14 +42,22 @@ class OpenSSLDigest public: OpenSSLDigest() throw ( ::com::sun::star::uno::Exception ) { +#if OPENSSL_VERSION_NUMBER >= 0x10100000 digest_ctx = EVP_MD_CTX_new(); +#else + digest_ctx = EVP_MD_CTX_create(); +#endif if( digest_ctx == NULL ) throwOpenSSLException( "Failed to create digest context" ); } ~OpenSSLDigest() { +#if OPENSSL_VERSION_NUMBER >= 0x10100000 EVP_MD_CTX_free( digest_ctx ); +#else + EVP_MD_CTX_destroy( digest_ctx ); +#endif } void initialize( const EVP_MD* aDigest ) throw ( ::com::sun::star::uno::Exception )