fix(native-certgen): address production audit findings

Make logging init idempotent (swallow SetGlobalDefaultError on repeat
call), remove unused dumpLogs JNI params that violated the API contract,
and strip dead public_key_spki field + build_ec_spki() that were
computed on every keygen but never consumed by the cert builder.
This commit is contained in:
Enginex0
2026-03-09 18:16:50 +01:00
parent 6aba82edb1
commit f781f61f44
5 changed files with 5 additions and 80 deletions
-2
View File
@@ -126,8 +126,6 @@ fn init_logging_inner(env: &mut JNIEnv, verbose: jboolean, log_dir: &JString) ->
pub extern "system" fn Java_org_matrix_TEESimulator_pki_NativeCertGen_dumpLogs(
mut env: JNIEnv,
_class: JClass,
_log_dir: JString,
_base_dir: JString,
) -> jstring {
let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
dump_logs_inner(&mut env)