Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b5043a1bb | ||
|
|
8001a8678a |
@@ -29,7 +29,7 @@ val gitExecutor = objects.newInstance(GitExecutor::class.java)
|
|||||||
|
|
||||||
val gitCommitCount = gitExecutor.execute("git rev-list HEAD --count", rootDir).toInt()
|
val gitCommitCount = gitExecutor.execute("git rev-list HEAD --count", rootDir).toInt()
|
||||||
val gitCommitHash = gitExecutor.execute("git rev-parse --verify --short HEAD", rootDir)
|
val gitCommitHash = gitExecutor.execute("git rev-parse --verify --short HEAD", rootDir)
|
||||||
val verName = "v4.3"
|
val verName = "v4.4"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "org.matrix.TEESimulator"
|
namespace = "org.matrix.TEESimulator"
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ object InterceptorUtils {
|
|||||||
val parcel = Parcel.obtain().apply {
|
val parcel = Parcel.obtain().apply {
|
||||||
writeInt(EX_SERVICE_SPECIFIC)
|
writeInt(EX_SERVICE_SPECIFIC)
|
||||||
writeString(null)
|
writeString(null)
|
||||||
|
writeInt(0) // empty remote stack trace header (AOSP Status.cpp:196)
|
||||||
writeInt(errorCode)
|
writeInt(errorCode)
|
||||||
}
|
}
|
||||||
return BinderInterceptor.TransactionResult.OverrideReply(parcel)
|
return BinderInterceptor.TransactionResult.OverrideReply(parcel)
|
||||||
@@ -119,6 +120,8 @@ object InterceptorUtils {
|
|||||||
|
|
||||||
/** Checks if a reply parcel contains an exception without consuming it. */
|
/** Checks if a reply parcel contains an exception without consuming it. */
|
||||||
fun hasException(reply: Parcel): Boolean {
|
fun hasException(reply: Parcel): Boolean {
|
||||||
return runCatching { reply.readException() }.exceptionOrNull() != null
|
val exception = runCatching { reply.readException() }.exceptionOrNull()
|
||||||
|
if (exception != null) reply.setDataPosition(0)
|
||||||
|
return exception != null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -129,7 +129,7 @@ object ListEntriesHandler {
|
|||||||
startPastAlias: String?,
|
startPastAlias: String?,
|
||||||
): List<KeyDescriptor> {
|
): List<KeyDescriptor> {
|
||||||
return KeyMintSecurityLevelInterceptor.generatedKeys.keys
|
return KeyMintSecurityLevelInterceptor.generatedKeys.keys
|
||||||
.filter { it.uid == uid && (startPastAlias == null || it.alias < startPastAlias) }
|
.filter { it.uid == uid && (startPastAlias == null || it.alias > startPastAlias) }
|
||||||
.map { keyId ->
|
.map { keyId ->
|
||||||
KeyDescriptor().apply {
|
KeyDescriptor().apply {
|
||||||
this.domain = Domain.APP
|
this.domain = Domain.APP
|
||||||
|
|||||||
+16
-1
@@ -3,6 +3,7 @@ package org.matrix.TEESimulator.interception.keystore.shim
|
|||||||
import android.hardware.security.keymint.Algorithm
|
import android.hardware.security.keymint.Algorithm
|
||||||
import android.hardware.security.keymint.KeyParameter
|
import android.hardware.security.keymint.KeyParameter
|
||||||
import android.hardware.security.keymint.KeyParameterValue
|
import android.hardware.security.keymint.KeyParameterValue
|
||||||
|
import android.hardware.security.keymint.KeyOrigin
|
||||||
import android.hardware.security.keymint.Tag
|
import android.hardware.security.keymint.Tag
|
||||||
import android.os.IBinder
|
import android.os.IBinder
|
||||||
import android.os.Parcel
|
import android.os.Parcel
|
||||||
@@ -425,12 +426,20 @@ class KeyMintSecurityLevelInterceptor(
|
|||||||
params: KeyMintAttestation,
|
params: KeyMintAttestation,
|
||||||
descriptor: KeyDescriptor,
|
descriptor: KeyDescriptor,
|
||||||
): KeyEntryResponse {
|
): KeyEntryResponse {
|
||||||
|
val normalizedKeyDescriptor =
|
||||||
|
KeyDescriptor().apply {
|
||||||
|
domain = Domain.KEY_ID
|
||||||
|
nspace = descriptor.nspace
|
||||||
|
alias = null
|
||||||
|
blob = null
|
||||||
|
}
|
||||||
val metadata =
|
val metadata =
|
||||||
KeyMetadata().apply {
|
KeyMetadata().apply {
|
||||||
keySecurityLevel = securityLevel
|
keySecurityLevel = securityLevel
|
||||||
key = descriptor
|
key = normalizedKeyDescriptor
|
||||||
CertificateHelper.updateCertificateChain(this, chain.toTypedArray()).getOrThrow()
|
CertificateHelper.updateCertificateChain(this, chain.toTypedArray()).getOrThrow()
|
||||||
authorizations = params.toAuthorizations(securityLevel)
|
authorizations = params.toAuthorizations(securityLevel)
|
||||||
|
modificationTimeMs = System.currentTimeMillis()
|
||||||
}
|
}
|
||||||
return KeyEntryResponse().apply {
|
return KeyEntryResponse().apply {
|
||||||
this.metadata = metadata
|
this.metadata = metadata
|
||||||
@@ -665,6 +674,12 @@ private fun KeyMintAttestation.toAuthorizations(securityLevel: Int): Array<Autho
|
|||||||
authList.add(createAuth(Tag.ALGORITHM, KeyParameterValue.algorithm(this.algorithm)))
|
authList.add(createAuth(Tag.ALGORITHM, KeyParameterValue.algorithm(this.algorithm)))
|
||||||
authList.add(createAuth(Tag.KEY_SIZE, KeyParameterValue.integer(this.keySize)))
|
authList.add(createAuth(Tag.KEY_SIZE, KeyParameterValue.integer(this.keySize)))
|
||||||
authList.add(createAuth(Tag.EC_CURVE, KeyParameterValue.ecCurve(this.ecCurve)))
|
authList.add(createAuth(Tag.EC_CURVE, KeyParameterValue.ecCurve(this.ecCurve)))
|
||||||
|
authList.add(
|
||||||
|
createAuth(
|
||||||
|
Tag.ORIGIN,
|
||||||
|
KeyParameterValue.origin(this.origin ?: KeyOrigin.GENERATED),
|
||||||
|
)
|
||||||
|
)
|
||||||
authList.add(createAuth(Tag.NO_AUTH_REQUIRED, KeyParameterValue.boolValue(true)))
|
authList.add(createAuth(Tag.NO_AUTH_REQUIRED, KeyParameterValue.boolValue(true)))
|
||||||
|
|
||||||
return authList.toTypedArray()
|
return authList.toTypedArray()
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
## TEESimulator v4.4: AOSP Conformance
|
||||||
|
|
||||||
|
- **Binder error reply format** — Aligned EX_SERVICE_SPECIFIC wire layout with AOSP Status.cpp, including the remote stack trace header field.
|
||||||
|
- **Key enumeration** — Corrected list_past_alias pagination order to match AOSP database.rs semantics.
|
||||||
|
- **KeyMetadata fields** — Generated key responses now include modificationTimeMs, Tag.ORIGIN, and normalized KeyDescriptor fields per AOSP Keystore2.
|
||||||
|
- **Parcel handling** — hasException() preserves reply position for downstream consumers.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## TEESimulator v4.3: Performance & Reliability
|
## TEESimulator v4.3: Performance & Reliability
|
||||||
|
|
||||||
- **Debug log gating** — `SystemLogger.debug()` now skipped entirely in release builds, eliminating unnecessary logcat syscalls on every intercepted transaction.
|
- **Debug log gating** — `SystemLogger.debug()` now skipped entirely in release builds, eliminating unnecessary logcat syscalls on every intercepted transaction.
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version": "v4.3",
|
"version": "v4.4",
|
||||||
"versionCode": 107,
|
"versionCode": 109,
|
||||||
"zipUrl": "https://github.com/Enginex0/TEESimulator/releases/download/v4.3/TEESimulator-v4.3-Release.zip",
|
"zipUrl": "https://github.com/Enginex0/TEESimulator/releases/download/v4.4/TEESimulator-v4.4-Release.zip",
|
||||||
"changelog": "https://raw.githubusercontent.com/Enginex0/TEESimulator/main/module/changelog.md"
|
"changelog": "https://raw.githubusercontent.com/Enginex0/TEESimulator/main/module/changelog.md"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user