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
e69c1677
Commit
e69c1677
authored
Oct 31, 2017
by
Alexey Golubev
Browse files
Options
Browse Files
Download
Plain Diff
v5.0.3
parents
470eddf2
4dae8f50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
DesktopEditor/xmlsec/src/src/XmlSigner_mscrypto.h
DesktopEditor/xmlsec/src/src/XmlSigner_mscrypto.h
+3
-3
OfficeCryptReader/source/CryptTransform.cpp
OfficeCryptReader/source/CryptTransform.cpp
+7
-7
No files found.
DesktopEditor/xmlsec/src/src/XmlSigner_mscrypto.h
View file @
e69c1677
...
@@ -219,7 +219,7 @@ public:
...
@@ -219,7 +219,7 @@ public:
HCRYPTPROV
hCryptProv
=
NULL
;
HCRYPTPROV
hCryptProv
=
NULL
;
bResult
=
CryptAcquireCertificatePrivateKey
(
m_context
,
0
,
NULL
,
&
hCryptProv
,
&
dwKeySpec
,
NULL
)
;
bResult
=
(
NULL
!=
m_context
)
?
CryptAcquireCertificatePrivateKey
(
m_context
,
0
,
NULL
,
&
hCryptProv
,
&
dwKeySpec
,
NULL
)
:
FALSE
;
if
(
!
bResult
)
if
(
!
bResult
)
bResult
=
CryptAcquireContext
(
&
hCryptProv
,
NULL
,
NULL
,
PROV_RSA_FULL
,
CRYPT_VERIFYCONTEXT
);
bResult
=
CryptAcquireContext
(
&
hCryptProv
,
NULL
,
NULL
,
PROV_RSA_FULL
,
CRYPT_VERIFYCONTEXT
);
...
@@ -252,7 +252,7 @@ public:
...
@@ -252,7 +252,7 @@ public:
return
""
;
return
""
;
}
}
BYTE
*
pDataHashRaw
=
new
BYTE
[
dwCount
]
;
BYTE
*
pDataHashRaw
=
(
BYTE
*
)
malloc
(
cbHashSize
)
;
bResult
=
CryptGetHashParam
(
hHash
,
HP_HASHVAL
,
pDataHashRaw
,
&
cbHashSize
,
0
);
bResult
=
CryptGetHashParam
(
hHash
,
HP_HASHVAL
,
pDataHashRaw
,
&
cbHashSize
,
0
);
...
@@ -270,7 +270,7 @@ public:
...
@@ -270,7 +270,7 @@ public:
std
::
string
sReturn
(
pBase64_hash
,
nBase64Len_hash
);
std
::
string
sReturn
(
pBase64_hash
,
nBase64Len_hash
);
delete
[]
pBase64_hash
;
delete
[]
pBase64_hash
;
//delete [] pDataHashRaw
;
free
(
pDataHashRaw
)
;
CryptDestroyHash
(
hHash
);
CryptDestroyHash
(
hHash
);
CryptReleaseContext
(
hCryptProv
,
0
);
CryptReleaseContext
(
hCryptProv
,
0
);
...
...
OfficeCryptReader/source/CryptTransform.cpp
View file @
e69c1677
...
@@ -813,7 +813,7 @@ void ECMAEncryptor::UpdateDataIntegrity(unsigned char* data, int size)
...
@@ -813,7 +813,7 @@ void ECMAEncryptor::UpdateDataIntegrity(unsigned char* data, int size)
cryptData
.
encryptedHmacKey
=
std
::
string
((
char
*
)
pEncHmacKey
.
ptr
,
pEncHmacKey
.
size
);
cryptData
.
encryptedHmacKey
=
std
::
string
((
char
*
)
pEncHmacKey
.
ptr
,
pEncHmacKey
.
size
);
cryptData
.
encryptedHmacValue
=
std
::
string
((
char
*
)
pEncHmacValue
.
ptr
,
pEncHmacValue
.
size
);
cryptData
.
encryptedHmacValue
=
std
::
string
((
char
*
)
pEncHmacValue
.
ptr
,
pEncHmacValue
.
size
);
}
}
#define PADDING_SIZE 16 // 8
int
ECMAEncryptor
::
Encrypt
(
unsigned
char
*
data_inp_ptr
,
int
size
,
unsigned
char
*&
data_out_ptr
)
int
ECMAEncryptor
::
Encrypt
(
unsigned
char
*
data_inp_ptr
,
int
size
,
unsigned
char
*&
data_out_ptr
)
{
{
data_out_ptr
=
NULL
;
data_out_ptr
=
NULL
;
...
@@ -823,10 +823,10 @@ int ECMAEncryptor::Encrypt(unsigned char* data_inp_ptr, int size, unsigned char*
...
@@ -823,10 +823,10 @@ int ECMAEncryptor::Encrypt(unsigned char* data_inp_ptr, int size, unsigned char*
_buf
empty
(
NULL
,
0
,
false
);
_buf
empty
(
NULL
,
0
,
false
);
int
size_out
=
size
;
int
size_out
=
size
;
if
(
size_out
%
8
!=
0
)
if
(
size_out
%
PADDING_SIZE
!=
0
)
size_out
=
(
size_out
/
8
+
1
)
*
8
;
size_out
=
(
size_out
/
PADDING_SIZE
+
1
)
*
PADDING_SIZE
;
data_out_ptr
=
new
unsigned
char
[
size_out
+
8
];
// real size + padding + size for realsize
data_out_ptr
=
new
unsigned
char
[
size_out
+
PADDING_SIZE
];
// real size + padding + size for realsize
_UINT64
nSize
=
size
;
_UINT64
nSize
=
size
;
memcpy
(
data_out_ptr
,
(
unsigned
char
*
)
&
nSize
,
8
);
memcpy
(
data_out_ptr
,
(
unsigned
char
*
)
&
nSize
,
8
);
...
@@ -878,8 +878,8 @@ int ECMAEncryptor::Encrypt(unsigned char* data_inp_ptr, int size, unsigned char*
...
@@ -878,8 +878,8 @@ int ECMAEncryptor::Encrypt(unsigned char* data_inp_ptr, int size, unsigned char*
EncryptCipher
(
pDecryptedKey
,
iv
,
pInp
,
pOut
,
cryptData
.
cipherAlgorithm
);
EncryptCipher
(
pDecryptedKey
,
iv
,
pInp
,
pOut
,
cryptData
.
cipherAlgorithm
);
if
(
sz
%
8
!=
0
)
if
(
sz
%
PADDING_SIZE
!=
0
)
sz
=
(
sz
/
8
+
1
)
*
8
;
sz
=
(
sz
/
PADDING_SIZE
+
1
)
*
PADDING_SIZE
;
memcpy
(
data_out
,
pOut
.
ptr
,
sz
);
memcpy
(
data_out
,
pOut
.
ptr
,
sz
);
...
@@ -903,4 +903,4 @@ int ECMAEncryptor::Encrypt(unsigned char* data_inp_ptr, int size, unsigned char*
...
@@ -903,4 +903,4 @@ int ECMAEncryptor::Encrypt(unsigned char* data_inp_ptr, int size, unsigned char*
}
}
\ No newline at end of file
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