ssflib: Fix to incorrect nonce len check in auth encryption 42/149142/1
authorLukasz Kostyra <l.kostyra@samsung.com>
Thu, 7 Sep 2017 06:18:40 +0000 (08:18 +0200)
committerLukasz Kostyra <l.kostyra@samsung.com>
Mon, 11 Sep 2017 14:52:17 +0000 (16:52 +0200)
Change-Id: Idc4c7a17f219bfc1325b24b14522526d5facbdf1

ssflib/src/ssf_crypto.cpp

index fc37aef..c2af260 100644 (file)
@@ -2292,8 +2292,8 @@ TEE_Result TEE_AEInit(TEE_OperationHandle operation, void* nonce, size_t nonceLe
                LOGE(SSF_LIB, "Key not set in operation");
                CRYPTO_PANIC;
        }
-       // nonce check (must be equal to AES block size)
-       if (nonce == NULL || nonceLen != 16) {
+       // nonce check
+       if (nonce == NULL || nonceLen < 12) {
                LOGE(SSF_LIB, "Incorrect nonce provided");
                CRYPTO_PANIC;
        }