Make sure yaca_*alloc() is not called with 0 size 06/73006/3
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 3 Jun 2016 12:45:49 +0000 (14:45 +0200)
committerLukasz Pawelczyk <l.pawelczyk@samsung.com>
Mon, 6 Jun 2016 12:45:11 +0000 (14:45 +0200)
commita02560f454d462dcb436c2e9ef57d8995c39f431
tree23f2ffe1439253982a3a94d2d802c8e57ad35ee6
parentcd70af649c4cacb5e33fed26731f9a5c4244bac2
Make sure yaca_*alloc() is not called with 0 size

- Add asserts
- Don't install static locks if CRYPTO_num_locks == 0
- Treat 0 output length as YACA_ERROR_INTERNAL:
  - If client provided a 0-length key we should detect it in yaca_sign_*init()
    and prevent him from using it. If it has 0 length in
    get_sign_output_length() it's an internal error.

Change-Id: I5d2d4063c568f76a25ee616b40c99abd5cc4dfa9
src/crypto.c
src/digest.c
src/encrypt.c
src/key.c
src/sign.c
src/simple.c