Improve ckm deserialization errors detection 63/213463/4
authorAlicja Kluczek <a.kluczek@samsung.com>
Tue, 3 Sep 2019 10:10:13 +0000 (12:10 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 9 Sep 2019 07:33:31 +0000 (07:33 +0000)
commit2462933c170b0eed0f76afa8805d8bf346c5dba2
treed436d731c497de79e4b27a6a7125063ee1673e90
parentc0bd1d0122558e1d062269ff33040559990f1803
Improve ckm deserialization errors detection

Add a check to TZSerializableBinary::Deserialize making sure
that deserialized buffer has adequate size.
    * In case of fixed-size data, buffer size should be equal to the
      size given in constructor.
    * In case of variable-size data, buffer size should be less or equal
      to the size given in constructor.

Change-Id: Ie0f80169adb8b758cb7aa2370551bd30410dc8b0
src/manager/crypto/tz-backend/tz-context.cpp
src/manager/crypto/tz-backend/tz-serializer.cpp
src/manager/crypto/tz-backend/tz-serializer.h