Use proper constant in TZ data import 35/290135/4
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 20 Mar 2023 12:32:40 +0000 (13:32 +0100)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 24 Mar 2023 15:56:29 +0000 (16:56 +0100)
Change-Id: I4510a29f1bb8d8dfc2216199465cd2a76701ddb6

src/manager/crypto/tz-backend/internals.cpp
src/manager/crypto/tz-backend/tz-context.cpp
src/manager/crypto/tz-backend/tz-context.h

index 0c4c022..e9fe00b 100644 (file)
@@ -283,7 +283,6 @@ void importData(const Data &data,
                                                                                pwdBuf,
                                                                                pwdIV,
                                                                                keySizeBits,
-                                                                               Params::DERIVED_KEY_LENGTH_BITS,
                                                                                tag,
                                                                                hash);
 }
index 2e0ffd9..9b08cae 100644 (file)
@@ -584,7 +584,6 @@ void TrustZoneContext::importData(
                                const RawBuffer &pwd,
                                const RawBuffer &iv,
                                const uint32_t keySizeBits,
-                               const uint32_t pwdTagSizeBits,
                                RawBuffer &pwdTag,
                                const RawBuffer &hash)
 {
@@ -600,7 +599,7 @@ void TrustZoneContext::importData(
        uint32_t pwd_flag = pwd.empty() ? 0 : 1;
        sIn.Push(new TZSerializableFlag(pwd_flag));
        if (pwd_flag)
-               sIn.Push(new TZSerializablePwdData(pwd, iv, pwdTagSizeBits));
+               sIn.Push(new TZSerializablePwdData(pwd, iv, Params::DEFAULT_AES_GCM_TAG_LEN_BITS));
 
        sIn.Push(new TZSerializableBinary(hash));
 
@@ -610,7 +609,7 @@ void TrustZoneContext::importData(
 
        TZSerializer sOut;
        if (pwd_flag) {
-               sOut.Push(new TZSerializableBinary(pwdTagSizeBits / 8));
+               sOut.Push(new TZSerializableBinary(Params::DEFAULT_AES_GCM_TAG_LEN_BYTES));
        }
 
        TrustZoneMemory outMemory(m_Context, sOut.GetSize(), TEEC_MEM_OUTPUT);
index 0ccfbc5..4f5a69c 100644 (file)
@@ -77,7 +77,6 @@ public:
                                        const RawBuffer &pwd,
                                        const RawBuffer &pwdIV,
                                        const uint32_t keySizeBits,
-                                       const uint32_t powTagSizeBits,
                                        RawBuffer &pwdTag,
                                        const RawBuffer &hash);