[Problem] The command received from encryption service is deserialized into a
variable hiding function argument of the same name. Also the received command
was ignored.
[Solution] Check if received command is equal to requested one.
[Verification] Run ckm-tests --group=CKM_ENCRYPTION_DECRYPTION
Change-Id: I16e14dbc8497a9b6ea11d93c8c0a48071562d684
if (CKM_API_SUCCESS != retCode)
return retCode;
- int command;
+ int retCommand;
int counter;
- recv.Deserialize(command, counter, retCode, output);
+ recv.Deserialize(retCommand, counter, retCode, output);
- if (my_counter != counter) {
+ if (my_counter != counter || retCommand != static_cast<int>(command)) {
return CKM_API_ERROR_UNKNOWN;
}