const RawBuffer &hashPriv,
const RawBuffer &hashPub)
{
- uint32_t pubTagSize = 0;
- uint32_t privTagSize = 0;
uint32_t pubPwdExists = pubPwd.empty() ? 0 : 1;
- if (pubPwdExists) {
- pubTagSize = Params::DEFAULT_AES_GCM_TAG_LEN_BYTES;
- }
+ TZSerializer sOut;
+ if (pubPwdExists)
+ sOut.Push(new TZSerializableBinary(Params::DEFAULT_AES_GCM_TAG_LEN_BYTES));
+
uint32_t privPwdExists = privPwd.empty() ? 0 : 1;
- if (privPwdExists) {
- privTagSize = Params::DEFAULT_AES_GCM_TAG_LEN_BYTES;
- }
+ if (privPwdExists)
+ sOut.Push(new TZSerializableBinary(Params::DEFAULT_AES_GCM_TAG_LEN_BYTES));
push(sIn, EncPwd{pubPwd, pubPwdIv}, EncPwd{privPwd, privPwdIv}, hashPriv, hashPub);
TrustZoneMemory inMemory(m_Context, sIn.GetSize(), TEEC_MEM_INPUT);
sIn.Serialize(inMemory);
- TZSerializer sOut;
- sOut.Push(new TZSerializableBinary(pubTagSize));
- sOut.Push(new TZSerializableBinary(privTagSize));
-
TrustZoneMemory outMemory(m_Context, sOut.GetSize(), TEEC_MEM_OUTPUT);
- TEEC_Operation op = makeOp(TEEC_VALUE_INOUT, inMemory, outMemory);
+ TEEC_Operation op;
+ if (sOut.GetSize() == 0) {
+ op = makeOp(TEEC_VALUE_INOUT, inMemory);
+ } else {
+ op = makeOp(TEEC_VALUE_INOUT, inMemory, outMemory);
+ }
op.params[0].value.b = genParam;
Execute(commandId, &op);