📂 Advanced File Manager
Multi-Root Navigation System
⚡ Quick Jump
Server (/)
Home (/home)
Var_www (/var/www)
Current (/home4/shelley/public_html/wp-content/mu-plugins)
📍 Go
⬆ Ke Atas
🏠 Root Server
🏠 Root App
🔄 Refresh
📀 /
›
usr
›
libexec
›
oracle-cloud-agent
›
plugins
›
osms
›
oci
›
_vendor
›
📁 httpsig_cffi
📍
Lokasi:
/usr/libexec/oracle-cloud-agent/plugins/osms/oci/_vendor/httpsig_cffi
💾
Free:
45.9 GB
⚠️ Direktori ini
tidak writable
.
✏️ Mengedit: verify.pyc
a M��f� � @ s� d Z ddlmZ ddlmZ ddlmZmZmZ ddl m Z mZ ddlm Z ddlmZ dd lmZ dd lT G dd� de�ZG d d� de�ZdS )z0 Module to assist in verifying a signed header. � )�six)�default_backend)�hashes�hmac� serialization)�rsa�padding)�InvalidSignature)� b64decode� )�Signer)�*c @ s e Zd ZdZdd� ZdS )�Verifierz� Verifies signed text against a secret. For HMAC, the secret is the shared secret. For RSA, the secret is the PUBLIC key. c C s� t |tj�r|�d�}t |tj�r,|�d�}| jdkrrz$| j�t|�|t� � | � � � W dS tyn Y dS 0 n,| jdkr�| �|�}t|�}||kS t d��dS )z� Verifies the data matches a signed version with the given signature. `data` is the message to verify `signature` is a base64-encoded signature to verify against `data` �asciir TFr zUnsupported algorithm.N)� isinstancer �string_types�encode�sign_algorithm�_rsa_public�verifyr r �PKCS1v15�_rsahashr � _sign_hmac�HttpSigException)�self�data� signature�h�s� r ��/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/oci/_vendor/httpsig_cffi/verify.py�_verify s( � zVerifier._verifyN)�__name__� __module__�__qualname__�__doc__r! r r r r r s r c s* e Zd ZdZd� fdd� Zdd� Z� ZS )�HeaderVerifierz8 Verifies an HTTP signature from given headers. Nc s� |pdg}t |d �}t|�dkr.|d | _ntd��t|�| _dd� |D �| _|| _|| _|| _ t t| �j|| jd d � d S )a( Instantiate a HeaderVerifier object. :param headers: A dictionary of headers from the HTTP request. :param secret: The HMAC secret or RSA *public* key. :param required_headers: Optional. A list of headers required to be present to validate, even if the signature is otherwise valid. Defaults to ['date']. :param method: Optional. The HTTP method used in the request (eg. "GET"). Required for the '(request-target)' header. :param path: Optional. The HTTP path requested, exactly as sent (including query arguments and fragments). Required for the '(request-target)' header. :param host: Optional. The value to use for the Host header, if not supplied in :param:headers. �date� authorization� r zInvalid authorization header.c S s g | ]}|� � �qS r )�lower)�.0r r r r � <listcomp>T � z+HeaderVerifier.__init__.<locals>.<listcomp>� algorithm)r. N) �parse_authorization_header�len� auth_dictr �CaseInsensitiveDict�headers�required_headers�method�path�host�superr&