Submit
Path:
~
/
/
opt
/
alt
/
python37
/
lib64
/
python3.7
/
site-packages
/
cryptography
/
hazmat
/
bindings
/
openssl
/
__pycache__
/
File Content:
binding.cpython-37.opt-1.pyc
B \��`x � @ s� d dl mZmZmZ d dlZd dlZd dlZd dlmZ d dl m Z d dlmZm Z d dlmZ e�ddd d ddg�ZG d d� de�Zdd� Zdd� Zdd� ZG dd� de�Ze�� dS )� )�absolute_import�division�print_functionN)�utils)� InternalError)�ffi�lib)�CONDITIONAL_NAMES�_OpenSSLErrorWithText�coder �func�reasonZreason_textc @ sD e Zd Zdd� Zdd� Ze�d�Ze�d�Ze�d�Z e�d�Z d S ) � _OpenSSLErrorc C s || _ || _|| _|| _d S )N)�_code�_lib�_func�_reason)�selfr r r r � r �_/opt/alt/python37/lib64/python3.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py�__init__ s z_OpenSSLError.__init__c C s || j ko|| jkS )N)r r )r r r r r r �_lib_reason_match s z_OpenSSLError._lib_reason_matchr r r r N)�__name__� __module__�__qualname__r r r Zread_only_propertyr r r r r r r r r s r c C sR g }xH| � � }|dkrP | �|�}| �|�}| �|�}|�t||||�� qW |S )Nr )Z ERR_get_errorZERR_GET_LIBZERR_GET_FUNCZERR_GET_REASON�appendr )r �errorsr Zerr_libZerr_funcZ err_reasonr r r �_consume_errors% s r c C sz |svt | �}g }xT|D ]L}t�dd�}| �|j|t|�� t�|�}|�t|j|j |j |j|�� qW td� |�|��d S )Nzchar[]� ai Unknown OpenSSL error. This error is commonly encountered when another library is not cleaning up the OpenSSL error stack. If you are using cryptography with another library that uses OpenSSL try disabling it before reporting a bug. Otherwise please file an issue at https://github.com/pyca/cryptography/issues with information on how to reproduce this. ({0!r}))r r �newZERR_error_string_nr �len�stringr r r r r r �format)r �okr Zerrors_with_text�errZbufZerr_text_reasonr r r �_openssl_assert5 s r% c C sr t �d�}| |_t� }x*|�� D ]\}}t| |�s |�|� � q W x*t| �D ]}||krLt||t| |�� qLW |S )Nr ) �types� ModuleTypeZ _original_lib�set�items�getattr�update�dir�setattr)r Zconditional_namesZconditional_libZexcluded_namesZ conditionZnames_cb�attrr r r �build_conditional_libraryP s r/ c @ sX e Zd ZdZdZeZdZe�� Z e�� Z dd� Zedd� �Z edd � �Zed d� �ZdS )�Bindingz OpenSSL API wrapper. NFc C s | � � d S )N)�_ensure_ffi_initialized)r r r r r i s zBinding.__init__c C s<