arlolra / otr

Off-the-Record Messaging Protocol implemented in JavaScript
https://arlolra.github.io/otr/
Mozilla Public License 2.0
458 stars 61 forks source link

Error in Bigint in Firefox #46

Closed SET001 closed 10 years ago

SET001 commented 10 years ago

Can't get this work on Firefox (20.0). If only I include biging.js like this

<script src="js/salsa20.js"></script>
<script src="js/crypto.js"></script>
<script src="js/bigint.js"></script>

it says throw new Error('Keys should not be generated without CSPRNG.') Further usage is impossible because if only I try to call DSA constructor I'll get BigInt is undefined and DSA is not a constructor

SET001 commented 10 years ago

here is a plunk for this http://plnkr.co/edit/nwLDjPkw1ZRsNAl7NpKt?p=preview

nadimkobeissi commented 10 years ago

Have you tested your code in Chrome?

SET001 commented 10 years ago

@kaepora, Yes it work fine in Chrome.

SET001 commented 10 years ago

The problem is in BigInt library but it seem's like Arlolra's version is different from what's on Leemon Baird`s site so I'm not sure to whom should I refer with this issue.

arlolra commented 10 years ago

Ah, so that error is warning you that your browser doesn't have a CSPNRG. There's some discussion is #10 about this but the gist of it is that OTR is refusing to generate weak keys by design.

Firefox introduced window.crypto.getRandomValues in 21. Any reason you haven't upgraded?

nadimkobeissi commented 10 years ago

As an aside, one really annoying thing is that the Tor Browser Bundle is still stuck on Firefox 17 :disappointed:

arlolra commented 10 years ago

@kaepora The TBB 3.5rc1 has version 24 with window.crypto.getRandomValues(), https://blog.torproject.org/blog/tor-browser-bundle-35rc1-released

nadimkobeissi commented 10 years ago

That's awesome!!

SET001 commented 10 years ago

Updated Firefox to 26.0 and problem disappeared for me.

arlolra commented 10 years ago

Glad to hear it.