Repository navigation
ROB: Improve RC4 fallback when cryptography can't provide it (#3398) - #3853
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3853 +/- ##
==========================================
+ Coverage 97.87% 97.96% +0.09%
==========================================
Files 57 57
Lines 10760 11096 +336
Branches 2014 2078 +64
==========================================
+ Hits 10531 10870 +339
+ Misses 127 126 -1
+ Partials 102 100 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for the PR. I am tempted to not touch the central imports for this, but detect this specific error when actually doing the problematic calls in the cryptography-based implementation (after having it detected, we can store the state in a suitable manner for mass processing). This avoids the import-time overhead of the availability check. Additionally, I guess we should issue a warning at least once when we use the fallback. |
|
I gave it another try, with the lazy detection approach. Is a little more complex than I expected, mostly as Just found |
Never mind, it was an old version of cryptography, I can't find it in current docs... |
|
I made the suggested modifications, feel free to take a look. |
stefan6419846
left a comment
There was a problem hiding this comment.
Thanks for your patience. Looks good to me now.
## What's new ### Bug Fixes (BUG) - Make remove_from_tree() work on outline items (#3939) by @RISHIKKASULA - Be more lenient about space width in layout mode text extraction (#3992) by @PJBrs - Do not scale the text leading by the font size (#3987) by @matthewkogan - Update annotation appearance stream matrix on page transform (#3968) by @BashfulHippo - Allow repeated page references (#3959) by @yuming-long ### Robustness (ROB) - Improve RC4 fallback when cryptography can't provide it (#3853) by @msylw [Full Changelog](6.16.1...6.16.2)
When
OpenSSLis compiled withoutRC4cryptography will not provide this as well. This breaks the fallback localRC4implementation.This change adds import time verification to cryptography's ability to handle
RC4. If it fails, the existing fallback is used.Only Applies to
RC4,AESis not affected by this change.AI (claude/sonnet) was used to debug the issue and draft the code. It was later edited for scope/simplicity.