+
    ni8-                        R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t^ RI
t ! R R]P                  P                  4      t ! R R]P                  P                  4      t ! R R]P                  P                  4      t ! R R	]P                  P                  4      t ! R
 R]P                  P                  4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t]P,                  P/                  R4      t]P,                  P/                  R4      t]P,                  P/                  R4      t]P,                  P/                  R4      t]P,                  P/                  R4      t]P,                  P/                  R4      t]P,                  P/                  R4      t]P,                  P/                  R4      t]P,                  P/                  R4      t ]P,                  P/                  R4      t!]t"]^]^]^ ]^]^0]^]^@] ^ ]^]!^/
t# ! R R4      t$ ! R  R!4      t% ! R" R#4      t&R+R$ lt'R% t(R,R& lt)R-R' lt*R( t+ ! R) R*4      t,R# ).zDNS TSIG support.Nc                       ] tR t^ tRtRtR# )BadTimez8The current time is not within the TSIG's validity time. N__name__
__module____qualname____firstlineno____doc____static_attributes__r       bC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO\maestro-backend\venv\Lib\site-packages\dns/tsig.pyr   r       s    Br   r   c                       ] tR t^$tRtRtR# )BadSignaturez#The TSIG signature fails to verify.r   Nr   r   r   r   r   r   $   s    -r   r   c                       ] tR t^(tRtRtR# )BadKeyz2The TSIG record owner name does not match the key.r   Nr   r   r   r   r   r   (   s    <r   r   c                       ] tR t^,tRtRtR# )BadAlgorithmz*The TSIG algorithm does not match the key.r   Nr   r   r   r   r   r   ,       4r   r   c                       ] tR t^0tRtRtR# )	PeerErrorz;Base class for all TSIG errors generated by the remote peerr   Nr   r   r   r   r   r   0   s    Er   r   c                       ] tR t^4tRtRtR# )
PeerBadKeyz$The peer didn't know the key we usedr   Nr   r   r   r   r   r   4   s    .r   r   c                       ] tR t^8tRtRtR# )PeerBadSignaturez*The peer didn't like the signature we sentr   Nr   r   r   r   r   r   8   r   r   r   c                       ] tR t^<tRtRtR# )PeerBadTimez%The peer didn't like the time we sentr   Nr   r   r   r   r   r   <   s    /r   r   c                       ] tR t^@tRtRtR# )PeerBadTruncationz=The peer didn't like amount of truncation in the TSIG we sentr   Nr   r   r   r   r   r   @   s    Gr   r   zHMAC-MD5.SIG-ALG.REG.INTz	hmac-sha1zhmac-sha224zhmac-sha256zhmac-sha256-128zhmac-sha384zhmac-sha384-192zhmac-sha512zhmac-sha512-256gss-tsigc                   <   a  ] tR t^at o RtR tR tR tR tRt	V t
R# )GSSTSiga/  
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                .    Wn         R V n        RV n        R# )r   r   N)gssapi_contextdataname)selfr#   s   &&r   __init__GSSTSig.__init__k   s    ,		r   c                8    V ;P                   V,          un         R # N)r$   r&   r$   s   &&r   updateGSSTSig.updatep   s    		T	r   c                L    V P                   P                  V P                  4      # r*   )r#   get_signaturer$   )r&   s   &r   signGSSTSig.signs   s    ""00;;r   c                z     V P                   P                  V P                  V4      #   \         d    \        hi ; ir*   )r#   verify_signaturer$   	Exceptionr   )r&   expecteds   &&r   verifyGSSTSig.verifyw   s9    	&&77		8LL 		s   %( :)r$   r#   r%   N)r   r   r   r	   r
   r'   r,   r0   r6   r   __classdictcell____classdict__s   @r   r!   r!   a   s#     
< r   r!   c                   <   a  ] tR t^t o R tR t]R 4       tRtV t	R# )GSSTSigAdapterc                    Wn         R # r*   keyring)r&   r?   s   &&r   r'   GSSTSigAdapter.__init__   s    r   c                    W P                   9   d_   V P                   V,          p\        V\        4      '       d4   VP                  \        8X  d   V'       d   \
        P                  W1V4       V# R # r*   )r?   
isinstanceKey	algorithmGSS_TSIGr<   parse_tkey_and_step)r&   messagekeynamekeys   &&& r   __call__GSSTSigAdapter.__call__   sM    ll",,w'C#s##(A"66sWMJr   c                8    VP                  VP                  V\        P                  P                  \        P
                  P                  4      pV'       d1   V^ ,          P                  pVP                  pVP                  V4      # R#   \         d     R# i ; i)    N)
find_rrsetanswerdns
rdataclassANY	rdatatypeTKEYrI   secretstepKeyError)clsrI   rG   rH   rrsettokenr#   s   &&&&   r   rF   "GSSTSigAdapter.parse_tkey_and_step   s}    		&&););S]]=O=OE a!$%**511   		s   AB
 /B
 
BBr>   N)
r   r   r   r	   r'   rJ   classmethodrF   r   r8   r9   s   @r   r<   r<      s#       r   r<   c                   $  a  ] tR t^t o Rt]]P                  ]]P                  ]
]P                  ]]P                  ^3]]P                  ]]P                  ^3]]P"                  ]]P"                  R3]]P(                  /	tR tR tR tR tRtV tR# )	HMACTSigzc
HMAC TSIG implementation.  This uses the HMAC python module to handle the
sign/verify operations.
   c                    V P                   V,          p\        T\        4      '       d3   \
        P                  ! Y^ ,          R7      T n        T^,          T n        M#\
        P                  ! YR7      T n        RT n        T P                  P                  T n	        T P                  '       d)   T ;P                  RT P                   2,          un	        R# R#   \         d    \        R T R24      hi ; i)zTSIG algorithm z is not supported)	digestmodN-)
_hashesrW   NotImplementedErrorrB   tuplehmacnewhmac_contextsizer%   )r&   rI   rD   hashinfos   &&& r   r'   HMACTSig.__init__   s    	V||I.H
 h&& $ DD DI $ ADDI%%**	999II1TYYK(I   	V%	{BS&TUU	Vs   C C2c                8    V P                   P                  V4      # r*   )rh   r,   r+   s   &&r   r,   HMACTSig.update   s      ''--r   c                    V P                   P                  4       pV P                  '       d   VR V P                  ^,           pV# r*   )rh   digestri   )r&   ro   s   & r   r0   HMACTSig.sign   s9    ""))+999.tyyA~/Fr   c                j    V P                  4       p\        P                  ! W!4      '       g   \        hR # r*   )r0   rf   compare_digestr   )r&   r5   macs   && r   r6   HMACTSig.verify   s)    iik""311 2r   )rh   r%   ri   N)r   r   r   r	   r
   	HMAC_SHA1hashlibsha1HMAC_SHA224sha224HMAC_SHA256sha256HMAC_SHA256_128HMAC_SHA384sha384HMAC_SHA384_192HMAC_SHA512sha512HMAC_SHA512_256HMAC_MD5md5rc   r'   r,   r0   r6   r   r8   r9   s   @r   r^   r^      s      	7<<W^^W^^'..#.W^^'..#.W^^'..#.'++
G)". r   r^   c                   T;'       d    T'       * pV'       dT   \        V4      pV'       dA   VP                  \        P                  ! R\	        V4      4      4       VP                  V4       Vf   Q hVP                  \        P                  ! RVP
                  4      4       VP                  V R,          4       V'       d   VP                  VP                  P                  4       4       VP                  \        P                  ! R\        P                  P                  4      4       VP                  \        P                  ! R^ 4      4       Vf   VP                  pV^ ,	          R,          pVR,          p	\        P                  ! RWVP                  4      p
\	        VP                  4      pVR8  d   \        R4      hV'       du   VP                  VP                  P                  4       V
,           4       VP                  \        P                  ! RVP                   V4      VP                  ,           4       V# VP                  V
4       V# )	zReturn a context containing the TSIG rdata for the input parameters
@rtype: dns.tsig.HMACTSig or dns.tsig.GSSTSig object
@raises ValueError: I{other_data} is too long
@raises NotImplementedError: I{algorithm} is not supported
!H:   NNz!Ii  l    z!HIHz TSIG Other Data is > 65535 bytesz!HH)get_contextr,   structpacklenoriginal_idr%   to_digestablerP   rQ   rR   time_signedfudgeother
ValueErrorrD   error)wirerI   rdatatimerequest_macctxmultifirst
upper_time
lower_timetime_encoded	other_lens   &&&&&&&     r   _digestr      s    E#JJv{{4[)9:;JJ{#??JJv{{4!2!234JJtBx

388))+,

6;;tS^^%7%789

6;;tQ'(|  "*&J
"J;;vzu{{KLEKK I5;<<

3==..0<?@

6;;uekk9=KL J 	

< Jr   c                    V'       dN   \        V 4      pVP                  \        P                  ! R\	        V4      4      4       VP                  V4       V# R# )zIf this is the first message in a multi-message sequence,
start a new context.
@rtype: dns.tsig.HMACTSig or dns.tsig.GSSTSig object
r   N)r   r,   r   r   r   )rI   rs   r   r   s   &&& r   _maybe_start_digestr      s?    
 #

6;;tSX./

3
r   c           	     ~    \        WW#WEV4      pVP                  4       pVP                  W7R7      pV\        WV4      3# )af  Return a (tsig_rdata, mac, ctx) tuple containing the HMAC TSIG rdata
for the input parameters, the HMAC MAC calculated by applying the
TSIG signature algorithm, and the TSIG digest context.
@rtype: (string, dns.tsig.HMACTSig or dns.tsig.GSSTSig object)
@raises ValueError: I{other_data} is too long
@raises NotImplementedError: I{algorithm} is not supported
)r   rs   )r   r0   replacer   )	r   rI   r   r   r   r   r   rs   tsigs	   &&&&&&&  r   r0   r0     sB     $U+E
BC
((*C==T=3D%c677r   c	           	        \         P                  ! RV R,          4      w  p	V	^ 8X  d   \        P                  P                  hV	^,          p	V R,          \         P
                  ! RV	4      ,           V ^V ,           p
VP                  ^ 8w  d   VP                  \        P                  P                  8X  d   \        hVP                  \        P                  P                  8X  d   \        hVP                  \        P                  P                  8X  d   \        hVP                  \        P                  P                  8X  d   \        h\!        RVP                   24      h\#        VP$                  V,
          4      VP&                  8  d   \(        hVP*                  V8w  d   \,        hVP.                  VP.                  8w  d   \0        h\3        WVRWWV4      pVP5                  VP6                  4       \9        WP6                  V4      # )a2  Validate the specified TSIG rdata against the other input parameters.

@raises FormError: The TSIG is badly formed.
@raises BadTime: There is too much time skew between the client and the
server.
@raises BadSignature: The TSIG signature did not validate
@rtype: dns.tsig.HMACTSig or dns.tsig.GSSTSig objectr   :
      N:rM   r   Nzunknown TSIG error code N)r   unpackrP   	exception	FormErrorr   r   rcodeBADSIGr   BADKEYr   BADTIMEr   BADTRUNCr   r   absr   r   r   r%   r   rD   r   r   r6   rs   r   )r   rI   ownerr   nowr   
tsig_startr   r   adcountnew_wires   &&&&&&&&&  r   validater     sm    tT%[1JW!|mm%%%qLGDzFKKg66b9LLH{{a;;#))***""[[CII,,,[[CII---[[CII...##6u{{mDEE
5s"#ekk1
xx5
}}'
(k
FCJJuyysIIu55r   c                    V P                   \        8X  d   \        V P                  4      # \	        V P                  V P                   4      # )zReturns an HMAC context for the specified key.

@rtype: HMAC context
@raises NotImplementedError: I{algorithm} is not supported
)rD   rE   r!   rU   r^   )rI   s   &r   r   r   <  s4     }} szz""

CMM22r   c                   D   a  ] tR tRt o ]3V 3R lR lltR tR tRtV t	R# )rC   iI  c                   < V ^8  d   QhRS[ P                  P                  S[,          RS[S[,          RS[ P                  P                  S[,          /# )r   r%   rU   rD   )rP   r%   Namestrbytes)formatr:   s   "r   __annotate__Key.__annotate__J  sG     # #hhmmc!# # 88==3&	#r   c                r   \        V\        4      '       d    \        P                  P	                  V4      pWn        \        V\        4      '       d%   \
        P                  ! VP                  4       4      pW n        \        V\        4      '       d    \        P                  P	                  V4      pW0n	        R # r*   )
rB   r   rP   r%   	from_textbase64decodebytesencoderU   rD   )r&   r%   rU   rD   s   &&&&r   r'   Key.__init__J  sx     dC  88%%d+D	fc""''8Fi%%**95I"r   c                    \        V\        4      ;'       d\    V P                  VP                  8H  ;'       d;    V P                  VP                  8H  ;'       d    V P                  VP                  8H  # r*   )rB   rC   r%   rU   rD   )r&   r   s   &&r   __eq__
Key.__eq__Z  sa    uc" 2 2		UZZ'2 2u||+2 2 %//1		
r   c                    R V P                    R2RV P                   R2,           pV P                  \        8w  d:   VR\        P                  ! V P
                  4      P                  4        R2,          pVR,          pV# )z<DNS key name='z', zalgorithm=''z
, secret='>)r%   rD   rE   r   	b64encoderU   decode)r&   rs   & r   __repr__Key.__repr__b  sm    dii[,T^^<LA/NN>>X%:f..t{{;BBDEQGGA	Sr   )rD   r%   rU   N)
r   r   r   r	   default_algorithmr'   r   r   r   r8   r9   s   @r   rC   rC   I  s#     
 *;	# # 
 r   rC   )NNNN)NNNF)NF)-r
   r   rv   rf   r   dns.exceptionrP   dns.name	dns.rcodedns.rdataclassdns.rdatatyper   DNSExceptionr   r   r   r   r   r   r   r   r   r%   r   r   ru   rx   rz   r|   r}   r   r   r   rE   r   	mac_sizesr!   r<   r^   r   r   r0   r   r   rC   r   r   r   <module>r      s  $          Ccmm(( C.3==-- .=S]]'' =53==-- 5F** F/ /5y 50) 0H	 H 8889HH{+	hh  /hh  /(($$%67hh  /(($$%67hh  /(($$%6788j)  rRRRbc	 > @1 1h!H8 #6L
3 r   