X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fmanager%2Fcrypto%2Ftz-backend%2Ftz-context.cpp;h=3cf57021fb6677cb6ad70ec7e77abfcb9ce95a98;hb=f746ffb6c1aba2d28630466ed014278cf4c946e2;hp=1359258bc40eca755de2912d2391f8dc93ba216a;hpb=b43f739a1f13d98004ffa73f5f151f772ca9dce2;p=platform%2Fcore%2Fsecurity%2Fkey-manager.git diff --git a/src/manager/crypto/tz-backend/tz-context.cpp b/src/manager/crypto/tz-backend/tz-context.cpp index 1359258..3cf5702 100644 --- a/src/manager/crypto/tz-backend/tz-context.cpp +++ b/src/manager/crypto/tz-backend/tz-context.cpp @@ -50,6 +50,9 @@ namespace { // whatever TA will return us. const uint32_t CIPHER_EXTRA_PADDING_SIZE = 16; +// Maximum size of GCM tag in bytes. +const size_t MAX_GCM_TAG_SIZE = 16; + // Identifier of our TA const TEEC_UUID KEY_MANAGER_TA_UUID = KM_TA_UUID; @@ -547,7 +550,7 @@ RawBuffer TrustZoneContext::finalizeGcmCipher(uint32_t opId, sIn.Serialize(inMemory); TZSerializer sOut; - sOut.Push(new TZSerializableBinary(data.size())); + sOut.Push(new TZSerializableBinary(MAX_GCM_TAG_SIZE, false)); TrustZoneMemory outMemory(m_Context, sOut.GetSize(), TEEC_MEM_OUTPUT); TEEC_Operation op = makeOp(TEEC_VALUE_INOUT, inMemory, outMemory);