Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
93f39820
Commit
93f39820
authored
Feb 20, 2017
by
danh-arm
Committed by
GitHub
Feb 20, 2017
Browse files
Merge pull request #844 from antonio-nino-diaz-arm/an/no-timingsafe
Revert "tbbr: Use constant-time bcmp() to compare hashes"
parents
8da12f61
fabd21ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
drivers/auth/mbedtls/mbedtls_crypto.c
View file @
93f39820
...
...
@@ -217,7 +217,7 @@ static int verify_hash(void *data_ptr, unsigned int data_len,
}
/* Compare values */
rc
=
timingsafe_b
cmp
(
data_hash
,
hash
,
mbedtls_md_get_size
(
md_info
));
rc
=
mem
cmp
(
data_hash
,
hash
,
mbedtls_md_get_size
(
md_info
));
if
(
rc
!=
0
)
{
return
CRYPTO_ERR_HASH
;
}
...
...
drivers/auth/mbedtls/mbedtls_x509_parser.c
View file @
93f39820
...
...
@@ -393,7 +393,7 @@ static int cert_parse(void *img, unsigned int img_len)
if
(
sig_alg1
.
len
!=
sig_alg2
.
len
)
{
return
IMG_PARSER_ERR_FORMAT
;
}
if
(
0
!=
timingsafe_b
cmp
(
sig_alg1
.
p
,
sig_alg2
.
p
,
sig_alg1
.
len
))
{
if
(
0
!=
mem
cmp
(
sig_alg1
.
p
,
sig_alg2
.
p
,
sig_alg1
.
len
))
{
return
IMG_PARSER_ERR_FORMAT
;
}
memcpy
(
&
sig_alg
,
&
sig_alg1
,
sizeof
(
sig_alg
));
...
...
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