관리-도구
편집 파일: binding.cpython-36.pyc
3 y�_ � @ s d dl mZmZmZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl m Z d dlmZ d dl mZmZ d dlmZ ejddd d ddg�ZG d d� de�Zdd� Zdd� Zdd� Zddd�Zdd� ZG dd� de�Zdd� Zdd� Zee j� ej� eej� dS ) � )�absolute_import�division�print_functionN)�utils)� InternalError)�ffi�lib)�CONDITIONAL_NAMES�_OpenSSLErrorWithText�coder �func�reasonZreason_textc @ sD e Zd Zdd� Zdd� Zejd�Zejd�Zejd�Z ejd�Z d S ) � _OpenSSLErrorc C s || _ || _|| _|| _d S )N)�_code�_lib�_func�_reason)�selfr r r r � r �/usr/lib64/python3.6/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| j � }|dkrP | j|�}| j|�}| j|�}|jt||||�� 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 s^ g }xT| D ]L}t jdd�}tj|j|t|�� t j|�}|jt|j|j|j |j |�� q W |S )Nzchar[]� )r �newr ZERR_error_string_nr �len�stringr r r r )r �errors_with_text�errZbufZerr_text_reasonr r r �_errors_with_text8 s r$ c C s t t| ��S )N)r$ r )r r r r �_consume_errors_with_textH s r% c C s0 |s,|d krt | �}t|�}tdj|�|��d S )Nai 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$ r �format)r �okr r"