0x1949 Team - FAZEMRX - MANAGER
Edit File: test_sslverify.cpython-310.pyc
o ��f�� � @ s� d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl mZmZm Z mZ ddlmZ ddlmZmZmZ dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ ddlm Z ddl!m"Z" ddl#m$Z$m%Z%m&Z& dZ'dZ(dZ)dZ*ed�r�ddl+Z+ddl,m-Z- ddl.m/Z/m0Z0m1Z1m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9 ddl:m;Z; ddl<m=Z=m>Z>m?Z? ddl@mAZA ddl mBZB ze-�Ce-jD�ZEeE�Fdd� � W n eGeHfy� dZ)Y nw ze-�Ce-jD�ZEeE�Idd� � W n eGy� d Z*Y n w d!Z'e'Z(e'Z)e'Z*e'�sdd"l mJZK dd#lLmMZMmNZN dd$lOmPZP d%ZQd&ZReeS�jT�Ud'��V� ZWe�X� fd(d)�ZYd*d+� ZZdyd-d.�Z[d/d0� Z\dzd1d2�Z] d{d3d4�Z^d5d6� Z_G d7d8� d8e j`�ZaG d9d:� d:e j`�ZbG d;d<� d<�ZcG d=d>� d>e%�ZdG d?d@� d@�ZeG dAdB� dB�ZfG dCdD� dDefe&�ZgG dEdF� dFefe&�ZhG dGdH� dHe%�ZiG dIdJ� dJe&�ZjG dKdL� dLe%�ZkdzdMdN�ZlG dOdP� dPe&�ZmG dQdR� dRe&�ZnG dSdT� dTe&�ZoG dUdV� dV�ZpG dWdX� dX�ZqG dYdZ� dZ�ZrG d[d\� d\e&�ZsG d]d^� d^e&�ZtG d_d`� d`e&�ZuG dadb� dbe&�ZvG dcdd� dde&�ZwG dedf� dfe&�ZxG dgdh� dh�ZyG didj� dj�ZzG dkdl� dle&�Z{G dmdn� dn�Z|G dodp� dp�Z}G dqdr� dre%�Z~G dsdt� dte%�ZG dudv� dve&�Z�G dwdx� dxe%�Z�dS )|z+ Tests for L{twisted.internet._sslverify}. � N)�skipIf)�implementer)�Version)�defer� interfaces�protocol�reactor)� _idnaText)�CertificateError�ConnectionClosed�ConnectionLost)�nativeString)�FilePath)� getModule)� requireModule)�connectedServerAndClient)�SetAsideModule)�util)�SkipTest�SynchronousTestCase�TestCase� �OpenSSL)�SSL)�FILETYPE_PEM�TYPE_RSA�X509�PKey�get_elliptic_curves)�x509)�default_backend)�hashes)�rsa)�Encoding�NoEncryption� PrivateFormat)�NameOID)�sslc C � d S �N� ��cr* r* �=/usr/lib/python3/dist-packages/twisted/test/test_sslverify.py�<lambda>9 � r. zINPN is deprecated (and OpenSSL 1.0.1 or greater required for NPN support)c C r( r) r* r+ r* r* r- r. B r/ z2OpenSSL 1.0.2 or greater required for ALPN supportz"OpenSSL is required for SSL tests.)� _sslverify)�VerificationError� platformTrust)�TLSMemoryBIOFactorya� -----BEGIN CERTIFICATE----- MIIC2jCCAkMCAjA5MA0GCSqGSIb3DQEBBAUAMIG0MQswCQYDVQQGEwJVUzEiMCAG A1UEAxMZZXhhbXBsZS50d2lzdGVkbWF0cml4LmNvbTEPMA0GA1UEBxMGQm9zdG9u MRwwGgYDVQQKExNUd2lzdGVkIE1hdHJpeCBMYWJzMRYwFAYDVQQIEw1NYXNzYWNo dXNldHRzMScwJQYJKoZIhvcNAQkBFhhub2JvZHlAdHdpc3RlZG1hdHJpeC5jb20x ETAPBgNVBAsTCFNlY3VyaXR5MB4XDTA2MDgxNjAxMDEwOFoXDTA3MDgxNjAxMDEw OFowgbQxCzAJBgNVBAYTAlVTMSIwIAYDVQQDExlleGFtcGxlLnR3aXN0ZWRtYXRy aXguY29tMQ8wDQYDVQQHEwZCb3N0b24xHDAaBgNVBAoTE1R3aXN0ZWQgTWF0cml4 IExhYnMxFjAUBgNVBAgTDU1hc3NhY2h1c2V0dHMxJzAlBgkqhkiG9w0BCQEWGG5v Ym9keUB0d2lzdGVkbWF0cml4LmNvbTERMA8GA1UECxMIU2VjdXJpdHkwgZ8wDQYJ KoZIhvcNAQEBBQADgY0AMIGJAoGBAMzH8CDF/U91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+oQ1UBjMcSh7OcvFXJZnUesBikGWE JE4V8Bjh+RmbJ1ZAlUPZ40bAkww0OpyIRAGMvKG+4yLFTO4WDxKmfDcrOb6ID8WJ e1u+i3XGkIf/5QIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAD4Oukm3YYkhedUepBEA vvXIQhVDqL7mk6OqYdXmNj6R7ZMC8WWvGZxrzDI1bZuB+4aIxxd1FXC3UOHiR/xg i9cDl1y8P/qRp4aEBNF6rI0D4AxTbfnHQx4ERDAOShJdYZs/2zifPJ6va6YvrEyr yqDtGhklsWW3ZwBzEh5VEOUp -----END CERTIFICATE----- z server.pemc C s t | �S )zQ Each time we're called, return the next integer in the natural numbers. )�next)�counterr* r* r- r5 s r5 c K s� t � }|�td� t� }|�d� |�d� |�� |�� fD ]}| �� D ]\}}t ||t |�� q$q|�t� � |� |� |�|d� ||fS )Ni r i�3��md5)r �generate_keyr r �gmtime_adj_notBefore�gmtime_adj_notAfter� get_issuer�get_subject�items�setattrr �set_serial_numberr5 � set_pubkey�sign)�kw�keypair�certificate�xname�k�vr* r* r- �makeCertificate� s � rG �example.comc C s� t �t �tjd�g�}t �t �tjd�g�}t�ddd�}tjddt � d�}|� � }t �� �|�� |��tj�� | ��tj�� | ��t �� �� |�jt jdd d �dd�j|t�� t � d�}tjddt � d�}|� � }zt�| �} W n ty� t �| �d ��d��g} Y nw t �| �g} t �� �|�� |��tj�� | ��tj�� | ��t �� �� |�jt jddd �dd�jt �| �dd�j|t�� t � d�}t j!�"|�#t$j%��}t j&�"d�'|�(t$j%t)j*t+� �|�#t$j%�g��} || fS )a~ Create a self-signed CA certificate and server certificate signed by the CA. @param serviceIdentity: The identity (hostname) of the server. @type serviceIdentity: L{unicode} @return: a 2-tuple of C{(certificate_authority_certificate, server_certificate)} @rtype: L{tuple} of (L{sslverify.Certificate}, L{sslverify.PrivateCertificate}) zTesting Example CAzTesting Example Server� r i i )�public_exponent�key_size�backendT� )�ca�path_length)�critical)�private_key� algorithmrL �idna�asciiFN� ),r �Name� NameAttributer&