Merge "Return correct error code when finish input length is too long."

am: 90657bbeab

Change-Id: I96ea16c713efcc51533b9aafab3624b0070b3dc3
This commit is contained in:
Jocelyn Bohr 2017-08-03 23:44:35 +00:00 committed by android-build-merger
commit efea269a75
1 changed files with 3 additions and 1 deletions

View File

@ -576,7 +576,9 @@ keymaster_error_t TrustyKeymasterDevice::finish(keymaster_operation_handle_t ope
return error_;
}
if (input && input->data_length > kMaximumFinishInputLength) {
return KM_ERROR_INVALID_ARGUMENT;
ALOGE("%zu-byte input to finish; only %zu bytes allowed",
input->data_length, kMaximumFinishInputLength);
return KM_ERROR_INVALID_INPUT_LENGTH;
}
if (out_params) {