Use SignedCsrPayload validator in omecypto provisioning tests

To ensure the ref impl of OEMCrypto_GetDeviceSignedCsrPayload() in OPK
and testbed returns the correct sample format.

Test: opk_ta_p40, run_fake_l1_tests
Bug: 300304834
Change-Id: I6d399774fbaac2e12096cf878d582cd3c1320318
This commit is contained in:
Cong Lin
2023-12-13 14:31:48 -08:00
committed by Robert Shih
parent 778d4f7026
commit ce2af4e96a

View File

@@ -9,6 +9,7 @@
#include "device_info_validator.h" #include "device_info_validator.h"
#include "log.h" #include "log.h"
#include "platform.h" #include "platform.h"
#include "signed_csr_payload_validator.h"
#include "test_sleep.h" #include "test_sleep.h"
namespace wvoec { namespace wvoec {
@@ -406,6 +407,10 @@ TEST_F(OEMCryptoProv40Test, GetDeviceSignedCsrPayloadAPI18) {
&signed_csr_payload_length), &signed_csr_payload_length),
OEMCrypto_SUCCESS); OEMCrypto_SUCCESS);
EXPECT_NE(signed_csr_payload_length, 0uL); EXPECT_NE(signed_csr_payload_length, 0uL);
util::SignedCsrPayloadValidator validator;
EXPECT_EQ(util::CborMessageStatus::kCborParseOk,
validator.Parse(signed_csr_payload));
EXPECT_EQ(util::CborMessageStatus::kCborValidateOk, validator.Validate());
} }
TEST_F(OEMCryptoProv40Test, GetDeviceSignedCsrPayloadInvalid) { TEST_F(OEMCryptoProv40Test, GetDeviceSignedCsrPayloadInvalid) {