Skip to content

Commit 4bb88ff

Browse files
committed
chrore: adds regression unit test case
1 parent 494525b commit 4bb88ff

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/lib/test/ObjectTests.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,15 +1782,18 @@ void ObjectTests::testDefaultRSAPrivAttributes()
17821782
0x30, 0xD1, 0x4D, 0x3C, 0x60, 0x33, 0xB5, 0xED, 0x4C, 0x39,
17831783
0xDA, 0x68, 0x78, 0xF9, 0x6B, 0x4F, 0x47, 0x55, 0xB2, 0x02,
17841784
0x00, 0x7E, 0x9C, 0x05 };
1785-
CK_DATE emptyDate;
1785+
CK_DATE startDate = {{'2', '0', '0', '0'}, {'0', '1'}, {'0', '2'}};
1786+
CK_DATE endDate = {{'2', '0', '1', '0'}, {'0', '1'}, {'0', '2'}};
17861787
// Make the key non-sensitive and extractable so that we can test it.
17871788
CK_ATTRIBUTE objTemplate[] = {
17881789
{ CKA_CLASS, &objClass, sizeof(objClass) },
17891790
{ CKA_KEY_TYPE, &objType, sizeof(objType) },
17901791
{ CKA_SENSITIVE, &bFalse, sizeof(bFalse) },
17911792
{ CKA_EXTRACTABLE, &bTrue, sizeof(bTrue) },
17921793
{ CKA_MODULUS, pN, sizeof(pN) },
1793-
{ CKA_PRIVATE_EXPONENT, pD, sizeof(pD) }
1794+
{ CKA_PRIVATE_EXPONENT, pD, sizeof(pD) },
1795+
{ CKA_START_DATE, &startDate, sizeof(startDate) },
1796+
{ CKA_END_DATE, &endDate, sizeof(endDate)}
17941797
};
17951798

17961799
// Just make sure that we finalize any previous tests
@@ -1815,8 +1818,7 @@ void ObjectTests::testDefaultRSAPrivAttributes()
18151818
// Check attributes in RSA public key object
18161819
checkCommonObjectAttributes(hSession, hObject, objClass);
18171820
checkCommonStorageObjectAttributes(hSession, hObject, CK_FALSE, CK_TRUE, CK_TRUE, NULL_PTR, 0, CK_TRUE, CK_TRUE);
1818-
memset(&emptyDate, 0, sizeof(emptyDate));
1819-
checkCommonKeyAttributes(hSession, hObject, objType, NULL_PTR, 0, emptyDate, 0, emptyDate, 0, CK_FALSE, CK_FALSE, CK_UNAVAILABLE_INFORMATION, NULL_PTR, 0);
1821+
checkCommonKeyAttributes(hSession, hObject, objType, NULL_PTR, 0, startDate, sizeof(startDate), endDate, sizeof(endDate), CK_FALSE, CK_FALSE, CK_UNAVAILABLE_INFORMATION, NULL_PTR, 0);
18201822
checkCommonPrivateKeyAttributes(hSession, hObject, NULL_PTR, 0, CK_FALSE, CK_TRUE, CK_TRUE, CK_TRUE, CK_TRUE, CK_TRUE, CK_FALSE, CK_FALSE, CK_FALSE, NULL_PTR, 0, CK_FALSE);
18211823
checkCommonRSAPrivateKeyAttributes(hSession, hObject, pN, sizeof(pN), NULL_PTR, 0, pD, sizeof(pD), NULL_PTR, 0, NULL_PTR, 0, NULL_PTR, 0, NULL_PTR, 0, NULL_PTR, 0);
18221824
checkToTrueAttributes(hSession, hObject);

0 commit comments

Comments
 (0)