0x1949 Team - FAZEMRX - MANAGER
Edit File: _common.cpython-310.pyc
o ֞\. � @ s� d Z ddlmZmZmZ ddlZddlZddlZddlm Z m Z ddlmZm Z mZmZmZmZ zddlZW n eyA dZY nw ejdd�G d d � d e��Zdd� Zd d� Zdd� Zdd� Zejddd�G dd� de��Zejdd�G dd� de��Zejddd�G dd� de��Zejddd�G dd� de��Zejddd�G dd� de��Zejdd�G dd � d e��Z ejddd�G d!d"� d"e��Z!ejddd�G d#d$� d$e��Z"d%d&� Z#d'd(� Z$e d)d*�Z%dS )+z Common verification code. � )�absolute_import�division�print_functionN� )� maketrans� text_type)�CertificateError�DNSMismatch�IPAddressMismatch�SRVMismatch�URIMismatch�VerificationErrorT)�slotsc @ s e Zd ZdZe�� Ze�� ZdS )�ServiceMatchz< A match of a service id and a certificate pattern. N)�__name__� __module__�__qualname__�__doc__�attr�ib� service_id�cert_pattern� r r �:/usr/lib/python3/dist-packages/service_identity/_common.pyr s r c C s� g }t | |�t | |� }dd� |D �}|D ]}||vr$|�|j|d�� q|D ]}||vr<t| |j�r<|�|j|d�� q'|rDt|d��|S )z� Verify whether *cert_patterns* are valid for *obligatory_ids* and *optional_ids*. *obligatory_ids* must be both present and match. *optional_ids* must match if a pattern of the respective type is present. c S s g | ]}|j �qS r )r )�.0�matchr r r � <listcomp>4 s z+verify_service_identity.<locals>.<listcomp>)� mismatched_id)�errors)� _find_matches�append�error_on_mismatch�_contains_instance_of� pattern_classr )� cert_patterns�obligatory_ids�optional_idsr �matches�matched_ids�ir r r �verify_service_identity'