You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At least in PKSign, but probably in other places. The problem is present in both botan2 and botan3. It used to work, i was using it in a project of mine.
When we want to compute the pksign, calling PKSign.update() forces _ctype_str() on the message: _DLL.botan_pk_op_sign_update(self.__obj, _ctype_str(msg), len(msg))
And _ctype_str has an assert isinstance(s, str)
If i add this in _ctype_str: if isinstance(s, bytes): return s
Then my code works again. It seems legit, as it's a communication protocol, where one end use botan/python, and the other one uses botan/c(++). The C part has no problem handling non-string binaries.
Another potential problem is that len(msg) doesn't necessarily corespond to len( _ctype_str(msg)).
The text was updated successfully, but these errors were encountered:
At least in PKSign, but probably in other places. The problem is present in both botan2 and botan3. It used to work, i was using it in a project of mine.
When we want to compute the pksign, calling PKSign.update() forces _ctype_str() on the message:
_DLL.botan_pk_op_sign_update(self.__obj, _ctype_str(msg), len(msg))
And
_ctype_str
has anassert isinstance(s, str)
If i add this in
_ctype_str
:if isinstance(s, bytes): return s
Then my code works again. It seems legit, as it's a communication protocol, where one end use botan/python, and the other one uses botan/c(++). The C part has no problem handling non-string binaries.
Another potential problem is that len(msg) doesn't necessarily corespond to len( _ctype_str(msg)).
The text was updated successfully, but these errors were encountered: