ó é×fc@sŽddlZddlZddlZddlmZmZddlmZmZdZ dd d„ƒYZ ddd„Z d„Z d „ZdS( iÿÿÿÿN(tPopentPIPE(tprefixtversionsdnssec-checkdstSECRRcBsreZidd6dd6dd6dd6ZdZd ZdZdZdZdZ d Z dd „Z d „Z d „Z RS(sSHA-1isSHA-256itGOSTisSHA-384ittINicCsQ|st‚n|jdƒjƒ}t|ƒdkr?t‚n|r>d|_|jƒ|_|djƒjdƒjdƒ}|jƒ|jdƒ}|jƒxPt|ƒdkrôt|ƒdkrô|d|dkrô|d}|d}q¥W|rt‚n|jƒdj |ƒ|_ |j d|jd|_ nd|_|djƒ|_ |d}|dj ƒdkrš|dj ƒ|_ |d}n0t|dƒ|_|dj ƒ|_ |d }|dj ƒ|jkr td |dj ƒ|jfƒ‚ntt|dd !ƒ\|_|_|_dj |d ƒj ƒ|_dS(NtasciiitDLVit.itDSRtCHtHSis%s does not match %siR(sINR R (t Exceptiontdecodetsplittlentrrtypetlowertdlvnametstriptreversetjointparenttrrnametuppertrrclasstinttttltmaptkeyidtkeyalgthashalgtdigest(tselftrrtextRtfieldsRtdlv((s//usr/lib/python2.7/site-packages/isc/checkds.pyt__init__$sD   "  ;        (cCs2d|j|j|j|j|j|j|jfS(Ns%s %s %s %d %d %d %s(RRRRR R!R"(R#((s//usr/lib/python2.7/site-packages/isc/checkds.pyt__repr__OscCs|jƒ|jƒkS(N(R((R#tother((s//usr/lib/python2.7/site-packages/isc/checkds.pyt__eq__TsN(t__name__t __module__thashalgsRRtNoneRR R!R"RR'R(R*(((s//usr/lib/python2.7/site-packages/isc/checkds.pyRs" + c Cs¢g}|jddd|r!dndd|r;|d|n|g}t|dtƒjƒ\}}x*|jƒD]}|jt||ƒƒqoWt|d d „ƒ}g} |r |jd |g}|rÛ|d |g7}n|j|ƒt|dtƒjƒ\}}n•t|jdddd d|gdtƒjƒ\} }|jd dg}|rj|d |g7}n|j|ƒt|dtdtƒj| ƒ\}}x*|jƒD]}| jt||ƒƒq«Wt | ƒdkrædGHt St } x‘| D]‰} | |krEd| j | j j dƒ| j| jtj| jfGHt} qód| j | j j dƒ| j| jtj| jfGHqóW| sžd|r•dndGHn| S(Ns+noalls+answers-tR&tdss-qR tstdouttkeycSs|j|j|jfS(N(RR R!(trr((s//usr/lib/python2.7/site-packages/isc/checkds.pytgss-fs-ltdnskeyt-tstdinis$No DNSKEY records found in zone apexs,%s for KSK %s/%03d/%05d (%s) found in parents0%s for KSK %s/%03d/%05d (%s) missing from parents'No %s records were found for any DNSKEYR R (tdigRRt communicatet splitlinestappendRtsortedt dsfromkeyRtFalseRRRR RR-R!tTrue( tzonetargst masterfilet lookasidetrrlisttcmdtfpt_tlinetklisttintodstfoundR2((s//usr/lib/python2.7/site-packages/isc/checkds.pytcheck_sN  !! '   c Csptjdtdƒ}d}tjdkr1dnd}|jddtdd ƒ|jd d d d dtddƒ|jddd ddtddƒ|jddd ddtjjt |ƒdƒdtddƒ|jddd ddtjjt |ƒdƒdtddƒ|jdddddt ƒ|j ƒ}|j j d ƒ|_ |jrl|jj d ƒ|_n|S(!Nt descriptions: checks DS coveragetbintnttsbinR?ttypethelps zone to checks-fs--filetdestRAszone master files-ls --lookasideRBsDLV lookaside zones-ds--digR7tdefaults path to 'dig's-Ds --dsfromkeyR<sdnssec-dsfromkeys-vs --versiontactionRR (targparsetArgumentParsertprogtostnamet add_argumenttstrtpathRRRt parse_argsR?RRB(tparsertbindirtsbindirR@((s//usr/lib/python2.7/site-packages/isc/checkds.pyR]–s,     cCsAtƒ}t|j||j|jƒ}t|r6dndƒdS(Nii(R]RKR?RARBtexit(R@RJ((s//usr/lib/python2.7/site-packages/isc/checkds.pytmain¶s ((RURXtsyst subprocessRRt isc.utilsRRRWRR.RKR]Rb(((s//usr/lib/python2.7/site-packages/isc/checkds.pyt s   E7