本文整理汇总了Python中cryptography.hazmat.bindings._openssl.ffi.string方法的典型用法代码示例。如果您正苦于以下问题:Python ffi.string方法的具体用法?Python ffi.string怎么用?Python ffi.string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cryptography.hazmat.bindings._openssl.ffi
的用法示例。
在下文中一共展示了ffi.string方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _openssl_assert
# 需要导入模块: from cryptography.hazmat.bindings._openssl import ffi [as 别名]
# 或者: from cryptography.hazmat.bindings._openssl.ffi import string [as 别名]
def _openssl_assert(lib, ok):
if not ok:
errors = _consume_errors(lib)
errors_with_text = []
for err in errors:
err_text_reason = ffi.string(
lib.ERR_error_string(err.code, ffi.NULL)
)
errors_with_text.append(
_OpenSSLErrorWithText(
err.code, err.lib, err.func, err.reason, err_text_reason
)
)
raise InternalError(
"Unknown OpenSSL error. This error is commonly encountered when "
"another library is not cleaning up the OpenSSL error stack. If "
"you are using cryptography with another library that uses "
"OpenSSL try disabling it before reporting a bug. Otherwise "
"please file an issue at https://github.com/pyca/cryptography/"
"issues with information on how to reproduce "
"this. ({0!r})".format(errors_with_text),
errors_with_text
)