Workaround for GCM IV length issue 71/293271/3
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 23 May 2023 09:07:23 +0000 (11:07 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 5 Jun 2023 14:05:26 +0000 (16:05 +0200)
commitd6606535ac51bb3e574312106088f3f15843536e
tree497ce02a67300e8c9e73538d39946559844514db
parent1e6e268703fc313a973f06581e21cf62c112e903
Workaround for GCM IV length issue

GCM implementation was ignoring IV bytes except first 12B. The issue has
been fixed but we need to support the decryption of the data encrypted
the old way.

This workaround retries the decryption with an IV truncated to 12B if
the decryption with original IV length fails.

Unit-test included.

Change-Id: Ia1c06d9a7c6f3b75a69c2e1cb3e5f0801776e057
src/manager/crypto/sw-backend/internals.cpp
unit-tests/test_sw-backend.cpp