Document huge buffer tests in separate group
Explain how the huge buffer tests work. In particular, state that we expect that OEMCrypto returns an error on huge buffers. Staged here: https://developers.devsite.corp.google.com/widevine/drm/client/oemcrypto/v18/oemcrypto-test/group/security Bug: 300645748 Merged from https://widevine-internal-review.googlesource.com/188034 Change-Id: Iba9d652dfe57df6786b0ab60931f02f8ce9b8180
This commit is contained in:
committed by
Robert Shih
parent
3316870a0a
commit
c53047bd1b
@@ -43,6 +43,11 @@
|
||||
*
|
||||
* @defgroup security Security Tests
|
||||
* Buffer overflow tests, off-by-one tests, and other security tests.
|
||||
*
|
||||
* The way the huge buffer tests work is to create a large buffer and then call
|
||||
* the API. The test then loops and doubles the buffer until the API returns an
|
||||
* error. An error is considered a passing test. We expect OEMCrypto to fail
|
||||
* gracefully on a huge buffer rather than crashing.
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -488,6 +493,7 @@ INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoEntitlementLicenseTest,
|
||||
/// @addtogroup security
|
||||
/// @{
|
||||
|
||||
/** Test that LoadEntitledContentKeys fails gracefully on huge buffer. */
|
||||
TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForHugeSubstringContentKeyIdLength) {
|
||||
TestLoadEntitledKeysForHugeBufferLengths(
|
||||
@@ -498,6 +504,7 @@ TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
!kCheckStatus);
|
||||
}
|
||||
|
||||
/** Test that LoadEntitledContentKeys fails gracefully on huge buffer. */
|
||||
TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForHugeSubstringContentKeyIdOffset) {
|
||||
TestLoadEntitledKeysForHugeBufferLengths(
|
||||
@@ -508,6 +515,7 @@ TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
!kCheckStatus);
|
||||
}
|
||||
|
||||
/** Test that LoadEntitledContentKeys fails gracefully on huge buffer. */
|
||||
TEST_F(
|
||||
OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForOutOfRangeSubstringContentKeyIdLength) {
|
||||
@@ -518,6 +526,7 @@ TEST_F(
|
||||
ASSERT_NE(OEMCrypto_SUCCESS, entitled_message_.LoadKeys());
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForOutOfRangeSubstringContentKeyIdOffset) {
|
||||
@@ -528,6 +537,7 @@ TEST_F(
|
||||
ASSERT_NE(OEMCrypto_SUCCESS, entitled_message_.LoadKeys());
|
||||
}
|
||||
|
||||
/** Test that LoadEntitledContentKeys fails gracefully on huge substring. */
|
||||
TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForHugeSubstringEntitlementKeyIdLength) {
|
||||
TestLoadEntitledKeysForHugeBufferLengths(
|
||||
@@ -538,6 +548,7 @@ TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
!kCheckStatus);
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForHugeSubstringEntitlementKeyIdOffset) {
|
||||
TestLoadEntitledKeysForHugeBufferLengths(
|
||||
@@ -548,6 +559,7 @@ TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
!kCheckStatus);
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForOutOfRangeSubstringEntitlementKeyIdLength) {
|
||||
@@ -558,6 +570,7 @@ TEST_F(
|
||||
ASSERT_NE(OEMCrypto_SUCCESS, entitled_message_.LoadKeys());
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForOutOfRangeSubstringEntitlementKeyIdOffset) {
|
||||
@@ -568,6 +581,7 @@ TEST_F(
|
||||
ASSERT_NE(OEMCrypto_SUCCESS, entitled_message_.LoadKeys());
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForHugeSubstringContentKeyDataIvLength) {
|
||||
TestLoadEntitledKeysForHugeBufferLengths(
|
||||
@@ -578,6 +592,7 @@ TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
!kCheckStatus);
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForHugeSubstringContentKeyDataIvOffset) {
|
||||
TestLoadEntitledKeysForHugeBufferLengths(
|
||||
@@ -588,6 +603,7 @@ TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
!kCheckStatus);
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForOutOfRangeSubstringContentKeyDataIvLength) {
|
||||
@@ -598,6 +614,7 @@ TEST_F(
|
||||
ASSERT_NE(OEMCrypto_SUCCESS, entitled_message_.LoadKeys());
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForOutOfRangeSubstringContentKeyDataIvOffset) {
|
||||
@@ -608,6 +625,7 @@ TEST_F(
|
||||
ASSERT_NE(OEMCrypto_SUCCESS, entitled_message_.LoadKeys());
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForHugeSubstringContentKeyDataLength) {
|
||||
TestLoadEntitledKeysForHugeBufferLengths(
|
||||
@@ -618,6 +636,7 @@ TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
!kCheckStatus);
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForHugeSubstringContentKeyDataOffset) {
|
||||
TestLoadEntitledKeysForHugeBufferLengths(
|
||||
@@ -628,6 +647,7 @@ TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
!kCheckStatus);
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForOutOfRangeSubstringContentKeyDataLength) {
|
||||
@@ -638,6 +658,7 @@ TEST_F(
|
||||
ASSERT_NE(OEMCrypto_SUCCESS, entitled_message_.LoadKeys());
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForOutOfRangeSubstringContentKeyDataOffset) {
|
||||
@@ -648,6 +669,7 @@ TEST_F(
|
||||
ASSERT_NE(OEMCrypto_SUCCESS, entitled_message_.LoadKeys());
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForHugeEntitlementKeyIdLength) {
|
||||
TestLoadEntitledKeysForHugeBufferLengths(
|
||||
@@ -658,6 +680,7 @@ TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
!kCheckStatus);
|
||||
}
|
||||
|
||||
/** Test LoadEntitledContentKeys rejects out of range substring. */
|
||||
TEST_F(OEMCryptoMemoryLicenseTest,
|
||||
OEMCryptoMemoryLoadEntitledKeysForHugeContentKeyIdLength) {
|
||||
TestLoadEntitledKeysForHugeBufferLengths(
|
||||
@@ -1025,6 +1048,7 @@ TEST_P(OEMCryptoEntitlementLicenseTest, ReassociateEntitledKeySessionAPI17) {
|
||||
/// @addtogroup security
|
||||
/// @{
|
||||
|
||||
/** Test that LoadLicense fails gracefully on huge buffer. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringKeyIdLength) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1035,6 +1059,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringKeyIdOffset) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1044,6 +1069,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringKeyIdLength) {
|
||||
TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths(
|
||||
@@ -1053,6 +1079,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringKeyIdOffset) {
|
||||
TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths(
|
||||
@@ -1062,6 +1089,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringKeyDataIvLength) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1072,6 +1100,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringKeyDataIvOffset) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1082,6 +1111,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringKeyDataIvLength) {
|
||||
@@ -1093,6 +1123,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringKeyDataIvOffset) {
|
||||
@@ -1104,6 +1135,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringKeyDataLength) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1114,6 +1146,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringKeyDataOffset) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1123,6 +1156,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringKeyDataLength) {
|
||||
@@ -1134,6 +1168,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringKeyDataOffset) {
|
||||
@@ -1145,6 +1180,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringKeyControlIvLength) {
|
||||
@@ -1156,6 +1192,7 @@ TEST_P(
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringKeyControlIvOffset) {
|
||||
@@ -1167,6 +1204,7 @@ TEST_P(
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringKeyControlIvLengthAPI16) {
|
||||
@@ -1179,6 +1217,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringKeyControlIvOffset) {
|
||||
@@ -1191,6 +1230,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringKeyControlLength) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1201,6 +1241,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringKeyControlOffset) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1211,6 +1252,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringKeyControlLengthAPI16) {
|
||||
@@ -1222,6 +1264,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringKeyControlOffset) {
|
||||
@@ -1233,6 +1276,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringEncMacKeyIvLength) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1242,6 +1286,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringEncMacKeyIvOffset) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1251,6 +1296,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringEncMacKeyIvLength) {
|
||||
@@ -1263,6 +1309,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringEncMacKeyIvOffset) {
|
||||
@@ -1275,6 +1322,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringEncMacKeyLength) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1284,6 +1332,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringEncMacKeyOffset) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1293,6 +1342,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringEncMacKeyLength) {
|
||||
@@ -1303,6 +1353,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringEncMacKeyOffset) {
|
||||
@@ -1313,6 +1364,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringPstLength) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1322,6 +1374,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringPstOffset) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1331,6 +1384,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringPstLength) {
|
||||
TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths(
|
||||
@@ -1340,6 +1394,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringPstOffset) {
|
||||
TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths(
|
||||
@@ -1350,6 +1405,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringSrmRestrictionDataLength) {
|
||||
@@ -1360,6 +1416,7 @@ TEST_P(
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageSubstringSrmRestrictionDataOffset) {
|
||||
@@ -1370,6 +1427,7 @@ TEST_P(
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringSrmRestrictionDataLength) {
|
||||
@@ -1382,6 +1440,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on out of range substring. */
|
||||
TEST_P(
|
||||
OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForOutOfRangeCoreMessageSubstringSrmRestrictionDataOffset) {
|
||||
@@ -1394,6 +1453,7 @@ TEST_P(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on huge buffer. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeResponseLength) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1403,6 +1463,7 @@ TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
!kCheckStatus, !kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadLicense fails gracefully on huge buffer. */
|
||||
TEST_P(OEMCryptoLicenseOverflowTest,
|
||||
OEMCryptoMemoryLoadLicenseForHugeCoreMessageLength) {
|
||||
TestLoadLicenseForHugeBufferLengths(
|
||||
@@ -1425,6 +1486,7 @@ INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoLicenseOverflowTest,
|
||||
/// @addtogroup security
|
||||
/// @{
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on huge buffer. */
|
||||
TEST_F(OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForHugeResponseLength) {
|
||||
// TODO(b/197141970): Need to revisit OEMCryptoLoadsCert* tests for
|
||||
@@ -1440,6 +1502,7 @@ TEST_F(OEMCryptoLoadsCertificate,
|
||||
!kCheckStatus, !kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on huge buffer. */
|
||||
TEST_F(OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForHugeCoreMessageLength) {
|
||||
// TODO(b/197141970): Need to revisit OEMCryptoLoadsCert* tests for
|
||||
@@ -1455,6 +1518,7 @@ TEST_F(OEMCryptoLoadsCertificate,
|
||||
!kCheckStatus, !kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on huge buffer. */
|
||||
TEST_F(OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForHugeCoreMessageEncPrivateKeyLength) {
|
||||
// TODO(b/197141970): Need to revisit OEMCryptoLoadsCert* tests for
|
||||
@@ -1470,6 +1534,7 @@ TEST_F(OEMCryptoLoadsCertificate,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on huge buffer. */
|
||||
TEST_F(OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForHugeCoreMessageEncPrivateKeyOffset) {
|
||||
// TODO(b/197141970): Need to revisit OEMCryptoLoadsCert* tests for
|
||||
@@ -1485,6 +1550,7 @@ TEST_F(OEMCryptoLoadsCertificate,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForOutOfRangeCoreMessageEncPrivateKeyLength) {
|
||||
@@ -1504,6 +1570,7 @@ TEST_F(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForOutOfRangeCoreMessageEncPrivateKeyOffset) {
|
||||
@@ -1523,6 +1590,7 @@ TEST_F(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on out of range substring. */
|
||||
TEST_F(OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForHugeCoreMessageEncPrivateKeyIvLength) {
|
||||
// TODO(b/197141970): Need to revisit OEMCryptoLoadsCert* tests for
|
||||
@@ -1539,6 +1607,7 @@ TEST_F(OEMCryptoLoadsCertificate,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on out of range substring. */
|
||||
TEST_F(OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForHugeCoreMessageEncPrivateKeyIvOffset) {
|
||||
// TODO(b/197141970): Need to revisit OEMCryptoLoadsCert* tests for
|
||||
@@ -1555,6 +1624,7 @@ TEST_F(OEMCryptoLoadsCertificate,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForOutOfRangeCoreMessageEncPrivateKeyIvLengthAPI16) {
|
||||
@@ -1574,6 +1644,7 @@ TEST_F(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForOutOfRangeCoreMessageEncPrivateKeyIvOffset) {
|
||||
@@ -1593,6 +1664,7 @@ TEST_F(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on out of range substring. */
|
||||
TEST_F(OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForHugeCoreMessageEncMessageKeyLength) {
|
||||
// TODO(b/197141970): Need to revisit OEMCryptoLoadsCert* tests for
|
||||
@@ -1609,6 +1681,7 @@ TEST_F(OEMCryptoLoadsCertificate,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on out of range substring. */
|
||||
TEST_F(OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForHugeCoreMessageEncMessageKeyOffset) {
|
||||
// TODO(b/197141970): Need to revisit OEMCryptoLoadsCert* tests for
|
||||
@@ -1625,6 +1698,7 @@ TEST_F(OEMCryptoLoadsCertificate,
|
||||
!kCheckStatus, kUpdateCoreMessageSubstringValues);
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForOutOfRangeCoreMessageEncMessageKeyLengthProv30) {
|
||||
@@ -1647,6 +1721,7 @@ TEST_F(
|
||||
});
|
||||
}
|
||||
|
||||
/** Test that LoadProvisioning fails gracefully on out of range substring. */
|
||||
TEST_F(
|
||||
OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryLoadProvisioningForOutOfRangeCoreMessageEncMessageKeyOffsetProv30) {
|
||||
@@ -1674,6 +1749,9 @@ TEST_F(
|
||||
/// @addtogroup security
|
||||
/// @{
|
||||
|
||||
/** Test that OEMCrypto_PrepAndSignProvisioningRequest fails gracefully on a
|
||||
* huge buffer.
|
||||
*/
|
||||
TEST_F(OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryPrepareProvisioningRequestForHugeRequestMessageLength) {
|
||||
// TODO(b/197141970): Need to revisit OEMCryptoLoadsCert* tests for
|
||||
@@ -1689,6 +1767,9 @@ TEST_F(OEMCryptoLoadsCertificate,
|
||||
kCheckStatus);
|
||||
}
|
||||
|
||||
/** Test that OEMCrypto_PrepAndSignProvisioningRequest fails gracefully on a
|
||||
* huge buffer.
|
||||
*/
|
||||
TEST_F(OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryPrepareProvisioningRequestForHugeSignatureLength) {
|
||||
// TODO(b/197141970): Need to revisit OEMCryptoLoadsCert* tests for
|
||||
@@ -1704,6 +1785,9 @@ TEST_F(OEMCryptoLoadsCertificate,
|
||||
!kCheckStatus);
|
||||
}
|
||||
|
||||
/** Test that OEMCrypto_PrepAndSignProvisioningRequest fails gracefully on a
|
||||
* huge buffer.
|
||||
*/
|
||||
TEST_F(OEMCryptoLoadsCertificate,
|
||||
OEMCryptoMemoryPrepareProvisioningRequestForHugeCoreMessageLength) {
|
||||
// TODO(b/197141970): Need to revisit OEMCryptoLoadsCert* tests for
|
||||
|
||||
Reference in New Issue
Block a user