Repository navigation
Conversation
Clear errors raised by key comparison, SPKAC parsing, and JWK import. Ensure TLS and private-key parsing only inspect errors from their own OpenSSL calls. Assisted-by: Codex Signed-off-by: Matteo Collina <hello@matteocollina.com>
|
Review requested:
|
There was a problem hiding this comment.
Can you avoid clearing an already empty queue before every TLS read/write? The change costs 5–9% throughput in local tests with 1 KiB records. This avoids the regression:
if (ERR_set_mark() != 0) ERR_clear_error();Can you also move the ClearErrorOnReturn in KeyObjectHandle::Equals() into the public/private-key branch? Secret-key comparisons don't generate these errors.
The test also needs independent queue checks: createPrivateKey() now clears the queue itself, so it hides missing cleanup in the preceding operation. Can you add cctests that check the queue directly after each source, plus a TLS test that injects stale errors between reads?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67225 +/- ##
==========================================
+ Coverage 90.69% 90.70% +0.01%
==========================================
Files 797 797
Lines 278883 278904 +21
Branches 53630 53630
==========================================
+ Hits 252934 252984 +50
+ Misses 16314 16269 -45
- Partials 9635 9651 +16
🚀 New features to boost your workflow:
|
Several crypto operations can leave errors in OpenSSL's thread-local queue after returning a normal result or a Node.js error. A later operation can then consume those stale errors.
Clear errors at the affected API boundaries and before TLS I/O and private-key parsing so each operation only observes its own errors. Add regression coverage for key comparison, SPKAC methods, and EC JWK import.