Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89c74883 authored by Max Bires's avatar Max Bires
Browse files

Increase challenge size in tests.

VTS tests were currently passing a challenge size of 32 in all cases.
However, the server currently sends a challenge of length 40, which may
or may not change in the future. A 64 byte upper limit provides a
standard size along with flexibility in case the challenge format
changes in the future.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I678bb915f139e4c23354180870a66ce33a9cfd8c
parent 210c44db
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -106,7 +106,8 @@ parcelable ProtectedData {
     *     ]
     *     ]
     *
     *
     *     SignedMacAad = [
     *     SignedMacAad = [
     *         challenge : bstr,
     *         challenge : bstr .size (32..64),   // Size between 32 - 64
     *                                            // bytes inclusive
     *         VerifiedDeviceInfo,
     *         VerifiedDeviceInfo,
     *         tag: bstr                 // This is the tag from COSE_Mac0 of
     *         tag: bstr                 // This is the tag from COSE_Mac0 of
     *                                   // KeysToCertify, to tie the key set to
     *                                   // KeysToCertify, to tie the key set to
+1 −2
Original line number Original line Diff line number Diff line
@@ -358,8 +358,7 @@ TEST_P(GenerateKeyTests, generateEcdsaP256Key_testMode) {


class CertificateRequestTest : public VtsRemotelyProvisionedComponentTests {
class CertificateRequestTest : public VtsRemotelyProvisionedComponentTests {
  protected:
  protected:
    CertificateRequestTest() : eekId_(string_to_bytevec("eekid")), challenge_(randomBytes(32)) {
    CertificateRequestTest() : eekId_(string_to_bytevec("eekid")), challenge_(randomBytes(64)) {}
    }


    void generateTestEekChain(size_t eekLength) {
    void generateTestEekChain(size_t eekLength) {
        auto chain = generateEekChain(rpcHardwareInfo.supportedEekCurve, eekLength, eekId_);
        auto chain = generateEekChain(rpcHardwareInfo.supportedEekCurve, eekLength, eekId_);