get_fernet() only checked for an empty ENCRYPTION_KEY. A non-empty but malformed key (not 32 url-safe base64 bytes) let Fernet() raise a raw ValueError that crashed sync_account.
Wrap the Fernet() constructor in a try/except and re-raise as EncryptionError with a clear message.
Test
New tests/test_crypto.py with 5 tests covering: valid key, empty key, malformed key, decrypt with bad key, and roundtrip.
Paperclip-BIT-33940
## Fix
`get_fernet()` only checked for an empty `ENCRYPTION_KEY`. A non-empty but malformed key (not 32 url-safe base64 bytes) let `Fernet()` raise a raw `ValueError` that crashed `sync_account`.
Wrap the `Fernet()` constructor in a try/except and re-raise as `EncryptionError` with a clear message.
## Test
New `tests/test_crypto.py` with 5 tests covering: valid key, empty key, malformed key, decrypt with bad key, and roundtrip.
Paperclip-BIT-33940
get_fernet() only checked for an empty ENCRYPTION_KEY. A non-empty but
malformed key (not 32 url-safe base64 bytes) let Fernet() raise a raw
ValueError that crashed sync_account. Wrap the constructor and re-raise
as EncryptionError with a clear message.
Paperclip-BIT-33940
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fix
get_fernet()only checked for an emptyENCRYPTION_KEY. A non-empty but malformed key (not 32 url-safe base64 bytes) letFernet()raise a rawValueErrorthat crashedsync_account.Wrap the
Fernet()constructor in a try/except and re-raise asEncryptionErrorwith a clear message.Test
New
tests/test_crypto.pywith 5 tests covering: valid key, empty key, malformed key, decrypt with bad key, and roundtrip.Paperclip-BIT-33940
auto-approve: CI success on
969dbe08ce(gitea_auto_approve_open_prs_once.py)auto-approve: CI success on
969dbe08ce(gitea_auto_approve_open_prs_once.py)auto-approve: CI success on
969dbe08ce(gitea_auto_approve_open_prs_once.py)