§
    ¢”j&  ã                   óÈ   — d dl mZmZmZmZ d dlZd dlZd dlZd dlZddl	m
Z
mZ ddlmZ ddlmZmZ g d¢Z ej        ¦   «         ZddddœZd	„ Zd
„ Zdd„Zd„ Zd„ Zd„ Zd„ ZdS )é    )Úunicode_literalsÚdivisionÚabsolute_importÚprint_functionNé   )Ústr_clsÚ	type_name)ÚLibraryNotFoundError)Ú__version__Ú__version_info__)r   r   ÚbackendÚffiÚ
load_orderÚ
use_ctypesÚuse_opensslÚuse_winlegacy)r   Úbackend_configr   c                  ó®  — t           d         �t           d         S t          5  t           d         �t           d         cddd¦  «         S t          j        dk    r3t          j        ¦   «         d         dk     rdt           d<   n0dt           d<   n%t          j        dk    rd	t           d<   n
d
t           d<   t           d         cddd¦  «         S # 1 swxY w Y   dS )zs
    :return:
        A unicode string of the backend being used: "openssl", "mac", "win",
        "winlegacy"
    r   NÚwin32r   é   Ú	winlegacyÚwinÚdarwinÚmacÚopenssl)Ú_module_valuesÚ_backend_lockÚsysÚplatformÚgetwindowsversion© ó    ú`/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/oscrypto/__init__.pyr   r   "   s-  € õ �iÔ Ð,Ý˜iÔ(Ð(å	ð )ð )Ý˜)Ô$Ð0Ý! )Ô,ð)ð )ð )ð )ñ )ô )ð )ð )õ Œ<˜7Ò"Ð"åÔ$Ñ&Ô& qÔ)¨AÒ-Ð-Ø,7•˜yÑ)Ð)à,1•˜yÑ)Ð)ÝŒ\˜XÒ%Ð%Ø(-�N˜9Ñ%Ð%à(1�N˜9Ñ%å˜iÔ(ð)ð )ð )ð )ñ )ô )ð )ð )ð )ð )ð )ð )øøøð )ð )ð )ð )ð )ð )s   ¢C
Á	A4C
Ã
CÃCc                  ó  — t          ¦   «         dk    ri S t          d         �t          d         S t          5  t          d         �t          d         cddd¦  «         S i t          d<   t          d         cddd¦  «         S # 1 swxY w Y   dS )zÔ
    :return:
        A dict of config info for the backend. Only currently used by "openssl",
        it may contains zero or more of the following keys:
         - "libcrypto_path"
         - "libssl_path"
    r   r   N)r   r   r   r!   r"   r#   Ú_backend_configr%   >   sí   € õ �y„y�IÒÐØˆ	åÐ&Ô'Ð3ÝÐ.Ô/Ð/å	ð 0ð 0ÝÐ*Ô+Ð7Ý!Ð"2Ô3ð0ð 0ð 0ð 0ñ 0ô 0ð 0ð 0ð ,.�Ð'Ñ(ÝÐ.Ô/ð0ð 0ð 0ð 0ñ 0ô 0ð 0ð 0ð 0ð 0ð 0ð 0øøøð 0ð 0ð 0ð 0ð 0ð 0s   ¶B ÁB Â BÂBc                 ót  — t          | t          ¦  «        st          dt          | ¦  «        z  ¦  «        ‚t          |t          ¦  «        st          dt          |¦  «        z  ¦  «        ‚t          j                             | ¦  «        st          d| z  ¦  «        ‚t          j                             |¦  «        st          d|z  ¦  «        ‚|�et          |t          ¦  «        st          dt          |¦  «        z  ¦  «        ‚t          j                             |¦  «        st          d|z  ¦  «        ‚t          5  | ||dœ}t          d	         d
k    rt          d         |k    r	 ddd¦  «         dS t          d	         �t          d¦  «        ‚d
t          d	<   |t          d<   ddd¦  «         dS # 1 swxY w Y   dS )aÖ  
    Forces using OpenSSL dynamic libraries on OS X (.dylib) or Windows (.dll),
    or using a specific dynamic library on Linux/BSD (.so).

    This can also be used to configure oscrypto to use LibreSSL dynamic
    libraries.

    This method must be called before any oscrypto submodules are imported.

    :param libcrypto_path:
        A unicode string of the file path to the OpenSSL/LibreSSL libcrypto
        dynamic library.

    :param libssl_path:
        A unicode string of the file path to the OpenSSL/LibreSSL libssl
        dynamic library.

    :param trust_list_path:
        An optional unicode string of the path to a file containing
        OpenSSL-compatible CA certificates in PEM format. If this is not
        provided and the platform is OS X or Windows, the system trust roots
        will be exported from the OS and used for all TLS connections.

    :raises:
        ValueError - when one of the paths is not a unicode string
        OSError - when the trust_list_path does not exist on the filesystem
        oscrypto.errors.LibraryNotFoundError - when one of the path does not exist on the filesystem
        RuntimeError - when this function is called after another part of oscrypto has been imported
    z/libcrypto_path must be a unicode string, not %sz,libssl_path must be a unicode string, not %szlibcrypto does not exist at %szlibssl does not exist at %sNz0trust_list_path must be a unicode string, not %sz$trust_list_path does not exist at %s)Úlibcrypto_pathÚlibssl_pathÚtrust_list_pathr   r   r   zRAnother part of oscrypto has already been imported, unable to force use of OpenSSL)Ú
isinstancer   Ú
ValueErrorr	   ÚosÚpathÚexistsr
   ÚOSErrorr   r   ÚRuntimeError)r'   r(   r)   Ú
new_configs       r#   r   r   U   s  € õ> �n¥gÑ.Ô.ð hÝÐJÍYÐWeÑMfÔMfÑfÑgÔgÐgå�k¥7Ñ+Ô+ð bÝÐGÍ)ÐT_ÑJ`ÔJ`Ñ`ÑaÔaÐaåŒ7�>Š>˜.Ñ)Ô)ð VÝ"Ð#CÀnÑ#TÑUÔUÐUåŒ7�>Š>˜+Ñ&Ô&ð PÝ"Ð#@À;Ñ#NÑOÔOÐOàÐ"Ý˜/­7Ñ3Ô3ð 	nÝÐOÕR[Ð\kÑRlÔRlÑlÑmÔmÐmÝŒw�~Š~˜oÑ.Ô.ð 	TÝÐ@À?ÑRÑSÔSÐSå	ð 6ð 6à,Ø&Ø.ð
ð 
ˆ
õ ˜)Ô$¨	Ò1Ð1µnÐEUÔ6VÐZdÒ6dÐ6dØð6ð 6ð 6ñ 6ô 6ð 6ð 6ð 6õ ˜)Ô$Ð0ÝÐsÑtÔtÐtà$-��yÑ!Ø+5�Ð'Ñ(ð6ð 6ð 6ñ 6ô 6ð 6ð 6ð 6ð 6ð 6ð 6ð 6øøøð 6ð 6ð 6ð 6ð 6ð 6s   Ä9*F-Å00F-Æ-F1Æ4F1c                  ób  — t           j        dk    r9t          j        ¦   «         pt           j        } | dk    rd} t          d| z  ¦  «        ‚t          5  t
          d         dk    r	 ddd¦  «         dS t
          d         �t          d¦  «        ‚dt
          d<   ddd¦  «         dS # 1 swxY w Y   dS )	as  
    Forces use of the legacy Windows CryptoAPI. This should only be used on
    Windows XP or for testing. It is less full-featured than the Cryptography
    Next Generation (CNG) API, and as a result the elliptic curve and PSS
    padding features are implemented in pure Python. This isn't ideal, but it
    a shim for end-user client code. No one is going to run a server on Windows
    XP anyway, right?!

    :raises:
        EnvironmentError - when this function is called on an operating system other than Windows
        RuntimeError - when this function is called after another part of oscrypto has been imported
    r   ÚDarwinzOS Xz9The winlegacy backend can only be used on Windows, not %sr   r   NzcAnother part of oscrypto has already been imported, unable to force use of Windows legacy CryptoAPI)r   r   ÚsystemÚEnvironmentErrorr   r   r0   )Úplats    r#   r   r   —   s  € õ „|�wÒÐÝŒÑ Ô Ð0¥C¤LˆØ�8ÒÐØˆDÝÐZÐ]aÑaÑbÔbÐbå	ð 	0ð 	0Ý˜)Ô$¨Ò3Ð3Øð	0ð 	0ð 	0ñ 	0ô 	0ð 	0ð 	0ð 	0õ ˜)Ô$Ð0ÝØuñô ð ð %0��yÑ!ð	0ð 	0ð 	0ñ 	0ô 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0øøøð 	0ð 	0ð 	0ð 	0ð 	0ð 	0s   ÁB$Á1&B$Â$B(Â+B(c                  óÐ   — t           5  t          d         dk    r	 ddd¦  «         dS t          d         �t          d¦  «        ‚dt          d<   ddd¦  «         dS # 1 swxY w Y   dS )z³
    Forces use of ctypes instead of cffi for the FFI layer

    :raises:
        RuntimeError - when this function is called after another part of oscrypto has been imported
    r   ÚctypesNr   zQAnother part of oscrypto has already been imported, unable to force use of ctypes)r   r   r0   r!   r"   r#   r   r   ·   s×   € õ 
ð 	)ð 	)Ý˜%Ô  HÒ,Ð,Øð	)ð 	)ð 	)ñ 	)ô 	)ð 	)ð 	)ð 	)õ ˜)Ô$Ð0ÝØcñô ð ð !)��uÑð	)ð 	)ð 	)ñ 	)ô 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)øøøð 	)ð 	)ð 	)ð 	)ð 	)ð 	)s   ˆA¨&AÁAÁ"Ac                  óæ   — t           d         �t           d         S t          5  	 ddl} dt           d<   n# t          $ r dt           d<   Y nw xY wt           d         cddd¦  «         S # 1 swxY w Y   dS )zh
    Returns the FFI module being used

    :return:
        A unicode string of "cffi" or "ctypes"
    r   Nr   Úcffir8   )r   r   r:   ÚImportError)r:   s    r#   r   r   Ë   sÔ   € õ �eÔÐ(Ý˜eÔ$Ð$å	ð %ð %ð	-ØˆKˆKˆKØ$*�N˜5Ñ!Ð!øÝð 	-ð 	-ð 	-Ø$,�N˜5Ñ!Ð!Ð!ð	-øøøõ ˜eÔ$ð%ð %ð %ð %ñ %ô %ð %ð %ð %ð %ð %ð %øøøð %ð %ð %ð %ð %ð %s1   ¢A&¤3²A&³A
ÁA&Á	A
Á
A&Á&A*Á-A*c                  ó
   — g d¢S )a)  
    Returns a list of the module and sub-module names for oscrypto in
    dependency load order, for the sake of live reloading code

    :return:
        A list of unicode strings of module names, as they would appear in
        sys.modules, ordered by which module should be reloaded first
    )Ezoscrypto._asn1zoscrypto._cipher_suiteszoscrypto._errorszoscrypto._intzoscrypto._typeszoscrypto.errorszoscrypto.versionÚoscryptozoscrypto._ffizoscrypto._pkcs12zoscrypto._pkcs5zoscrypto._randzoscrypto._tlszoscrypto._linux_bsd.trust_listz!oscrypto._mac._common_crypto_cffiz#oscrypto._mac._common_crypto_ctypeszoscrypto._mac._common_cryptoz#oscrypto._mac._core_foundation_cffiz%oscrypto._mac._core_foundation_ctypeszoscrypto._mac._core_foundationzoscrypto._mac._security_cffizoscrypto._mac._security_ctypeszoscrypto._mac._securityzoscrypto._mac.trust_listzoscrypto._mac.utilz!oscrypto._openssl._libcrypto_cffiz#oscrypto._openssl._libcrypto_ctypeszoscrypto._openssl._libcryptozoscrypto._openssl._libssl_cffiz oscrypto._openssl._libssl_ctypeszoscrypto._openssl._libsslzoscrypto._openssl.utilzoscrypto._win._cng_cffizoscrypto._win._cng_ctypeszoscrypto._win._cngzoscrypto._win._decodezoscrypto._win._advapi32_cffizoscrypto._win._advapi32_ctypeszoscrypto._win._advapi32zoscrypto._win._kernel32_cffizoscrypto._win._kernel32_ctypeszoscrypto._win._kernel32zoscrypto._win._secur32_cffizoscrypto._win._secur32_ctypeszoscrypto._win._secur32zoscrypto._win._crypt32_cffizoscrypto._win._crypt32_ctypeszoscrypto._win._crypt32zoscrypto._win.trust_listzoscrypto._win.utilzoscrypto.trust_listzoscrypto.utilzoscrypto.kdfzoscrypto._mac.symmetriczoscrypto._openssl.symmetriczoscrypto._win.symmetriczoscrypto.symmetriczoscrypto._asymmetriczoscrypto._ecdsazoscrypto._pkcs1zoscrypto._mac.asymmetriczoscrypto._openssl.asymmetriczoscrypto._win.asymmetriczoscrypto.asymmetriczoscrypto.keyszoscrypto._mac.tlszoscrypto._openssl.tlszoscrypto._win.tlszoscrypto.tlsr!   r!   r"   r#   r   r   à   s   € ðFð Fð Fð Fr"   )N)Ú
__future__r   r   r   r   r,   r   r   Ú	threadingÚ_typesr   r	   Úerrorsr
   Úversionr   r   Ú__all__ÚLockr   r   r   r%   r   r   r   r   r   r!   r"   r#   ú<module>rE      sH  ðà RÐ RÐ RÐ RÐ RÐ RÐ RÐ RÐ RÐ RÐ RÐ Rà 	€	€	€	Ø €€€Ø 
€
€
€
Ø Ð Ð Ð à &Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ø (Ð (Ð (Ð (Ð (Ð (Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2ð	ð 	ð 	€ð �	”Ñ Ô €àØØðð €ð)ð )ð )ð80ð 0ð 0ð.?6ð ?6ð ?6ð ?6ðD0ð 0ð 0ð@)ð )ð )ð(%ð %ð %ð*Pð Pð Pð Pð Pr"   