Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
a61abdd0
Commit
a61abdd0
authored
Jul 28, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EcmaCryptReader/Decoder - agile + standart
parent
f1f535f9
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
442 additions
and
257 deletions
+442
-257
ASCOfficeDocFile/DocDocxConverter/MemoryStream.h
ASCOfficeDocFile/DocDocxConverter/MemoryStream.h
+1
-0
Common/OfficeFileFormatChecker2.cpp
Common/OfficeFileFormatChecker2.cpp
+8
-1
OfficeCryptReader/source/CryptTransform.cpp
OfficeCryptReader/source/CryptTransform.cpp
+149
-90
OfficeCryptReader/source/CryptTransform.h
OfficeCryptReader/source/CryptTransform.h
+12
-3
OfficeCryptReader/source/ECMACryptReader.cpp
OfficeCryptReader/source/ECMACryptReader.cpp
+272
-132
OfficeCryptReader/source/ECMACryptReader.h
OfficeCryptReader/source/ECMACryptReader.h
+0
-31
No files found.
ASCOfficeDocFile/DocDocxConverter/MemoryStream.h
View file @
a61abdd0
...
...
@@ -32,6 +32,7 @@
#pragma once
#include "IBinaryReader.h"
#include "../Common/FormatUtils.h"
class
MemoryStream
:
public
IBinaryReader
{
...
...
Common/OfficeFileFormatChecker2.cpp
View file @
a61abdd0
...
...
@@ -116,8 +116,15 @@ bool COfficeFileFormatChecker::isDocFormatFile (POLE::Storage * storage)
POLE
::
Stream
stream
(
storage
,
"WordDocument"
);
unsigned
char
buffer
[
10
];
if
(
stream
.
read
(
buffer
,
10
)
>
0
)
if
(
stream
.
read
(
buffer
,
10
)
>
0
)
{
//ms office 2007 encrypted contains stream WordDocument !!
std
::
list
<
std
::
string
>
entries
=
storage
->
entries
(
"DataSpaces"
);
if
(
entries
.
size
()
>
0
)
return
false
;
return
true
;
}
return
false
;
}
...
...
OfficeCryptReader/source/CryptTransform.cpp
View file @
a61abdd0
This diff is collapsed.
Click to expand it.
OfficeCryptReader/source/CryptTransform.h
View file @
a61abdd0
...
...
@@ -50,7 +50,8 @@ namespace CRYPT_METHOD
XOR
,
RC4
,
AES_CBC
,
AES_CFB
AES_CFB
,
AES_ECB
};
}
...
...
@@ -60,6 +61,14 @@ public:
struct
_cryptData
{
//default ms2010
_cryptData
()
:
cipherAlgorithm
(
CRYPT_METHOD
::
AES_CBC
),
hashAlgorithm
(
CRYPT_METHOD
::
SHA1
),
spinCount
(
100000
),
keySize
(
0x10
),
hashSize
(
0x14
),
blockSize
(
0x10
),
saltSize
(
0x10
),
bAgile
(
true
)
//default ms2013/ms2016
//_cryptData(): cipherAlgorithm(CRYPT_METHOD::AES_CBC), hashAlgorithm(CRYPT_METHOD::SHA256), spinCount(100000),
// keySize(0x20), hashSize(0x40), blockSize(0x10), saltSize(0x10), bAgile(true)
{
}
CRYPT_METHOD
::
_cipherAlgorithm
cipherAlgorithm
;
CRYPT_METHOD
::
_hashAlgorithm
hashAlgorithm
;
...
...
@@ -78,6 +87,8 @@ public:
std
::
string
encryptedHmacKey
;
std
::
string
encryptedHmacValue
;
bool
bAgile
;
//..........
};
...
...
@@ -86,8 +97,6 @@ public:
void
Decrypt
(
unsigned
char
*
data
,
int
size
,
unsigned
char
*&
data_out
);
bool
IsVerify
(){}
bool
SetPassword
(
std
::
wstring
password
);
void
SetCryptData
(
_cryptData
&
data
);
...
...
OfficeCryptReader/source/ECMACryptReader.cpp
View file @
a61abdd0
This diff is collapsed.
Click to expand it.
OfficeCryptReader/source/ECMACryptReader.h
View file @
a61abdd0
...
...
@@ -38,29 +38,6 @@ class ECMACryptReader
{
public:
bool
DecryptOfficeFile
(
std
::
wstring
file_name_inp
,
std
::
wstring
file_name_out
,
std
::
wstring
password
);
struct
_keyEncryptor
{
std
::
string
spinCount
;
std
::
string
saltSize
;
std
::
string
blockSize
;
std
::
string
keyBits
;
std
::
string
hashSize
;
std
::
string
cipherAlgorithm
;
std
::
string
cipherChaining
;
std
::
string
hashAlgorithm
;
std
::
string
saltValue
;
std
::
string
encryptedVerifierHashInput
;
std
::
string
encryptedVerifierHashValue
;
std
::
string
encryptedKeyValue
;
};
struct
_dataIntegrity
{
std
::
string
encryptedHmacKey
;
std
::
string
encryptedHmacValue
;
};
struct
_refComponent
{
...
...
@@ -72,13 +49,5 @@ public:
std
::
vector
<
_refComponent
>
refComponents
;
std
::
wstring
dataSpaceName
;
};
private:
bool
ReadEncryptionInfo
(
const
std
::
string
&
xmlString
);
std
::
vector
<
_mapEntry
>
mapEntries
;
//--------------------------------------------------------------
_keyEncryptor
keyData
;
_dataIntegrity
dataIntegrity
;
std
::
vector
<
_keyEncryptor
>
keyEncryptors
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment