File: //var/opt/nydus/ops/oscrypto/_win/__pycache__/_secur32.cpython-39.pyc
a
�,�h� � @ s� d dl mZmZmZmZ ddlmZ ddlmZ ddl m
Z
ddlmZ e� dkrddd l
mZmZ ndd lmZmZ g d
�Zddd
�ZG dd� d�ZdS )� )�unicode_literals�division�absolute_import�print_function� )�ffi� )�_try_decode)�TLSError)�str_clsZcffi)�secur32� get_error)�handle_errorr �Secur32ConstNc C s~ | dkrdS | t jkrtd��| t jkr0td��| t jkrBtd��t� \}}t|t�s^t|�}|du rjt }|d| | ��dS )a5
Extracts the last Windows error message into a python unicode string
:param result:
A function result, 0 or None indicates failure
:param exception_class:
The exception class to use for the exception if an error occurred
:return:
A unicode string error message
r Nz"A packet was received out of orderzA packet was received alteredzThe TLS session expiredzSECURITY_STATUS error 0x%0.2X: )
r �SEC_E_OUT_OF_SEQUENCEr
�SEC_E_MESSAGE_ALTERED�SEC_E_CONTEXT_EXPIREDr
�
isinstancer r �OSError)�resultZexception_class�_Zerror_string� r �G/opt/nydus/tmp/pip-target-wkfpz8uv/lib/python/oscrypto/_win/_secur32.pyr s
r c @ s, e Zd ZdZdZdZdZdZdZdZ dZ
dZd Zd
Z
dZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+d Z,dZ-d!Z.dZ/dZ0d"Z1d#Z2d$Z3d%Z4dZ5dZ6dZ7d&Z8d'Z9d(Z:d)Z;d*Z<d+Z=d,Z>d-Z?d.Z@d/ZAd0ZBd1ZCd2ZDd3ZEd4ZFd5ZGd6ZHd7ZId8ZJd9S ):r � r z,Microsoft Unified Security Protocol Provider� � i @ � r i i i! l l i1� l l l ] l " l % l ( l & l l ! i � i i � � � � � � r �Z �S i i if if if ih if if i� i� i� i
� i� i� i� i� i� i � i $ i"