Enchantrix/pkg
google-labs-jules[bot] 7c2949a939 fix(crypt): resolve race condition in service initialization
A data race was identified in the lazy initialization of the RSA and PGP services within the `crypt` package. The non-thread-safe `if s.service == nil` check could lead to multiple initializations when accessed concurrently.

This commit resolves the race condition by using `sync.Once` to ensure that the initialization for each service is performed exactly once, making the `Service` struct safe for concurrent use.

Additionally, a new test file, `race_test.go`, has been added to provide a regression test for this specific scenario.

A new file, `AUDIT-CONCURRENCY.md`, has been created to document the findings of the concurrency audit, the remediation steps taken, and the verification process.

Co-authored-by: Snider <631881+Snider@users.noreply.github.com>
2026-02-02 01:20:31 +00:00
..
crypt fix(crypt): resolve race condition in service initialization 2026-02-02 01:20:31 +00:00
enchantrix docs: add examples for checksum algorithms, hashing, PGP operations, and .trix container format 2026-01-13 16:10:30 +00:00
trix docs: add examples for checksum algorithms, hashing, PGP operations, and .trix container format 2026-01-13 16:10:30 +00:00