o
    >e                  
   @   s   d dl mZmZmZmZ d dlZddlmZ ddlm	Z	 ddl
mZ d dlZddgZe Zejd	kr8ed
 ejdkrCed ned ed zedZeee W n eys Z ze	eddkrned dZ[ww dd ZdS )    )unicode_literalsdivisionabsolute_importprint_functionN   )register_ffi)str_cls)LibraryNotFoundError	get_errorsecur32)r   	   Tl        ztypedef uint64_t ULONG_PTR;z typedef unsigned long ULONG_PTR;ar  
    typedef HANDLE HCERTSTORE;
    typedef unsigned int ALG_ID;
    typedef WCHAR SEC_WCHAR;
    typedef unsigned long SECURITY_STATUS;
    typedef void *LUID;
    typedef void *SEC_GET_KEY_FN;

    typedef struct _SecHandle {
        ULONG_PTR dwLower;
        ULONG_PTR dwUpper;
    } SecHandle;
    typedef SecHandle CredHandle;
    typedef SecHandle CtxtHandle;

    typedef struct _SCHANNEL_CRED {
        DWORD dwVersion;
        DWORD cCreds;
        void *paCred;
        HCERTSTORE hRootStore;
        DWORD cMappers;
        void **aphMappers;
        DWORD cSupportedAlgs;
        ALG_ID *palgSupportedAlgs;
        DWORD grbitEnabledProtocols;
        DWORD dwMinimumCipherStrength;
        DWORD dwMaximumCipherStrength;
        DWORD dwSessionLifespan;
        DWORD dwFlags;
        DWORD dwCredFormat;
    } SCHANNEL_CRED;

    typedef struct _TimeStamp {
        DWORD dwLowDateTime;
        DWORD dwHighDateTime;
    } TimeStamp;

    typedef struct _SecBuffer {
        ULONG cbBuffer;
        ULONG BufferType;
        BYTE *pvBuffer;
    } SecBuffer;

    typedef struct _SecBufferDesc {
        ULONG ulVersion;
        ULONG cBuffers;
        SecBuffer *pBuffers;
    } SecBufferDesc;

    typedef struct _SecPkgContext_StreamSizes {
        ULONG cbHeader;
        ULONG cbTrailer;
        ULONG cbMaximumMessage;
        ULONG cBuffers;
        ULONG cbBlockSize;
    } SecPkgContext_StreamSizes;

    typedef struct _CERT_CONTEXT {
        DWORD dwCertEncodingType;
        BYTE *pbCertEncoded;
        DWORD cbCertEncoded;
        void *pCertInfo;
        HCERTSTORE hCertStore;
    } CERT_CONTEXT;

    typedef struct _SecPkgContext_ConnectionInfo {
        DWORD dwProtocol;
        ALG_ID aiCipher;
        DWORD dwCipherStrength;
        ALG_ID aiHash;
        DWORD dwHashStrength;
        ALG_ID aiExch;
        DWORD dwExchStrength;
    } SecPkgContext_ConnectionInfo;

    SECURITY_STATUS AcquireCredentialsHandleW(SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialUse,
                    LUID *pvLogonID, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument,
                    CredHandle *phCredential, TimeStamp *ptsExpiry);
    SECURITY_STATUS FreeCredentialsHandle(CredHandle *phCredential);
    SECURITY_STATUS InitializeSecurityContextW(CredHandle *phCredential, CtxtHandle *phContext,
                    SEC_WCHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep,
                    SecBufferDesc *pInput, ULONG Reserved2, CtxtHandle *phNewContext, SecBufferDesc *pOutput,
                    ULONG *pfContextAttr, TimeStamp *ptsExpiry);
    SECURITY_STATUS FreeContextBuffer(void *pvContextBuffer);
    SECURITY_STATUS ApplyControlToken(CtxtHandle *phContext, SecBufferDesc *pInput);
    SECURITY_STATUS DeleteSecurityContext(CtxtHandle *phContext);
    SECURITY_STATUS QueryContextAttributesW(CtxtHandle *phContext, ULONG ulAttribute, void *pBuffer);
    SECURITY_STATUS EncryptMessage(CtxtHandle *phContext, ULONG fQOP, SecBufferDesc *pMessage, ULONG MessageSeqNo);
    SECURITY_STATUS DecryptMessage(CtxtHandle *phContext, SecBufferDesc *pMessage, ULONG MessageSeqNo, ULONG *pfQOP);
zsecur32.dllzcannot load libraryzsecur32.dll could not be foundc                   C   s   t  S )N)ffigetwinerror r   r   \/var/www/html/humari/django-venv/lib/python3.10/site-packages/oscrypto/_win/_secur32_cffi.pyr
      s   )
__future__r   r   r   r   sys_ffir   _typesr   errorsr	   cffi__all__FFIr   __version_info__set_unicodemaxsizecdefdlopenr   OSErrorefindr
   r   r   r   r   <module>   s4   




\
