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
The following commit(s) were added to refs/heads/trunk by this push:
new 244f2bcc92 Don't allow calls to OpenSSLCipher::blockSize() before the
cipher is initialized.
244f2bcc92 is described below
commit 244f2bcc921bc5dc45e6c1970e27ac2409c44e17
Author: Damjan Jovanovic <[email protected]>
AuthorDate: Sun Mar 17 15:56:38 2024 +0200
Don't allow calls to OpenSSLCipher::blockSize() before the cipher
is initialized.
Patch by: me
---
main/oox/inc/oox/helper/openssl_wrapper.hxx | 5 -----
main/oox/source/core/encryption.cxx | 4 ++--
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/main/oox/inc/oox/helper/openssl_wrapper.hxx
b/main/oox/inc/oox/helper/openssl_wrapper.hxx
index 88d6bf2143..8124dc1e04 100644
--- a/main/oox/inc/oox/helper/openssl_wrapper.hxx
+++ b/main/oox/inc/oox/helper/openssl_wrapper.hxx
@@ -142,11 +142,6 @@ public:
throwOpenSSLException( "EVP_CipherFinal failed" );
}
- int blockSize()
- {
- return blockSize( cipher );
- }
-
static int blockSize( const EVP_CIPHER *cipherAlgorithm )
{
return EVP_CIPHER_block_size( cipherAlgorithm );
diff --git a/main/oox/source/core/encryption.cxx
b/main/oox/source/core/encryption.cxx
index 2bdfa8e794..46ecf49d6d 100644
--- a/main/oox/source/core/encryption.cxx
+++ b/main/oox/source/core/encryption.cxx
@@ -802,7 +802,7 @@ static vector< sal_uInt8 > decryptAll( const EVP_CIPHER*
cipherAlgorithm,
OpenSSLCipher cipher;
cipher.initialize( cipherAlgorithm, key, iv, 0 );
cipher.setPadding( 0 );
- const int blockSize = cipher.blockSize();
+ const int blockSize = OpenSSLCipher::blockSize( cipherAlgorithm );
vector< sal_uInt8 > decryptedData( encryptedDataLength + 2*blockSize );
int decryptedDataLength;
@@ -917,7 +917,7 @@ void AgileEncryptionInfo::decryptStream( BinaryXInputStream
&aEncryptedPackage,
const sal_uInt64 decryptedSize = aEncryptedPackage.readuInt64();
sal_uInt8 inputBuffer[ 4096 ];
- vector< sal_uInt8 > outputBuffer( 4096 + 2*cipher.blockSize() );
+ vector< sal_uInt8 > outputBuffer( 4096 + 2*OpenSSLCipher::blockSize(
cipherAlgorithm ) );
sal_Int32 bytesIn;
int bytesOut;
int finalBytesOut;