summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
Diffstat (limited to 'oox')
-rw-r--r--oox/source/crypto/DocumentDecryption.cxx17
-rw-r--r--oox/source/crypto/Standard2007Engine.cxx2
2 files changed, 16 insertions, 3 deletions
diff --git a/oox/source/crypto/DocumentDecryption.cxx b/oox/source/crypto/DocumentDecryption.cxx
index 6dee4de0adf2..c3549b2195e1 100644
--- a/oox/source/crypto/DocumentDecryption.cxx
+++ b/oox/source/crypto/DocumentDecryption.cxx
@@ -287,9 +287,22 @@ bool DocumentDecryption::readStandard2007EncryptionInfo(BinaryInputStream& rStre
if( (nHeaderSize < actualHeaderSize) )
return false;
- rStream >> info.header;
+ rStream >> info.header.flags;
+ rStream >> info.header.sizeExtra;
+ rStream >> info.header.algId;
+ rStream >> info.header.algIdHash;
+ rStream >> info.header.keyBits;
+ rStream >> info.header.providedType;
+ rStream >> info.header.reserved1;
+ rStream >> info.header.reserved2;
+
rStream.skip( nHeaderSize - actualHeaderSize );
- rStream >> info.verifier;
+
+ rStream >> info.verifier.saltSize;
+ rStream.readArray(info.verifier.salt, SAL_N_ELEMENTS(info.verifier.salt));
+ rStream.readArray(info.verifier.encryptedVerifier, SAL_N_ELEMENTS(info.verifier.encryptedVerifier));
+ rStream >> info.verifier.encryptedVerifierHashSize;
+ rStream.readArray(info.verifier.encryptedVerifierHash, SAL_N_ELEMENTS(info.verifier.encryptedVerifierHash));
if( info.verifier.saltSize != 16 )
return false;
diff --git a/oox/source/crypto/Standard2007Engine.cxx b/oox/source/crypto/Standard2007Engine.cxx
index b437846c5f57..13697d26c2cb 100644
--- a/oox/source/crypto/Standard2007Engine.cxx
+++ b/oox/source/crypto/Standard2007Engine.cxx
@@ -129,7 +129,7 @@ bool Standard2007Engine::calculateEncryptionKey(const OUString& rPassword)
// data = iterator (4bytes) + hash
vector<sal_uInt8> data(RTL_DIGEST_LENGTH_SHA1 + 4, 0);
- for (int i = 0; i < 50000; i++)
+ for (sal_Int32 i = 0; i < 50000; ++i)
{
ByteOrderConverter::writeLittleEndian( &data[0], i );
std::copy(hash.begin(), hash.end(), data.begin() + 4);