]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/platform-hardware-interfaces.git/commit
VTS: fix VtsHalKeymasterV3_0Target issue
authorIris Chang <iris.chang@mediatek.com>
Thu, 14 Sep 2017 07:23:18 +0000 (15:23 +0800)
committerHung-ying Tyan <tyanh@google.com>
Fri, 6 Oct 2017 01:51:46 +0000 (09:51 +0800)
commit926a8e7440a0c85d39dbf7143bfe03964363ddec
tree444d830855c5c05d3532218c9babe4682a67e9b8
parentff7dcd7e4d50ce99f57bd0cee90aded7036c5388
VTS: fix VtsHalKeymasterV3_0Target issue

Failed cases:
AttestationTest.RsaAttestation
AttestationTest.EcAttestation

Analysis:
The verify_attestation_record() in Keymaster_hidl_hal_test.cpp calls
parse_attestation_record() to set the value of att_challenge. It fails
to compare att_challenge with challenge by memcmp.
Because setToExternal() method uses buffer pointer to local variable
(record), not use memcpy to copy into itself buffer in
parse_attestation_record(). When it leaves the parse_attestation_record(),
we will get the att_challenge which is null buffer to compare with challenge
incorrectly.

Fix: use memcpy to copy the buffer.

Bug: 65039571
Test: build passed. VtsHalKeymasterV3_0Target -> PASSED: 106, FAILED: 0.
Change-Id: I700a9242cc9a5f4cb196b62860823601e4088531
Merged-In: I700a9242cc9a5f4cb196b62860823601e4088531
(cherry picked from 54ca32a130a0450b444848046199d62876b55301)
keymaster/3.0/vts/functional/attestation_record.cpp