hotp: fix buffer overflow issue

The size for the key to register, provided by non-secure world is never
checked, hence it's possible to do an buffer overflow attack in the
HOTP TA. Add a check to control that the size provided isn't greater
that sizeof(K) fixes the issue.

Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
Reported-by: Ronan Loftus <loftus@riscure.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
1 file changed
tree: 83a588af7f71bf3effd883ac27aa0e63440752d5
  1. acipher/
  2. aes/
  3. hello_world/
  4. hotp/
  5. random/
  6. secure_storage/
  7. .gitignore
  8. Android.mk
  9. CMakeLists.txt
  10. CMakeToolchain.txt
  11. LICENSE
  12. Makefile
  13. README.md
README.md

OP-TEE Sample Applications

This git contains source code for sample host and Trusted Application that can be used directly in the OP-TEE project.

All official OP-TEE documentation has moved to http://optee.readthedocs.io. The information that used to be here in this git can be found under optee_examples.

// OP-TEE core maintainers