Fix minor bug in operations.
Note that this bug isn't exposed by the v0.3 API, since it
doesn't allow multi-step signing/verification operations.
Change-Id: I18554e7e1017ed83d3708c134f72cf1d34857437
diff --git a/dsa_operation.cpp b/dsa_operation.cpp
index 18211a8..c2e0fb1 100644
--- a/dsa_operation.cpp
+++ b/dsa_operation.cpp
@@ -37,7 +37,7 @@
}
keymaster_error_t DsaOperation::StoreData(const Buffer& input) {
- if (!data_.reserve(input.available_read()) ||
+ if (!data_.reserve(data_.available_read() + input.available_read()) ||
!data_.write(input.peek_read(), input.available_read()))
return KM_ERROR_INVALID_INPUT_LENGTH;
return KM_ERROR_OK;