ok

Mini Shell

Direktori : /proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/isc/
Upload File :
Current File : //proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/isc/policy.pyo

�
���cc@s�ddlZddljZddljZddlTddlmZdfd��YZdfd��YZde	fd	��YZ
d
fd��YZedkr~ddl
Z
e
jd
dkree
jd�Zej�Zej�edd
�Zeje�nue
jd
dkr{y=ee
jddede�ZejdGHejd�GHWne	k
rwZejdGHnXnndS(i����N(t*(tcopyt	PolicyLexc
Bs�eZd&Zed'ZiZdZdZdZdZdZ	d�Z
d�Zd�Zd�Z
d�Zd �Zd!�Zd"�Zd#�Zd$�Zd%�ZRS((tPOLICYtALGORITHM_POLICYtZONEt	ALGORITHMt	DIRECTORYtKEYTTLtKEY_SIZEtROLL_PERIODtPRE_PUBLISHtPOST_PUBLISHtCOVERAGEtSTANDBYtNONEt
DATESUFFIXtKEYTYPEtALGNAMEtSTRtQSTRINGtNUMBERtLBRACEtRBRACEtSEMIs 	s	(//|\#).*s\{s\}t;cCs"|jj|jjd�7_dS(s\n+s
N(tlexertlinenotvaluetcount(tselftt((s./usr/lib/python2.7/site-packages/isc/policy.pyt	t_newline7scCs"|jj|jjd�7_dS(s/\*(.|\n)*?\*/s
N(RRRR(RR((s./usr/lib/python2.7/site-packages/isc/policy.pyt	t_comment;scCs+tjd|j�jd�j�|_|S(s�(?i)(?<=[0-9 \t])(y(?:ears|ear|ea|e)?|mo(?:nths|nth|nt|n)?|w(?:eeks|eek|ee|e)?|d(?:ays|ay|a)?|h(?:ours|our|ou|o)?|mi(?:nutes|nute|nut|nu|n)?|s(?:econds|econd|econ|eco|ec|e)?)\bs(?i)(y|mo|w|d|h|mi|s)([a-z]*)i(tretmatchRtgrouptlower(RR((s./usr/lib/python2.7/site-packages/isc/policy.pytt_DATESUFFIX?s'cCs|jj�|_|S(s(?i)\b(KSK|ZSK)\b(Rtupper(RR((s./usr/lib/python2.7/site-packages/isc/policy.pyt	t_KEYTYPEDscCs|jj�|_|S(s�(?i)\b(RSAMD5|DH|DSA|NSEC3DSA|ECC|RSASHA1|NSEC3RSASHA1|RSASHA256|RSASHA512|ECCGOST|ECDSAP256SHA256|ECDSAP384SHA384|ED25519|ED448)\b(RR'(RR((s./usr/lib/python2.7/site-packages/isc/policy.pyt	t_ALGNAMEIscCs|jj|jd�|_|S(s[A-Za-z._-][\w._-]*R(treserved_maptgetRttype(RR((s./usr/lib/python2.7/site-packages/isc/policy.pytt_STRNscCs2|jj|jd�|_|jdd!|_|S(s"([^"\n]|(\\"))*"Rii����(R*R+RR,(RR((s./usr/lib/python2.7/site-packages/isc/policy.pyt	t_QSTRINGSscCst|j�|_|S(s\d+(tintR(RR((s./usr/lib/python2.7/site-packages/isc/policy.pytt_NUMBERYscCs$d|jdGH|jjd�dS(NsIllegal character '%s'ii(RRtskip(RR((s./usr/lib/python2.7/site-packages/isc/policy.pytt_error^scKs�dtt�kr'tjdd�}ntdd�}x-|jD]"}||j|j�j|�<q@Wtjd||�|_dS(Nt	maketranst_t-tobject(	tdirtstrR3treservedR*R%t	translatetlexR(Rtkwargsttranstr((s./usr/lib/python2.7/site-packages/isc/policy.pyt__init__bs cCs?|jj|�x(tr:|jj�}|s2Pn|GHqWdS(N(RtinputtTruettoken(RttextR((s./usr/lib/python2.7/site-packages/isc/policy.pyttestks	(
RRRRRRR	R
RRR
RR(	RRRsSTRsQSTRINGRRRR(t__name__t
__module__R9ttokensR*tt_ignorett_ignore_olcommenttt_LBRACEtt_RBRACEtt_SEMIR R!R&R(R)R-R.R0R2R?RD(((s./usr/lib/python2.7/site-packages/isc/policy.pyRsN											tPolicycBs+eZeZeZeZdZdZdZ	dZ
dZdZdZ
dZdZdZdZdZdZiddgd6ddgd6ddgd6ddgd6ddgd6ddgd6ddgd	6dd
6dd6dd6dd
6dd6Zdddd�Zd�Zd�Zd�Zd�Zd�ZRS(iitDSAtNSEC3DSAitRSAMD5tRSASHA1tNSEC3RSASHA1t	RSASHA256t	RSASHA512tECCGOSTtECDSAP256SHA256tECDSAP384SHA384tED25519tED448cCs||_||_||_dS(N(tnamet	algorithmtparent(RRZR[R\((s./usr/lib/python2.7/site-packages/isc/policy.pyR?�s			c6Cs�d|jrdp3|jr!dp3|jr0dp3d|jp?d|jrT|jjpWd|jrwdt|j�dpzd|jp�d|jr�t|j�p�d|j	r�t|j	�p�d|j
r�t|j
�p�d|jr�t|j�p�d|jr
t|j�p
d|j
r%t|j
�p(d|jr@t|j�pCd|jr[t|j�p^d|jrvt|j�pyd|jr�t|j�p�d|jr�t|j�p�d|jr�t|j�p�dfS(	Ns%spolicy %s:
	inherits %s
	directory %s
	algorithm %s
	coverage %s
	ksk_keysize %s
	zsk_keysize %s
	ksk_rollperiod %s
	zsk_rollperiod %s
	ksk_prepublish %s
	ksk_postpublish %s
	zsk_prepublish %s
	zsk_postpublish %s
	ksk_standby %s
	zsk_standby %s
	keyttl %s
sconstructed szone s
algorithm ttUNKNOWNtNonet"(tis_constructedtis_zonetis_algRZR\t	directoryR8R[tcoveragetksk_keysizetzsk_keysizetksk_rollperiodtzsk_rollperiodtksk_prepublishtksk_postpublishtzsk_prepublishtzsk_postpublishtksk_standbytzsk_standbytkeyttl(R((s./usr/lib/python2.7/site-packages/isc/policy.pyt__repr__�s(#cCs |d|ko|dkSS(Nii((Rtkey_sizet
size_range((s./usr/lib/python2.7/site-packages/isc/policy.pyt
__verify_size�scCs|jS(N(RZ(R((s./usr/lib/python2.7/site-packages/isc/policy.pytget_name�scCs|jS(N(Ra(R((s./usr/lib/python2.7/site-packages/isc/policy.pytconstructed�scCs�|jrL|jdk	rL|j|jkrL|jGHtd|j|jffS|jr�|jdk	r�|j|jkr�td|j|jffS|jr�|jdk	r�|j|jkr�td|j|jffS|jr|jdk	r|j|jkrtd|j|jffS|jrp|jrp|jrp|j|j|jkrptdd|j|j|jffS|jr�|jr�|jr�|j|j|jkr�tdd|j|j|jffS|jdk	r�|j	j
|j�}|dk	rS|j|j|�s$td|j|ffS|j|j
|�sStd	|j
|ffSn|jdkr�|jdd
kr�tdd|jfS|jdkr�|j
dd
kr�tdd|j
fS|jdkr�d|_d|_
q�ntdfS(sr Check if the values in the policy make sense
        :return: True/False if the policy passes validation
        s6KSK pre-publish period (%d) exceeds rollover period %ds7KSK post-publish period (%d) exceeds rollover period %ds6ZSK pre-publish period (%d) exceeds rollover period %ds7ZSK post-publish period (%d) exceeds rollover period %ds%KSK pre/post-publish periods (%d/%d) s"combined exceed rollover period %ds%ZSK pre/post-publish periods (%d/%d) s&KSK key size %d outside valid range %ss&ZSK key size %d outside valid range %sRNROi@is$KSK key size %d not divisible by 64 sas required for DSAs$ZSK key size %d not divisible by 64 RURVRWRXRYR]N(RNRO(RNRO(RURVRWRXRY(RhRjR_tFalseRkRiRlRmR[tvalid_key_sz_per_algoR+t_Policy__verify_sizeRfRgRA(Rtkey_sz_range((s./usr/lib/python2.7/site-packages/isc/policy.pytvalidate�s�								N(RERFRwRbRcRaR_RhRiRjRlRkRmRfRgRnRoRpReRdRxR?RqRyRuRvR{(((s./usr/lib/python2.7/site-packages/isc/policy.pyRMvsD






	&			tPolicyExceptioncBseZRS((RERF(((s./usr/lib/python2.7/site-packages/isc/policy.pyR|)st
dnssec_policycBsXeZiZiZiZd!Zd!ZeZ	d!d�Z
d�Zd�Zd�Z
d�Zd�Zd�Zd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d �Z*RS("cKs�t�|_|jj|_d|kr4t|d<nd|krMt|d<ntjd||�|_|jd�t�}d|_	t
|_d|_d|_
t|�|jd<d|jd_	d|jd_d|jd_t|�|jd<d|jd_	d|jd_d|jd_t|�|jd	<d	|jd	_	d	|jd	_t|�|jd
<d
|jd
_	d
|jd
_t|�|jd<d|jd_	d|jd_t|�|jd<d|jd_	d|jd_t|�|jd
<d
|jd
_	d
|jd
_t|�|jd<d|jd_	d|jd_t|�|jd<d|jd_	d|jd_d|jd_d|jd_
t|�|jd<d|jd_	d|jd_d|jd_d|jd_
t|�|jd<d|jd_	d|jd_d|jd_d|jd_
t|�|jd<d|jd_	d|jd_d|jd_d|jd_
|r�|j|�ndS(Ntdebugtwrite_tablestmodulespolicy global { algorithm rsasha256;
                                      key-size ksk 2048;
                                      key-size zsk 2048;
                                      roll-period ksk 0;
                                      roll-period zsk 1y;
                                      pre-publish ksk 1mo;
                                      pre-publish zsk 1mo;
                                      post-publish ksk 1mo;
                                      post-publish zsk 1mo;
                                      standby ksk 0;
                                      standby zsk 0;
                                      keyttl 1h;
                                      coverage 6mo; };
                      policy default { policy global; };iRNiRORPRQRRRSRTRURVRWRXRY(RtplexRGRwtyacctparsertsetupRMR_R[RARcRfRgRt
alg_policyRZtload(RtfilenameR<tp((s./usr/lib/python2.7/site-packages/isc/policy.pyR?4s|


					cCs_||_t|_t|��2}|j�}d|jj_|jj	|�WdQXd|_dS(Ni(R�RAtinitialtopentreadR�RRR�tparseR_(RR�tfRC((s./usr/lib/python2.7/site-packages/isc/policy.pyR��s		cCs,t|_d|jj_|jj|�dS(Ni(RAR�R�RRR�R�(RRC((s./usr/lib/python2.7/site-packages/isc/policy.pyR��s	c	1Ks�|j�}d}||jkr1|j|}n|dkret|jd�}||_t|_n|jdkr�|j	p�|jd}x|r�|jr�|j	}q�W|r�|jp�d|_n|j|j
kr�|j
|j}ntd��|jdkrV|j	p|jd}x#|dk	r@|jr@|j	}qW|oM|j|_n|j
dkr�|j	px|jd}x|r�|j
r�|j	}q~W|r�|j
p�|j
|_
n|jdkr|j	p�|jd}x |j	r|jr|j	}q�W|r|jp|j|_n|jdkr�|j	pA|jd}x |j	rf|jrf|j	}qGW|rv|jp||j|_n|jdkr�|j	p�|jd}x |j	r�|jr�|j	}q�W|r�|jp�|j|_n|jdkrQ|j	p
|jd}x |j	r2|jr2|j	}qW|rB|jpH|j|_n|jdkr�|j	ps|jd}x |j	r�|jr�|j	}qyW|r�|jp�|j|_n|jdkr|j	p�|jd}x |j	r�|jr�|j	}q�W|r|jp|j|_n|jdkr�|j	p?|jd}x |j	rd|jrd|j	}qEW|rt|jpz|j|_n|jdkr�|j	p�|jd}x |j	r�|jr�|j	}q�W|r�|jp�|j|_n|jdkrI|j	p|jd}x#|dk	r3|jr3|j	}qW|o@|j|_nd|ks`|dr�|j�\}}|s�t|��dSn|S(Ntdefaultsalgorithm not foundt
novalidate(R%R_tzone_policyRtnamed_policyRZRARaR[R\R�R|RdReRfRgRhRiRjRlRkRmRpR{(	RtzoneR<tzR�R\taptvalidtmsg((s./usr/lib/python2.7/site-packages/isc/policy.pytpolicy�s�	











cCsdS(sBpolicylist : init policy
                      | policylist policyN((RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_policylist
scCs
t|_dS(sinit :N(RwR�(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_initscCsdS(sTpolicy : alg_policy
                  | zone_policy
                  | named_policyN((RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_policyscCs|d|d<dS(sAname : STR
                | KEYTYPE
                | DATESUFFIXiiN((RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_namescCs=|dj�|d<tjd|d�s9td��ndS(scdomain : STR
                  | QSTRING
                  | KEYTYPE
                  | DATESUFFIXiis^[\w.-][\w.-]*$sinvalid domainN(tstripR"R#R|(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_domain scCst�|_dS(snew_policy :N(RMtcurrent(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_new_policy*scCs4|d|j_t|j_|j|j|d<dS(sFalg_policy : ALGORITHM_POLICY ALGNAME new_policy alg_option_group SEMIiN(R�RZRARcR�(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_alg_policy.scCsL|djd�|j_t|j_|j|j|djd�j�<dS(s=zone_policy : ZONE domain new_policy policy_option_group SEMIit.N(trstripR�RZRARbR�R%(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pyt
p_zone_policy5s#cCs.|d|j_|j|j|dj�<dS(s>named_policy : POLICY name new_policy policy_option_group SEMIiN(R�RZR�R%(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_named_policy<scCs|d|d<dS(sduration : NUMBERiiN((RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_duration_1BscCsd|d<dS(sduration : NONEiN(R_(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_duration_2Gs
cCs|ddkr%|dd|d<n�|ddkrJ|dd|d<n�|ddkro|dd	|d<n�|dd
kr�|dd|d<nw|ddkr�|dd
|d<nR|ddkr�|dd|d<n-|ddkr�|d|d<ntd��dS(sduration : NUMBER DATESUFFIXityii�3�itmoi�'twi�:	tdi�Qthitmii<tssinvalid durationN(R|(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_duration_3LscCsdS(s6policy_option_group : LBRACE policy_option_list RBRACEN((RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_policy_option_group_scCsdS(smpolicy_option_list : policy_option SEMI
                              | policy_option_list policy_option SEMIN((RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_policy_option_listcscCsdS(s�policy_option : parent_option
                         | directory_option
                         | coverage_option
                         | rollperiod_option
                         | prepublish_option
                         | postpublish_option
                         | keysize_option
                         | algorithm_option
                         | keyttl_option
                         | standby_optionN((RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_policy_optionhscCsdS(s0alg_option_group : LBRACE alg_option_list RBRACEN((RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_alg_option_groupuscCsdS(s^alg_option_list : alg_option SEMI
                           | alg_option_list alg_option SEMIN((RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_alg_option_listyscCsdS(salg_option : coverage_option
                      | rollperiod_option
                      | prepublish_option
                      | postpublish_option
                      | keyttl_option
                      | keysize_option
                      | standby_optionN((RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_alg_option~scCs!|j|dj�|j_dS(sparent_option : POLICY nameiN(R�R%R�R\(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_parent_option�scCs|d|j_dS(s$directory_option : DIRECTORY QSTRINGiN(R�Rd(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_directory_option�scCs|d|j_dS(s#coverage_option : COVERAGE durationiN(R�Re(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_coverage_option�scCs7|ddkr#|d|j_n|d|j_dS(s0rollperiod_option : ROLL_PERIOD KEYTYPE durationitKSKiN(R�RhRi(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_rollperiod_option�scCs7|ddkr#|d|j_n|d|j_dS(s0prepublish_option : PRE_PUBLISH KEYTYPE durationiR�iN(R�RjRl(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_prepublish_option�scCs7|ddkr#|d|j_n|d|j_dS(s2postpublish_option : POST_PUBLISH KEYTYPE durationiR�iN(R�RkRm(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_postpublish_option�scCs7|ddkr#|d|j_n|d|j_dS(s(keysize_option : KEY_SIZE KEYTYPE NUMBERiR�iN(R�RfRg(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_keysize_option�scCs7|ddkr#|d|j_n|d|j_dS(s'standby_option : STANDBY KEYTYPE NUMBERiR�iN(R�RnRo(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_standby_option�scCs|d|j_dS(skeyttl_option : KEYTTL durationiN(R�Rp(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_keyttl_option�scCs|d|j_dS(s$algorithm_option : ALGORITHM ALGNAMEiN(R�R[(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_algorithm_option�scCs�|r<d|jpd|jr$dnd|j|jfGHnL|js�td|jpWd|jrfdnd|rx|jp{df��ndS(Ns%s%s%d:syntax error near '%s'R]t:s%s%s%d:unexpected end of inputi(R�RRR�R|(RR�((s./usr/lib/python2.7/site-packages/isc/policy.pytp_error�s	N(+RERFR�R�R�R_R�R�RAR�R?R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((s./usr/lib/python2.7/site-packages/isc/policy.pyR},sN_	
		h					
										
			
										t__main__iR;iR~R�RR�snonexistent.zonei(R"tply.lexR;tply.yaccR�tstringRRRMt	ExceptionR|R}REtsystargvR�tfileR�RCtcloseR�RDRAtppR�R�tetargs(((s./usr/lib/python2.7/site-packages/isc/policy.pyt<module>s0
`���


Zerion Mini Shell 1.0