globaleaks / whistleblowing-software

GlobaLeaks is free, open-source whistleblowing software enabling anyone to easily set up and maintain a secure reporting platform.
https://www.globaleaks.org
Other
1.23k stars 269 forks source link

TypeError Inappropriate argument type in in _bytes_to_bio data_char_p = self._ffi.new("char[]", data) #2394

Open fpietrosanti opened 6 years ago

fpietrosanti commented 6 years ago

Platform:
Host:
Version: 3.1.9

TypeError Inappropriate argument type.

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks result = result.throwExceptionIntoGenerator(g)

File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator return g.throw(self.type, self.value, self.tb)

File "/usr/lib/python2.7/dist-packages/globaleaks/handlers/admin/https.py", line 548, in put yield acme_cert_issuance(self.request.tid)

File "/usr/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 246, in inContext result = inContext.theWork()

File "/usr/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 262, in inContext.theWork = lambda: context.call(ctx, func, *args, **kw)

File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, **kw)

File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext return func(*args,**kw)

File "/usr/lib/python2.7/dist-packages/globaleaks/orm.py", line 110, in _wrap result = function(session, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/globaleaks/handlers/admin/https.py", line 528, in acme_cert_issuance return db_acme_cert_issuance(session, tid)

File "/usr/lib/python2.7/dist-packages/globaleaks/handlers/admin/https.py", line 505, in db_acme_cert_issuance backend=default_backend())

File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/primitives/serialization.py", line 20, in load_pem_private_key return backend.load_pem_private_key(data, password)

File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/multibackend.py", line 282, in load_pem_private_key return b.load_pem_private_key(data, password)

File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 1606, in load_pem_private_key password,

File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 1784, in _load_key mem_bio = self._bytes_to_bio(data)

File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 1058, in _bytes_to_bio data_char_p = self._ffi.new("char[]", data)

TypeError: initializer for ctype 'char[]' must be a str or list or tuple, not unicode

evilaliv3 commented 6 years ago

This issue is probably fixed in latest 3.3.4 that received importt bugfixing in relation to HTTPS and py2/p3 issues.

Lets postpone the analysis for a while till reproducibility in the latest codebased.