1
0
mirror of https://github.com/ARMmbed/mbedtls.git synced 2025-06-05 14:26:42 +08:00
Hanno Becker 59e6963a37 Prevent clever optimization to prematurely quit loop in safe memcmp
The previous version of `mbedtls_ssl_safer_memcmp` did not qualify the
pointers to the arrays to be compared as volatile, theoretically
opening the possibility for the compiler to notice that the loop
operation `diff |= A[i] ^ B[i]` is pointless if `diff = -1`. This
commit changes this. It also declares the stack variable `diff` as
volatile, to force read and write in every loop; omitting that, the
compiler would still be allowed to get away with reading `A[i]` and
`B[i]` but not doing the XOR and not updating `diff`.
2017-06-26 13:26:58 +01:00
..
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2016-10-13 13:51:11 +01:00
2016-12-14 15:27:22 +00:00
2015-09-04 14:21:07 +02:00
2016-05-25 00:59:37 +01:00
2015-09-04 14:21:07 +02:00
2017-03-10 11:31:41 +00:00
2017-05-11 22:42:14 +01:00
2015-09-04 14:21:07 +02:00
2016-01-03 16:14:14 +00:00
2016-01-03 16:14:14 +00:00
2016-01-03 16:14:14 +00:00
2016-10-13 13:51:12 +01:00
2016-10-13 13:48:48 +01:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-10-05 11:41:36 +01:00
2015-09-04 14:21:07 +02:00
2016-11-06 12:45:15 +00:00
2016-01-03 16:14:14 +00:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-09-25 04:27:22 +02:00
2017-05-16 10:22:37 +01:00
2016-11-06 12:45:15 +00:00
2015-09-04 14:21:07 +02:00