Your IP : 18.188.137.209
3
y�_5/ � @ s d dl mZmZmZ d dlmZ d dlmZmZm Z d dl
mZmZm
Z
d dlmZmZ d dlmZmZmZ dd� Zd d
� Zdd� Zd
d� Zdd� Zdd� Zeje�G dd� de��Zeje�G dd� de��Zejej�G dd� de��Z ejej!�G dd� de��Z"dS )� )�absolute_import�division�print_function)�utils)�InvalidSignature�UnsupportedAlgorithm�_Reasons)�_calculate_digest_and_algorithm�_check_not_prehashed�_warn_sign_verify_deprecated)�hashes�
serialization)�AsymmetricSignatureContext�AsymmetricVerificationContext�ecc C s t | tj�stdtj��d S )Nz/Unsupported elliptic curve signature algorithm.)�
isinstancer ZECDSAr r Z UNSUPPORTED_PUBLIC_KEY_ALGORITHM)�signature_algorithm� r �/usr/lib64/python3.6/ec.py�_check_signature_algorithm s r c C s� | j j|�}| j|| jjk� | j j|�}|| j jkr>td��| j jr^| j j |�dkr^td��| j j
|�}| j|| jjk� | jj|�jd�}|S )Nz;ECDSA keys with unnamed curves are unsupported at this timer �ascii)
�_lib�EC_KEY_get0_group�openssl_assert�_ffi�NULL�EC_GROUP_get_curve_nameZ NID_undef�NotImplementedErrorZ$CRYPTOGRAPHY_OPENSSL_102U_OR_GREATERZEC_GROUP_get_asn1_flagZ
OBJ_nid2sn�string�decode)�backendZec_key�groupZnidZ
curve_name�snr r r �_ec_key_curve_sn"