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
b19191b2
Commit
b19191b2
authored
Jun 15, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openssl signing bugs
parent
77f8ab68
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
DesktopEditor/xmlsec/src/src/XmlSigner_openssl.cpp
DesktopEditor/xmlsec/src/src/XmlSigner_openssl.cpp
+14
-2
No files found.
DesktopEditor/xmlsec/src/src/XmlSigner_openssl.cpp
View file @
b19191b2
...
...
@@ -75,6 +75,17 @@ public:
EVP_PKEY_FREE
(
m_key
);
}
protected:
static
void
string_replace
(
std
::
string
&
text
,
const
std
::
string
&
replaceFrom
,
const
std
::
string
&
replaceTo
)
{
size_t
posn
=
0
;
while
(
std
::
string
::
npos
!=
(
posn
=
text
.
find
(
replaceFrom
,
posn
)))
{
text
.
replace
(
posn
,
replaceFrom
.
length
(),
replaceTo
);
posn
+=
replaceTo
.
length
();
}
}
public:
std
::
string
GetNumber
()
{
...
...
@@ -143,6 +154,7 @@ public:
std
::
string
::
size_type
nStart
=
nPos1
+
sFindFirst
.
length
();
sReturn
=
sReturn
.
substr
(
nStart
,
nPos2
-
nStart
);
}
string_replace
(
sReturn
,
"
\n
"
,
""
);
BIO_free
(
bio
);
return
sReturn
;
...
...
@@ -278,12 +290,12 @@ public:
int
nDigestLen
=
0
;
NSFile
::
CBase64Converter
::
Decode
(
sXmlSignature
.
c_str
(),
(
int
)
sXmlSignature
.
length
(),
pDigestValue
,
nDigestLen
);
int
n2
=
EVP_VerifyUpdate
(
pCtx
,
pDigestValue
,
(
size_t
)
nDigestLen
);
int
n2
=
EVP_VerifyUpdate
(
pCtx
,
(
BYTE
*
)
sXml
.
c_str
(),
(
size_t
)
sXml
.
length
()
);
n2
=
n2
;
EVP_PKEY
*
pubkey
=
X509_get_pubkey
(
m_cert
);
int
n3
=
EVP_VerifyFinal
(
pCtx
,
(
BYTE
*
)
sXml
.
c_str
(),
(
unsigned
int
)
sXml
.
length
()
,
pubkey
);
int
n3
=
EVP_VerifyFinal
(
pCtx
,
pDigestValue
,
(
unsigned
int
)
nDigestLen
,
pubkey
);
n3
=
n3
;
EVP_MD_CTX_destroy
(
pCtx
);
...
...
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