zephyr/ext
Leandro Pereira eb0dccdb94 tinycrypt: ecc_dh: Properly clear out temporary secret buffers
Zeroing out 2*NUM_ECC_WORDS bytes starting from the `p2` pointer would
not only write 16 bytes to an 8-byte array allocated on the stack, but
also not clear out important arrays such as `_private` and `tmp`.
Moreover, no memory was cleared out before returning from the function,
and there are two exit points.

Properly memset() all private data and use an empty assembly block
referencing the memory region to avoid the memset() calls to be elided
by the compiler.

Ideally, in the future, all stack-allocated variables that contains
sensitive information should be marked with __attribute__((cleanup)), a
GCC extension that calls a function when the variable exits the scope.
This will not only reduce code size, but for other functions with
multiple exit points, also ensure that sensitive data is always
cleared.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-19 07:48:07 -04:00
..
debug doc: fix uses of back quotes in documentation 2017-08-03 11:08:23 -04:00
fs fs: Update external FAT FS source with new rev 0.12b 2017-01-25 05:31:14 +00:00
hal Revert "ext: simplelink: Import TI SimpleLink SDK host driver for CC3220SF" 2017-08-17 08:53:06 -05:00
lib tinycrypt: ecc_dh: Properly clear out temporary secret buffers 2017-08-19 07:48:07 -04:00
Kbuild kconfig: build code conditionally when possible 2017-08-14 20:32:26 -04:00
Kconfig license: use SPDX identifier for files in ext/ 2017-01-20 20:22:57 -05:00
Makefile ext: Import Segger J-Link RTT library 2016-12-03 15:24:38 +00:00