summaryrefslogtreecommitdiff
path: root/oox/qa
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-07-07 15:22:36 +0200
committerTomaž Vajngerl <quikee@gmail.com>2018-07-07 22:58:34 +0200
commit7ba835ff5837290598d0b27c90a8abcfedf5b210 (patch)
tree5dfb662d735872107b9edcf53131dc883122d97e /oox/qa
parent8efeb81537726445954b10314ebbd770d266ac20 (diff)
oox: Handle agile encryption info "reserved" field correctly
The "reserved" filed is written fter the version number major, minor which is used to identify the encryption as agile. The "reserved" field must always have the value 0x00000040. This change writes the reserved filed correctly and when encryption and when decrypting it checks the value an potentially bails out if it desn't contain the expected value. Change-Id: I2045dc64e0c6bbb3318384e25deef2ba8f41b94c Reviewed-on: https://gerrit.libreoffice.org/57140 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'oox/qa')
-rw-r--r--oox/qa/unit/CryptoTest.cxx4
1 files changed, 0 insertions, 4 deletions
diff --git a/oox/qa/unit/CryptoTest.cxx b/oox/qa/unit/CryptoTest.cxx
index e17f3cc91e9a..47d567fab34b 100644
--- a/oox/qa/unit/CryptoTest.cxx
+++ b/oox/qa/unit/CryptoTest.cxx
@@ -224,7 +224,6 @@ void CryptoTest::testAgileEncrpytionInfoWritingAndParsing()
new utl::OSeekableInputStreamWrapper(aEncryptionInfo));
xInputStream->skipBytes(4); // Encryption type -> Agile
- xInputStream->skipBytes(4); // Reserved
CPPUNIT_ASSERT(aEngine.readEncryptionInfo(xInputStream));
@@ -271,7 +270,6 @@ void CryptoTest::testAgileEncrpytionInfoWritingAndParsing()
new utl::OSeekableInputStreamWrapper(aEncryptionInfo));
xInputStream->skipBytes(4); // Encryption type -> Agile
- xInputStream->skipBytes(4); // Reserved
CPPUNIT_ASSERT(aEngine.readEncryptionInfo(xInputStream));
@@ -324,7 +322,6 @@ void CryptoTest::testAgileDataIntegrityHmacKey()
new utl::OSeekableInputStreamWrapper(aEncryptionInfo));
xInputStream->skipBytes(4); // Encryption type -> Agile
- xInputStream->skipBytes(4); // Reserved
CPPUNIT_ASSERT(aEngine.readEncryptionInfo(xInputStream));
CPPUNIT_ASSERT(aEngine.generateEncryptionKey(aPassword));
@@ -391,7 +388,6 @@ void CryptoTest::testAgileEncryptingAndDecrypting()
new utl::OSeekableInputStreamWrapper(aEncryptionInfo));
xEncryptionInfo->skipBytes(4); // Encryption type -> Agile
- xEncryptionInfo->skipBytes(4); // Reserved
CPPUNIT_ASSERT(aEngine.readEncryptionInfo(xEncryptionInfo));