commit | a8cef4ae1b31664c9f59c509f6e79c1fc03f4bc4 | [log] [tgz] |
---|---|---|
author | Greg Spencer <gspencer@chromium.org> | Mon Jan 09 19:08:55 2012 |
committer | Greg Spencer <gspencer@chromium.org> | Wed Jan 11 17:40:58 2012 |
tree | 8f71d13ce4e947d8a631fc03d8bfd4f63587d3a7 | |
parent | 6a5717ff0883c1b0441dec59a52da15691769b55 [diff] |
Add detection for corrupt TPM token objects to opencryptoki Currently, opencryptoki will happily try and allocate huge buffers when a file is corrupted and contains an incorrect length. This change adds a check to see that the length of the requested object is less than the size of the whole file. If not, then an error is generated. BUG=chromium-os:24853 TEST=corrupted a file in .tpm directory, and correctly detected it. Change-Id: Id1f8a4bbec9e417b33d63c7e89ff623c0f4fa0fe