Exception in OpenSSL on E2E negotiation
prosody trunk today threw this at me when negotiating an E2E session:
Traceback (most recent call last): File "/usr/share/gajim/src/dialogs.py", line 1680, in on_response_yes self.user_response_yes(self.is_checked()) File "/usr/share/gajim/src/session.py", line 457, in accept_nondefault_options self.accept_e2e_alice(form, negotiated) File "/usr/share/gajim/src/common/stanza_session.py", line 956, in accept_e2e_alice rshashes.append(crypto.random_bytes(rshash_size)) File "/usr/share/gajim/src/common/crypto.py", line 122, in random_bytes OpenSSL.rand.add(os.urandom(bytes_), bytes_) File "/usr/lib/python2.7/dist-packages/OpenSSL/rand.py", line 64, in add raise TypeError("entropy must be an integer") TypeError: entropy must be an integer
This results from hashlib.sha256().digest_size returning a long instead of an integer on my platform, for whatever reasonthat arises now.
I imagine that none of the hash algs in use, the least sha256, will have a digest size justifying the use of a long, so casting to int looks safe here.
Platform used: Python 2.7.8 on Debian jessie/sid amd64