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@@ -184,7 +184,7 @@ public static void initStatics() {
}

private KMPoolManager() {
initStatics();
initStatics();
cipherPool = new Object[(short) (CIPHER_ALGS.length * 4)];
// Extra 4 algorithms are used to support TRUSTED_CONFIRMATION_REQUIRED feature.
signerPool = new Object[(short) ((SIG_ALGS.length * 4) + 4)];
Expand All@@ -202,9 +202,8 @@ private KMPoolManager() {
initializeKeysPool();
// Initialize the Crypto and Key objects required for RKP flow.
initializeRKpObjects();

}

private void initializeRKpObjects() {
rkpOPeration = new KMOperationImpl();
rkpAesGcm = Cipher.getInstance(AEADCipher.ALG_AES_GCM, false);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -925,7 +925,7 @@ public void onRestore(Element element, short oldVersion, short currentVersion) {
}

void handleDataUpgrade(short oldVersion, short currentVersion) {
if(oldVersion == 0x0100 && currentVersion == 0x0200) {
if(oldVersion != currentVersion) {
handleProvisionStatusUpgrade();
}
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -159,10 +159,13 @@ public RemotelyProvisionedComponentDevice(KMEncoder encoder, KMDecoder decoder,
operation = JCSystem.makeTransientObjectArray((short) 1, JCSystem.CLEAR_ON_RESET);
dataIndex = JCSystem.makeTransientShortArray((short) 1, JCSystem.CLEAR_ON_RESET);
// Initialize RKP mac key
short offset = repository.alloc((short) RKP_MAC_KEY_SIZE);
byte[] buffer = repository.getHeap();
seProvider.getTrueRandomNumber(buffer, offset, RKP_MAC_KEY_SIZE);
storeDataInst.createRkpMacKey(buffer, offset, RKP_MAC_KEY_SIZE);
if (!seProvider.isUpgrading()) {
short offset = repository.allocReclaimableMemory((short) RKP_MAC_KEY_SIZE);
byte[] buffer = repository.getHeap();
seProvider.getTrueRandomNumber(buffer, offset, RKP_MAC_KEY_SIZE);
storeDataInst.createRkpMacKey(buffer, offset, RKP_MAC_KEY_SIZE);
repository.reclaimMemory(RKP_MAC_KEY_SIZE);
}
operation[0] = null;
createAuthorizedEEKRoot();
}
Expand Down