python3Packages.pyaes: raise on default IV#491877
Conversation
|
Hm, there are some consumers who explicitly provide an IV, so maybe the best thing we can do is provide a patch that raises instead of using a default IV. But using a default IV can also be safe if you don't reuse it. |
That's a joke is not it? To hardcode cryptographic values that should be random (or not-reused) was never a good idea. Even if nix would provide a different "default IV" that obviously will be reused by different consumers. The proper solution indeed is:
Just make technicaly sure, consumers can never actually reuse it. |
|
Sorry, I meant if the consumer always passes a random IV they are fine, and we don't need to mark the package vulnerable and break them from being cached. These are nixpkgs semantics. Of course raising is the correct way, I just hadn't gotten back to this yet. Writing that comment was the moment I took a course correction. |
6060a78 to
44688fc
Compare
|
Okay, also what about at least trying to contribute that patch upstream? |
44688fc to
0d2131b
Compare
The pyaes library when no IV passed constructs an all zero default IV, which is not safe in the implemented AES modes.
0d2131b to
5ba1e25
Compare
|
|
|
Successfully created backport PR for |
ricmoo/pyaes#56
https://blog.trailofbits.com/2026/02/18/carelessness-versus-craftsmanship-in-cryptography/
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.