commit | 3dfffca12cb483bee81b6f65b6aeed027204b8f1 | [log] [tgz] |
---|---|---|
author | Vadim Bendebury <[email protected]> | Tue Oct 20 17:17:54 2015 -0700 |
committer | chrome-bot <[email protected]> | Wed Oct 21 01:17:57 2015 +0000 |
tree | 6b814017c454089e1c9e6e23a2b706c944bd19a8 | |
parent | 67fb16032ad9462343032236d5ae96ef90cf2499 [diff] [blame] |
report error if input buffer is larger than expected Let's make the implementation exact and always return TPM_RC_SIZE if unmarshaling returns success but there are some leftover data. BUG=chrome-os-partner:43025 TEST=fixed test is described in https://goo.gl/kQnud0, all previously passing tests still succeed Change-Id: I05f9c86d4a2a93bc5cdf73d4e743d56c3d53bdaa Signed-off-by: Vadim Bendebury <[email protected]> Reviewed-on: https://chromium-review.googlesource.com/307602 Reviewed-by: Utkarsh Sanghi <[email protected]>
diff --git a/Marshal_PolicySigned.c b/Marshal_PolicySigned.c index ee37c63..c5068f1 100644 --- a/Marshal_PolicySigned.c +++ b/Marshal_PolicySigned.c
@@ -64,6 +64,9 @@ if (result != TPM_RC_SUCCESS) { return result; } + if ((result == TPM_RC_SUCCESS) && *size) { + result = TPM_RC_SIZE; + } return result; }