File: //opt/alt/python37/lib/python3.7/site-packages/dns/__pycache__/tsig.cpython-37.pyc
B
��f�, � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddl ZG dd� dej
j�ZG dd� dej
j�Z
G dd� dej
j�ZG d d
� d
ej
j�ZG dd� dej
j�ZG d
d� de�ZG dd� de�ZG dd� de�ZG dd� de�Zej�d�Zej�d�Zej�d�Zej�d�Zej�d�Zej�d�Zej�d�Zej�d�Zej�d�Zej�d�Z eZ!eded ed!ed"ed#ed$ed%ed!ed"e d&i
Z"G d'd(� d(�Z#G d)d*� d*�Z$G d+d,� d,�Z%d:d-d.�Z&d/d0� Z'd;d2d3�Z(d<d4d5�Z)d6d7� Z*G d8d9� d9�Z+dS )=zDNS TSIG support.� Nc @ s e Zd ZdZdS )�BadTimez8The current time is not within the TSIG's validity time.N)�__name__�
__module__�__qualname__�__doc__� r r �9/opt/alt/python37/lib/python3.7/site-packages/dns/tsig.pyr s r c @ s e Zd ZdZdS )�BadSignaturez#The TSIG signature fails to verify.N)r r r r r r r r r $ s r c @ s e Zd ZdZdS )�BadKeyz2The TSIG record owner name does not match the key.N)r r r r r r r r r
) s r
c @ s e Zd ZdZdS )�BadAlgorithmz*The TSIG algorithm does not match the key.N)r r r r r r r r r . s r c @ s e Zd ZdZdS )� PeerErrorz;Base class for all TSIG errors generated by the remote peerN)r r r r r r r r r 3 s r c @ s e Zd ZdZdS )�
PeerBadKeyz$The peer didn't know the key we usedN)r r r r r r r r r
8 s r
c @ s e Zd ZdZdS )�PeerBadSignaturez*The peer didn't like the signature we sentN)r r r r r r r r r = s r c @ s e Zd ZdZdS )�PeerBadTimez%The peer didn't like the time we sentN)r r r r r r r r r B s r c @ s e Zd ZdZdS )�PeerBadTruncationz=The peer didn't like amount of truncation in the TSIG we sentN)r r r r r r r r r G s r zHMAC-MD5.SIG-ALG.REG.INTz hmac-sha1zhmac-sha224zhmac-sha256zhmac-sha256-128zhmac-sha384zhmac-sha384-192zhmac-sha512zhmac-sha512-256zgss-tsig� � � � �0 � �@ � c @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
S )�GSSTSigaG
GSS-TSIG TSIG implementation. This uses the GSS-API context established
in the TKEY message handshake to sign messages using GSS-API message
integrity codes, per the RFC.
In order to avoid a direct GSSAPI dependency, the keyring holds a ref
to the GSSAPI object required, rather than the key itself.
c C s || _ d| _d| _d S )N� zgss-tsig)�gssapi_context�data�name)�selfr r r r �__init__s s zGSSTSig.__init__c C s | j |7 _ d S )N)r )r r r r r �updatex s zGSSTSig.updatec C s | j �| j�S )N)r Z
get_signaturer )r r r r �sign{ s zGSSTSig.signc C s. y| j �| j|�S tk
r( t�Y nX d S )N)r Zverify_signaturer � Exceptionr )r �expectedr r r �verify s zGSSTSig.verifyN)r r r r r r r! r$ r r r r r i s
r c @ s( e Zd Zdd� Zdd� Zedd� �ZdS )�GSSTSigAdapterc C s
|| _ d S )N)�keyring)r r&