diff options
author | Shawn Willden <swillden@google.com> | 2015-06-24 12:22:02 -0700 |
---|---|---|
committer | Shawn Willden <swillden@google.com> | 2015-06-24 15:14:25 -0700 |
commit | 2101e9e8215cce6da36d8d7382486737b68e8c93 (patch) | |
tree | 6659ab46406f8b24762d7d811bc7f63105a58d0e /ecdsa_operation.cpp | |
parent | 0afa3c8a03fc817279bdf0f46abe3dc7a3fd53e1 (diff) | |
download | keymaster-2101e9e8215cce6da36d8d7382486737b68e8c93.tar.gz |
Handle ECDSA messages that may be a few bits longer than the key.
Also fix an RSA error message.
Bug: 22064177
Change-Id: If52b29a3e870e0318d9ecc0f124074a013cb491a
Diffstat (limited to 'ecdsa_operation.cpp')
-rw-r--r-- | ecdsa_operation.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ecdsa_operation.cpp b/ecdsa_operation.cpp index 5833716..4c7b96f 100644 --- a/ecdsa_operation.cpp +++ b/ecdsa_operation.cpp @@ -93,7 +93,7 @@ keymaster_error_t EcdsaOperation::InitDigest() { } keymaster_error_t EcdsaOperation::StoreData(const Buffer& input, size_t* input_consumed) { - if (!data_.reserve(EVP_PKEY_bits(ecdsa_key_) / 8)) + if (!data_.reserve((EVP_PKEY_bits(ecdsa_key_) + 7) / 8)) return KM_ERROR_MEMORY_ALLOCATION_FAILED; // If the write fails, it's because input length exceeds key size. |