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
77f8ab68
Commit
77f8ab68
authored
Jun 14, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6fc6f9ea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
DesktopEditor/xmlsec/src/src/XmlSigner_openssl.cpp
DesktopEditor/xmlsec/src/src/XmlSigner_openssl.cpp
+21
-1
No files found.
DesktopEditor/xmlsec/src/src/XmlSigner_openssl.cpp
View file @
77f8ab68
...
@@ -114,6 +114,10 @@ public:
...
@@ -114,6 +114,10 @@ public:
std
::
string
sName
(
buffer
);
std
::
string
sName
(
buffer
);
std
::
wstring
sNameW
=
UTF8_TO_U
(
sName
);
std
::
wstring
sNameW
=
UTF8_TO_U
(
sName
);
std
::
wstring
::
size_type
pos
=
sNameW
.
find
(
L"CN="
);
if
(
std
::
wstring
::
npos
!=
pos
)
sNameW
=
sNameW
.
substr
(
pos
+
3
);
return
sNameW
;
return
sNameW
;
}
}
...
@@ -131,6 +135,15 @@ public:
...
@@ -131,6 +135,15 @@ public:
std
::
string
sReturn
((
char
*
)
data
,
(
size_t
)
len
);
std
::
string
sReturn
((
char
*
)
data
,
(
size_t
)
len
);
std
::
string
sFindFirst
=
"-----BEGIN TRUSTED CERTIFICATE-----"
;
std
::
string
::
size_type
nPos1
=
sReturn
.
find
(
sFindFirst
);
std
::
string
::
size_type
nPos2
=
sReturn
.
find
(
"-----END TRUSTED CERTIFICATE-----"
);
if
(
std
::
string
::
npos
!=
nPos1
&&
std
::
string
::
npos
!=
nPos2
)
{
std
::
string
::
size_type
nStart
=
nPos1
+
sFindFirst
.
length
();
sReturn
=
sReturn
.
substr
(
nStart
,
nPos2
-
nStart
);
}
BIO_free
(
bio
);
BIO_free
(
bio
);
return
sReturn
;
return
sReturn
;
}
}
...
@@ -204,7 +217,14 @@ public:
...
@@ -204,7 +217,14 @@ public:
EVP_MD_CTX_destroy
(
pCtx
);
EVP_MD_CTX_destroy
(
pCtx
);
return
std
::
string
((
char
*
)
pSignature
,
(
size_t
)
nSignatureLen
);
char
*
pBase64
=
NULL
;
int
nBase64Len
=
0
;
NSFile
::
CBase64Converter
::
Encode
(
pSignature
,
(
int
)
nSignatureLen
,
pBase64
,
nBase64Len
,
NSBase64
::
B64_BASE64_FLAG_NONE
);
std
::
string
sReturn
(
pBase64
,
nBase64Len
);
delete
[]
pBase64
;
return
sReturn
;
}
}
std
::
string
GetHash
(
unsigned
char
*
pData
,
unsigned
int
nSize
,
int
nAlg
)
std
::
string
GetHash
(
unsigned
char
*
pData
,
unsigned
int
nSize
,
int
nAlg
)
...
...
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