s is not a string, but .find() is applied to it several times
amsimms opened this issue · 2 comments
amsimms commented
tlslite/tlslite/utils/openssl_rsakey.py
Line 102 in cd82fad
s is not a string, in order to be searched with find() it needs to be converted, e.g.:
ss = str(s,'utf-8')
and then various searches become ss.find, ss.startswith, etc.
Line 106 is potentially problematic even with this fix:
s = s[start:]
since start is effectively a character count.
tomato42 commented
it's the responsibility of the caller to provide str
to the method, see tls.py L134-140
amsimms commented
Unfortunately other code paths that end up calling this function insist on s being a byte oriented structure. But as you say, tlslite-ng works great and resolves this issue completely. Thanks for the response.