From: Krzysztof Jackiewicz Date: Mon, 20 Mar 2023 12:32:40 +0000 (+0100) Subject: Use proper constant in TZ data import X-Git-Tag: accepted/tizen/unified/20230406.165733~5^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f3a3a0c8a64f799e303070c373fe0ea3db4d1ad;p=platform%2Fcore%2Fsecurity%2Fkey-manager.git Use proper constant in TZ data import Change-Id: I4510a29f1bb8d8dfc2216199465cd2a76701ddb6 --- diff --git a/src/manager/crypto/tz-backend/internals.cpp b/src/manager/crypto/tz-backend/internals.cpp index 0c4c022..e9fe00b 100644 --- a/src/manager/crypto/tz-backend/internals.cpp +++ b/src/manager/crypto/tz-backend/internals.cpp @@ -283,7 +283,6 @@ void importData(const Data &data, pwdBuf, pwdIV, keySizeBits, - Params::DERIVED_KEY_LENGTH_BITS, tag, hash); } diff --git a/src/manager/crypto/tz-backend/tz-context.cpp b/src/manager/crypto/tz-backend/tz-context.cpp index 2e0ffd9..9b08cae 100644 --- a/src/manager/crypto/tz-backend/tz-context.cpp +++ b/src/manager/crypto/tz-backend/tz-context.cpp @@ -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); diff --git a/src/manager/crypto/tz-backend/tz-context.h b/src/manager/crypto/tz-backend/tz-context.h index 0ccfbc5..4f5a69c 100644 --- a/src/manager/crypto/tz-backend/tz-context.h +++ b/src/manager/crypto/tz-backend/tz-context.h @@ -77,7 +77,6 @@ public: const RawBuffer &pwd, const RawBuffer &pwdIV, const uint32_t keySizeBits, - const uint32_t powTagSizeBits, RawBuffer &pwdTag, const RawBuffer &hash);