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 32cfcb3ece
commit 6df266b688
5 changed files with 5 additions and 80 deletions
+3 -2
View File
@@ -29,12 +29,13 @@ pub fn init(
let rotating_layer = rotating::RotatingFileLayer::new(log_dir, max_size, max_files);
let stderr_layer = tracing_subscriber::fmt::layer().with_writer(std::io::stderr);
tracing_subscriber::registry()
// Idempotent — second call returns Ok instead of propagating SetGlobalDefaultError
let _ = tracing_subscriber::registry()
.with(filter)
.with(kmsg_layer)
.with(rotating_layer)
.with(stderr_layer)
.try_init()?;
.try_init();
Ok(())
}