Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 ¢báW&ã @s~dZddlZddlZddlZddlZddlZddlZddlm Z m Z m Z Gdd„dej j ƒZGdd„dej j ƒZGd d „d ej j ƒZGd d „d eƒZGd d„deƒZGdd„deƒZGdd„deƒZejjdƒZejjdƒZejjdƒZejjdƒZejjdƒZejjdƒZedededededediZeZdZd Z d!Z!d"Z"dd#d$efd%d&„Z#dd#d$efd'd(„Z$d/d)d*„Z%d+d,„Z&d-d.„Z'dS)0zDNS TSIG support.éNé)ÚlongÚ string_typesÚ text_typec@seZdZdZdS)ÚBadTimez8The current time is not within the TSIG's validity time.N)Ú__name__Ú __module__Ú __qualname__Ú__doc__©r r ú/usr/lib/python3.6/tsig.pyrsrc@seZdZdZdS)Ú BadSignaturez#The TSIG signature fails to verify.N)rrr r r r r r r sr c@seZdZdZdS)Ú PeerErrorz;Base class for all TSIG errors generated by the remote peerN)rrr r r r r r r%src@seZdZdZdS)Ú PeerBadKeyz$The peer didn't know the key we usedN)rrr r r r r r r*src@seZdZdZdS)ÚPeerBadSignaturez*The peer didn't like the signature we sentN)rrr r r r r r r/src@seZdZdZdS)Ú PeerBadTimez%The peer didn't like the time we sentN)rrr r r r r r r4src@seZdZdZdS)ÚPeerBadTruncationz=The peer didn't like amount of truncation in the TSIG we sentN)rrr r r r r r r9srzHMAC-MD5.SIG-ALG.REG.INTz hmac-sha1z hmac-sha224z hmac-sha256z hmac-sha384z hmac-sha512ZSHA224ZSHA256ZSHA384ZSHA512ZSHA1ZMD5ééééFTc CsÄt|tƒr|jƒ}t| ƒ\} }| r\tj||d�} t|ƒ}|dkr\| jtj d|ƒƒ| j|ƒtj d|ƒ}| j|ƒ| j|dd…ƒ| r¾| j|j ƒƒ| jtj dt j j ƒƒ| jtj ddƒƒ|tdƒ}|d?tdƒ@}|td ƒ@}tj d |||ƒ}| |}t|ƒ}|dk�rtd ƒ‚tj d ||ƒ|}| �rF| j|ƒ| j|ƒn | j|ƒ| jƒ}tj dt|ƒƒ}|||||}| �r¶tj||d�} t|ƒ}| jtj d|ƒƒ| j|ƒnd} ||| fS) ajReturn 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, string, hmac.HMAC object) @raises ValueError: I{other_data} is too long @raises NotImplementedError: I{algorithm} is not supported )Ú digestmodrz!HéNz!Ié iÿÿlÿÿz!HIHz TSIG Other Data is > 65535 bytesz!HH)Ú isinstancerÚencodeÚ get_algorithmÚhmacÚnewÚlenÚupdateÚstructÚpackÚ to_digestableÚdnsZ rdataclassÚANYrÚ ValueErrorZdigest)ÚwireÚkeynameÚsecretÚtimeÚfudgeÚ original_idÚerrorÚ other_dataÚ request_macÚctxÚmultiÚfirstÚ algorithmZalgorithm_namerZmlÚidZ long_timeÚ upper_timeÚ lower_timeZtime_macZpre_macZolZpost_macÚmacZmpackÚ tsig_rdatar r r ÚsignWsN            r9c Cs t|||||||||| | | | ƒ S)N)r9) r'r(r)r*r+r,r-r.r/r0r1r2r3r r r Úhmac_md5�sr:c CsÖtjd|dd…ƒ\} | dkr&tjj‚| d8} |dd…tjd| ƒ|d|…} |} tjj|| ƒ\}}| |} tjd|| | d…ƒ\}}}}|tdƒd>|tdƒ}| d7} || | |…}| |7} tjd|| | d …ƒ\}}}| d 7} || | |…}| |7} | ||k�r tjj‚|dk�rv|t k�r:t ‚n<|t k�rJt ‚n,|t k�rZt‚n|tk�rjt‚n td |ƒ‚||}||}||k�sš||k�ržt‚t| |||||||||| | |ƒ \}}}||k�rÒt‚|S) a*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: hmac.HMAC objectz!Hé é rrz!HIHHrz!HHHézunknown TSIG error code %d)r!Úunpackr$Ú exceptionÚ FormErrorr"ÚnameÚ from_wirerÚBADSIGrÚBADKEYrÚBADTIMErÚBADTRUNCrrrr9r )r'r(r)Znowr/Z tsig_startr8Ú tsig_rdlenr0r1r2ZadcountZnew_wireÚcurrentÚanameÚusedr5r6r+Úmac_sizer*r7r,r-Z other_sizer.Ztime_lowZ time_highZjunkZour_macr r r Úvalidate”sN $         rLc Cs\t|tƒrtjj|ƒ}y|jƒtjjt|fSt k rVt dt |ƒdƒ‚YnXdS)zÊReturns the wire format string and the hash module to use for the specified TSIG algorithm @rtype: (string, hash constructor) @raises NotImplementedError: I{algorithm} is not supported zTSIG algorithm z is not supportedN) rrr$rAÚ from_textr#ÚhashZhashesÚ_hashesÚKeyErrorÚNotImplementedErrorÚstr)r3r r r rÊs   rc Csz|}tjj||ƒ\}}||}tjd|||d…ƒ\}}}} |d7}|||| …} || 7}|||krrtjj‚|| fS)zlReturn the tsig algorithm for the specified tsig_rdata @raises FormError: The TSIG is badly formed. z!HIHHr;)r$rArBr!r>r?r@) r'r8rGrHrIrJr5r6r+rKr7r r r Úget_algorithm_and_macÜs  rS)NFT)(r rr!Z dns.exceptionr$Zdns.hashZdns.rdataclassZdns.nameZ_compatrrrr?Z DNSExceptionrr rrrrrrArMZHMAC_MD5Z HMAC_SHA1Z HMAC_SHA224Z HMAC_SHA256Z HMAC_SHA384Z HMAC_SHA512rOZdefault_algorithmrCrDrErFr9r:rLrrSr r r r ÚsL       5  5