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
e50864fa
Commit
e50864fa
authored
Jun 05, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c8c0924c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
2 deletions
+41
-2
DesktopEditor/xmlsec/test/openssl_linux/main.cpp
DesktopEditor/xmlsec/test/openssl_linux/main.cpp
+41
-2
No files found.
DesktopEditor/xmlsec/test/openssl_linux/main.cpp
View file @
e50864fa
...
...
@@ -8,7 +8,42 @@
#include "../../../common/File.h"
#if 0
static
time_t
ASN1_GetTimeT
(
ASN1_TIME
*
time
)
{
struct
tm
t
;
const
char
*
str
=
(
const
char
*
)
time
->
data
;
size_t
i
=
0
;
memset
(
&
t
,
0
,
sizeof
(
t
));
if
(
time
->
type
==
V_ASN1_UTCTIME
)
{
/* two digit year */
t
.
tm_year
=
(
str
[
i
++
]
-
'0'
)
*
10
;
t
.
tm_year
+=
(
str
[
i
++
]
-
'0'
);
if
(
t
.
tm_year
<
70
)
t
.
tm_year
+=
100
;
}
else
if
(
time
->
type
==
V_ASN1_GENERALIZEDTIME
)
{
/* four digit year */
t
.
tm_year
=
(
str
[
i
++
]
-
'0'
)
*
1000
;
t
.
tm_year
+=
(
str
[
i
++
]
-
'0'
)
*
100
;
t
.
tm_year
+=
(
str
[
i
++
]
-
'0'
)
*
10
;
t
.
tm_year
+=
(
str
[
i
++
]
-
'0'
);
t
.
tm_year
-=
1900
;
}
t
.
tm_mon
=
(
str
[
i
++
]
-
'0'
)
*
10
;
t
.
tm_mon
+=
(
str
[
i
++
]
-
'0'
)
-
1
;
// -1 since January is 0 not 1.
t
.
tm_mday
=
(
str
[
i
++
]
-
'0'
)
*
10
;
t
.
tm_mday
+=
(
str
[
i
++
]
-
'0'
);
t
.
tm_hour
=
(
str
[
i
++
]
-
'0'
)
*
10
;
t
.
tm_hour
+=
(
str
[
i
++
]
-
'0'
);
t
.
tm_min
=
(
str
[
i
++
]
-
'0'
)
*
10
;
t
.
tm_min
+=
(
str
[
i
++
]
-
'0'
);
t
.
tm_sec
=
(
str
[
i
++
]
-
'0'
)
*
10
;
t
.
tm_sec
+=
(
str
[
i
++
]
-
'0'
);
/* Note: we did not adjust the time based on time zone information */
return
mktime
(
&
t
);
}
#if 1
int
main
()
{
std
::
wstring
sFolderW
=
NSFile
::
GetProcessDirectory
();
...
...
@@ -55,6 +90,10 @@ int main()
if
(
asn1_serial
==
NULL
)
BIO_printf
(
outbio
,
"Error getting serial number from certificate"
);
ASN1_TIME
*
_time
=
X509_get_notBefore
(
cert
);
const
char
*
s
=
(
const
char
*
)
_time
->
data
;
time_t
time1
=
ASN1_GetTimeT
(
_time
);
/* ---------------------------------------------------------- *
* Print the serial number value, openssl x509 -serial style *
* ---------------------------------------------------------- */
...
...
@@ -194,7 +233,7 @@ int main()
}
#endif
#if
1
#if
0
int main()
{
std::wstring sFolderW = NSFile::GetProcessDirectory();
...
...
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