-
Notifications
You must be signed in to change notification settings - Fork 138
Update stackage to 0.19 to avoid people falling prey of getRandomBytes lack of randomness? #96
Comments
I think we can envision making point releases for security reasons for lts'es, unfortunately I dont have a way to make any until next monday. Otherwise I dont think there s much changes to move to 0.19, so if someone from stackage can upgrade lts that could go faster (pinging @snoyberg) |
Otherwise pinging @centromere @tekul, anyone of you interested by making a ..1 ? |
markdown ate the comment .lts-ver.1 |
OK, I'm on it. |
I've opened commercialhaskell/lts-haskell#24 |
I made a 0.15.1 release, backporting rdrand and other security-related fixes. There is a problem in that my machine doesn't have the issue which means I can't check it. Could someone (e.g. @jsdw) please check that 0.15.1 does indeed resolve the issue? As such I have a few observations/recommendations wrt the commit log and so on, as IMO the git commit log should be a super-useful resource for cutting releases like this. Ours is a bit lacking, so this was harder and more error prone than it could have been, since I couldn't test the fix:
Tim Pope's blog article on git logs and commit messages is worth a read. |
@tekul Do you know what the precise cause of the problem was? |
Looks like the encoded instruction rdrand has become invalid maybe after the i386 fix |
@centromere No, I just know it was related to the rdrand changes. Any chance you can confirm whether you see a problem with 0.15 which is fixed with 0.15.1? |
@tekul I am unable to reproduce the issue with 0.15.
|
It's been upgraded in LTS6 https://www.stackage.org/lts-6.14/package/cryptonite-0.19 |
Thanks @bergmark @centromere it depends if you're using rdrand in the first place, and if you do, I think the operating system seems to be playing a part here. I'll check if I can reproduce on 0.15 and 0.15.1 later |
I'm back from Zurihac finally, so I'll try and reproduce on some other machines. |
I installed like so and was still unable to reproduce:
|
@vincenthz Is there some way to check whether the "real" rdrand instructions are being invoked by a process? I guess you can tell whether cryptonite is skipping rdrand altogether by using |
@tekul It'ld would be useful to have a debug module in cryptonite to tell the configuration, version, and some system stuff (architecture, feature supported, etc); that would provide access to all this. |
@vincenthz Maybe we should also add a startup self-test to the entropy source which would error out and dump this debug information if some data pulled out didn't match basic random tests? That would prevent odd errors like this occurring on different platforms. |
It's a bit hard to do and not very reliable to do "random" tests though. I had some functions to calculate the probability of every possible choice and check if there's any skew. that would probably help in this case. |
I think we can close this for now. I've created #100 to improve our tests |
The latest version of cryptonite available on stackage is 0.15 (as of LTS 6.12). However, I spotted a bug which seems to be resolved in 0.19 whereby getRandomBytes is not random (which seems quite serious to me, but please correct me if I'm holding it wrong!). As an example, in ghci I do:
and the response I get back is always something like:
"\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225\235J\219 \192C\179\225C\ENQ\137\187"
This no longer seems to be an issue in 0.19, but as 0.15 is in the latest LTS I'm worried by how many users might be falling prey of this presently. The next best thing might be to put a warning in the readme telling people to manually add cryptonite-0.19 to their stack.yamls extra-deps field or somesuch.
The text was updated successfully, but these errors were encountered: