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
..
2017-05-16 10:22:37 +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
2016-08-25 15:42:27 +01:00
2015-10-05 15:23:11 +01:00
2017-06-08 19:48:03 +02:00
2015-09-04 14:21:07 +02:00
2016-05-23 14:29:28 +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
2017-05-11 22:42:14 +01: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
2017-05-16 10:22:37 +01:00
2017-06-06 18:44:14 +02:00
2015-09-25 04:27:22 +02:00
2016-03-18 16:47:10 +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-12 00:18:04 +01:00
2017-05-11 22:42:14 +01:00
2017-05-11 22:42:14 +01:00
2016-10-13 13:48:48 +01:00
2016-09-13 13:30:02 +01:00
2016-10-13 13:51:12 +01:00
2016-10-13 13:54:47 +01:00
2015-09-04 14:21:07 +02:00
2015-09-25 04:27:22 +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
2015-09-04 14:21:07 +02:00
2016-10-13 13:51:12 +01:00
2016-05-23 14:29:29 +01:00
2016-10-13 13:48:48 +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
2016-05-23 14:29:30 +01: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-07-13 14:46:18 +01:00
2016-07-13 14:46:18 +01:00
2016-01-03 16:14:14 +00:00
2016-11-06 12:45:15 +00: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-04-26 14:49:59 +01:00
2017-05-15 11:50:11 +01:00
2015-09-04 14:21:07 +02:00
2017-06-26 13:26:58 +01:00
2015-09-04 14:21:07 +02:00
2017-06-08 10:12:16 +01:00
2017-05-11 22:42:14 +01:00
2015-09-25 04:27:22 +02:00
2017-05-16 10:22:37 +01:00
2016-01-04 12:40:15 +01:00
2017-06-06 19:16:18 +02:00
2016-10-13 13:53:56 +01:00
2016-11-06 12:45:15 +00:00
2015-09-04 14:21:07 +02:00