Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
e4a1625a
Commit
e4a1625a
authored
Oct 16, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compare literal values if times are not well-formed for semantic comparison
parent
2d824a69
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
4 deletions
+44
-4
skeletons/GeneralizedTime.c
skeletons/GeneralizedTime.c
+22
-2
skeletons/UTCTime.c
skeletons/UTCTime.c
+22
-2
No files found.
skeletons/GeneralizedTime.c
View file @
e4a1625a
...
...
@@ -766,8 +766,28 @@ GeneralizedTime_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
if
(
a
&&
b
)
{
int
afrac_value
,
afrac_digits
;
int
bfrac_value
,
bfrac_digits
;
time_t
at
=
asn_GT2time_frac
(
a
,
&
afrac_value
,
&
afrac_digits
,
0
,
0
);
time_t
bt
=
asn_GT2time_frac
(
b
,
&
bfrac_value
,
&
bfrac_digits
,
0
,
0
);
int
aerr
,
berr
;
time_t
at
,
bt
;
errno
=
EPERM
;
at
=
asn_GT2time_frac
(
a
,
&
afrac_value
,
&
afrac_digits
,
0
,
0
);
aerr
=
errno
;
errno
=
EPERM
;
bt
=
asn_GT2time_frac
(
b
,
&
bfrac_value
,
&
bfrac_digits
,
0
,
0
);
berr
=
errno
;
if
(
at
==
-
1
&&
aerr
!=
EPERM
)
{
if
(
bt
==
-
1
&&
berr
!=
EPERM
)
{
return
OCTET_STRING_compare
(
td
,
aptr
,
bptr
);
}
else
{
return
-
1
;
}
}
else
if
(
bt
==
-
1
&&
berr
!=
EPERM
)
{
return
1
;
}
else
{
/* Both values are valid. */
}
if
(
at
<
bt
)
{
return
-
1
;
}
else
if
(
at
>
bt
)
{
...
...
skeletons/UTCTime.c
View file @
e4a1625a
...
...
@@ -235,8 +235,28 @@ UTCTime_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
(
void
)
td
;
if
(
a
&&
b
)
{
time_t
at
=
asn_UT2time
(
a
,
0
,
0
);
time_t
bt
=
asn_UT2time
(
b
,
0
,
0
);
time_t
at
,
bt
;
int
aerr
,
berr
;
errno
=
EPERM
;
at
=
asn_UT2time
(
a
,
0
,
0
);
aerr
=
errno
;
errno
=
EPERM
;
bt
=
asn_UT2time
(
b
,
0
,
0
);
berr
=
errno
;
if
(
at
==
-
1
&&
aerr
!=
EPERM
)
{
if
(
bt
==
-
1
&&
berr
!=
EPERM
)
{
return
OCTET_STRING_compare
(
td
,
aptr
,
bptr
);
}
else
{
return
-
1
;
}
}
else
if
(
bt
==
-
1
&&
berr
!=
EPERM
)
{
return
1
;
}
else
{
/* Both values are valid. */
}
if
(
at
<
bt
)
{
return
-
1
;
}
else
if
(
at
>
bt
)
{
...
...
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