Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -261,7 +261,7 @@ public void testGenerateCsrProdMode() {
init();
short[] noOfKeys = {0, 5, 10};
for (int i = 0; i < noOfKeys.length; i++) {
testGenerateCsr(noOfKeys[i] /*no_keys*/, (short) 2 /*eek_chain_len*/, true /*testMode*/);
testGenerateCsr(noOfKeys[i] /*no_keys*/, (short) 2 /*eek_chain_len*/, false /*testMode*/);
KMRepository.instance().clean();
}
cleanUp();
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -447,7 +447,7 @@ public static void validateProtectedData(KMSEProvider cryptoProvider, KMEncoder
// Validate the decrypted payload.
// payload = [signedMac + bcc + ? AdditionalCertChain]
//--------------------------------------------
short payloadLength = 3;
short payloadLength = testMode ? (short) 2 : (short) 3;
short additionalCertChain = 0;
short headersExp = KMCoseHeaders.exp();
short coseKeyExp = KMCoseKey.exp();
Expand All@@ -468,8 +468,10 @@ public static void validateProtectedData(KMSEProvider cryptoProvider, KMEncoder
KMArray.cast(arrInst).add((short) 2, KMByteBlob.exp());
KMArray.cast(arrInst).add((short) 3, KMByteBlob.exp());
short coseSignArr = KMArray.exp(arrInst);
additionalCertChain = KMMap.instance((short) 1);
KMMap.cast(additionalCertChain).add((short) 0, KMTextString.exp(), coseSignArr);
if (!testMode) {
additionalCertChain = KMMap.instance((short) 1);
KMMap.cast(additionalCertChain).add((short) 0, KMTextString.exp(), coseSignArr);
}
// protected payload exp
short payload = KMArray.instance(payloadLength);
KMArray.cast(payload).add((short) 0, signedMacArr);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -561,6 +561,10 @@ public void process(short ins, APDU apdu) throws Exception {
}

private boolean isAdditionalCertificateChainPresent() {
if ((TRUE == data[getEntry(TEST_MODE)])) {
// In test mode, don't include AdditionalCertificateChain in ProtectedData.
return false;
}
return (storeDataInst.getAdditionalCertChainLength() == 0 ? false : true);
}

Expand Down