trousers: Add boundary check functions

Add Trspi_UnloadBlob_KEY_s and Trspi_UnloadBlob_KEY12_s. Avoid
cryptohomed crash if the cryptohome.key's content is incorrect.

BUG=b:202811484
TEST=Test pattern in b/202811484 cannot crash cryptohomed

Change-Id: Ib3cef6570e7c2511c14c614034282bc41b422a08
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/trousers/+/3358228
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Tested-by: Yi-An Chen <chenyian@google.com>
Commit-Queue: Yi-An Chen <chenyian@google.com>
5 files changed