Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP OpenSSL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP OpenSSL
Commits
fdc35a9d
Commit
fdc35a9d
authored
10 years ago
by
Emilia Kasper
Browse files
Options
Downloads
Patches
Plain Diff
Add missing tests
Accidentally omitted from commit
455b65df
Reviewed-by:
Kurt Roeckx
<
kurt@openssl.org
>
parent
5886354d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
crypto/constant_time_test.c
+7
-5
7 additions, 5 deletions
crypto/constant_time_test.c
with
7 additions
and
5 deletions
crypto/constant_time_test.c
+
7
−
5
View file @
fdc35a9d
...
...
@@ -201,14 +201,14 @@ static int test_eq_int(int a, int b)
unsigned
int
equal
=
constant_time_eq_int
(
a
,
b
);
if
(
a
==
b
&&
equal
!=
CONSTTIME_TRUE
)
{
fprintf
(
stderr
,
"Test failed for constant_time_
selec
t(%d, %d): "
fprintf
(
stderr
,
"Test failed for constant_time_
eq_in
t(%d, %d): "
"expected %du(TRUE), got %du
\n
"
,
a
,
b
,
CONSTTIME_TRUE
,
equal
);
return
1
;
}
else
if
(
a
!=
b
&&
equal
!=
CONSTTIME_FALSE
)
{
fprintf
(
stderr
,
"Test failed for constant_time_
selec
t(%d, %d): "
fprintf
(
stderr
,
"Test failed for constant_time_
eq_in
t(%d, %d): "
"expected %du(FALSE), got %du
\n
"
,
a
,
b
,
CONSTTIME_FALSE
,
equal
);
return
1
;
...
...
@@ -221,14 +221,14 @@ static int test_eq_int_8(int a, int b)
unsigned
char
equal
=
constant_time_eq_int_8
(
a
,
b
);
if
(
a
==
b
&&
equal
!=
CONSTTIME_TRUE_8
)
{
fprintf
(
stderr
,
"Test failed for constant_time_
select
(%d, %d): "
fprintf
(
stderr
,
"Test failed for constant_time_
eq_int_8
(%d, %d): "
"expected %u(TRUE), got %u
\n
"
,
a
,
b
,
CONSTTIME_TRUE_8
,
equal
);
return
1
;
}
else
if
(
a
!=
b
&&
equal
!=
CONSTTIME_FALSE_8
)
{
fprintf
(
stderr
,
"Test failed for constant_time_
select
(%d, %d): "
fprintf
(
stderr
,
"Test failed for constant_time_
eq_int_8
(%d, %d): "
"expected %u(FALSE), got %u
\n
"
,
a
,
b
,
CONSTTIME_FALSE_8
,
equal
);
return
1
;
...
...
@@ -300,7 +300,9 @@ int main(int argc, char *argv[])
{
d
=
signed_test_values
[
j
];
num_failed
+=
test_select_int
(
c
,
d
);
num_all
+=
1
;
num_failed
+=
test_eq_int
(
c
,
d
);
num_failed
+=
test_eq_int_8
(
c
,
d
);
num_all
+=
3
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment