We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe57001 commit aa64ba6Copy full SHA for aa64ba6
pkcs11/types.py
@@ -41,8 +41,13 @@ def __hash__(self):
41
42
43
def _CK_UTF8CHAR_to_str(data):
44
- """Convert CK_UTF8CHAR to string."""
45
- return data.rstrip(b"\0").decode("utf-8").rstrip()
+ """
+ Convert CK_UTF8CHAR to string.
46
+
47
+ Substitutes invalid bytes with the replacement character to make usage more
48
+ robust with non-compliant tokens.
49
50
+ return data.rstrip(b"\0").decode("utf-8", errors="replace").rstrip()
51
52
53
def _CK_VERSION_to_tuple(data):
0 commit comments