Properly detect the presence of TA
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 2 Mar 2018 14:35:04 +0000 (15:35 +0100)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 12 Mar 2018 09:06:38 +0000 (10:06 +0100)
commit9107c1e02042939f41245dfe90a1b2cd0c2adf08
treea1b2599646361febcfce40795cddc40b5569e128
parentbf9f2a516388182c20fb416762235c26666b69f5
Properly detect the presence of TA

Tef-simulator and optee use different TA file name formats. Key-manager was
detecting the presence of TA by checking the existence of TA file with
hardcoded format. It worked with tef-simulator but it failed to detect the TA
presence in case of optee.

This commit replaces the TA file presence checking with an attempt to open a
session using libteec. If an attempt succeeds the decider selects TZ backend.
Otherwise, it falls back to SW backend.

Change-Id: I840d6b58a1ffa39885a4b8ded0ff70f4147c3de0
src/manager/crypto/platform/decider.cpp