U af@sddlmZmZmZmZddlmZddlmZddl m Z ddl m Z edkrddd l mZmZndd lmZmZd d d gZddd ZGdd d Zd S))unicode_literalsdivisionabsolute_importprint_function)ffi) _try_decode)TLSError)str_clsZcffi)secur32 get_error handle_errorr Secur32ConstNcCs~|dkr dS|tjkrtd|tjkr0td|tjkrBtdt\}}t|ts^t|}|dkrjt }|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 rNz"A packet was received out of orderzA packet was received alteredzThe TLS session expiredzSECURITY_STATUS error 0x%0.2X: ) rSEC_E_OUT_OF_SEQUENCEr SEC_E_MESSAGE_ALTEREDSEC_E_CONTEXT_EXPIREDr isinstancer r OSError)resultZexception_class_Z error_stringrG/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/oscrypto/_win/_secur32.pyrs     c@s,eZdZdZdZdZdZdZdZdZ dZ dZ d Z d Z d Zd Zd 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*Zd-Z?d.Z@d/ZAd0ZBd1ZCd2ZDd3ZEd4ZFd5ZGd6ZHd7ZId8ZJd9S):rrz,Microsoft Unified Security Protocol Provider i@ri i i! lli1lll]l"l%l(l&ll!i  iirZSiiifififihififiii i iiiiiii$i"i"N)K__name__ __module__ __qualname__ZSCHANNEL_CRED_VERSIONZSECPKG_CRED_OUTBOUNDZ UNISP_NAMEZSCH_CRED_MANUAL_CRED_VALIDATIONZSCH_CRED_AUTO_CRED_VALIDATIONZSCH_USE_STRONG_CRYPTOZSCH_CRED_NO_DEFAULT_CREDSZSECBUFFER_VERSIONZSEC_E_OKZSEC_I_CONTINUE_NEEDEDZSEC_I_CONTEXT_EXPIREDZSEC_I_RENEGOTIATEZSEC_E_INCOMPLETE_MESSAGEZSEC_E_INVALID_TOKENrrrZSEC_E_INVALID_PARAMETERZSEC_E_WRONG_PRINCIPALZSEC_E_UNTRUSTED_ROOTZSEC_E_CERT_EXPIREDZSEC_E_ILLEGAL_MESSAGEZSEC_E_INTERNAL_ERRORZSEC_E_BUFFER_TOO_SMALLZSEC_I_INCOMPLETE_CREDENTIALSZISC_REQ_REPLAY_DETECTZISC_REQ_SEQUENCE_DETECTZISC_REQ_CONFIDENTIALITYZISC_REQ_ALLOCATE_MEMORYZISC_REQ_INTEGRITYZISC_REQ_STREAMZISC_REQ_USE_SUPPLIED_CREDSZISC_RET_REPLAY_DETECTZISC_RET_SEQUENCE_DETECTZISC_RET_CONFIDENTIALITYZISC_RET_ALLOCATED_MEMORYZISC_RET_INTEGRITYZISC_RET_STREAMZSECBUFFER_ALERTZSECBUFFER_STREAM_HEADERZSECBUFFER_STREAM_TRAILERZSECBUFFER_EXTRAZSECBUFFER_TOKENZSECBUFFER_DATAZSECBUFFER_EMPTYZSECPKG_ATTR_STREAM_SIZESZSECPKG_ATTR_CONNECTION_INFOZSECPKG_ATTR_REMOTE_CERT_CONTEXTZSP_PROT_TLS1_2_CLIENTZSP_PROT_TLS1_1_CLIENTZSP_PROT_TLS1_CLIENTZSP_PROT_SSL3_CLIENTZSP_PROT_SSL2_CLIENTZ CALG_AES_256Z CALG_AES_128Z CALG_3DESZCALG_RC4ZCALG_RC2ZCALG_DESZCALG_MD5Z CALG_SHA1Z CALG_SHA256Z CALG_SHA384Z CALG_SHA512Z CALG_DH_SFZ CALG_DH_EPHEMZ CALG_ECDHZ CALG_ECDHEZ CALG_RSA_KEYXZ CALG_RSA_SIGNZ CALG_ECDSAZ CALG_DSS_SIGNrrrrr;s)N) __future__rrrrr_decoder errorsr _typesr Z _secur32_cffir r Z_secur32_ctypes__all__rrrrrrs      %