/usr/share/crypto-policies/python/cryptopolicies/__pycache__
Edit: /usr/share/crypto-policies/python/cryptopolicies/__pycache__/cryptopolicies.cpython-39.pyc (17396B)
a
ԏiJ @ s4 d dl Z d dlZd dlZd dlZd dlZd dlZddlmZmZ e
dd ddiB Zddd Zd
Z
dZdd
hh dh dddhh dh dh dh dh dh dddhdZG dd dZG dd dejZdd Ze d!d"Zd#d$ Zd2d&d'ZG d(d) d)eZd*d+ ZG d,d- d-Zd.d/ ZG d0d1 d1ZdS )3 N ) alg_lists
validation)Zarbitrary_dh_groupsZmin_dh_sizeZmin_dsa_sizeZmin_rsa_sizeZ
sha1_in_certsZ ssh_certsZmin_ec_size )ANYZDISABLE_ETMZDISABLE_NON_ETM)ZDEFAULTZENFORCEZRELAX)ZetmZ__ems*)tlssslopensslnssgnutlsjava-tlssshopensshopenssh-serveropenssh-clientlibsshipsecike libreswankerberoskrb5dnssecbindrpmrpm-sequoiar 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 r r r r r r
r c @ s( e Zd ZefddZdd Zdd ZdS )
ScopeSelectorc C s | | _}|d | _| jr&|n
|dd }tjj|| jd tjj|| jd |drr|dd dn|g| _ tjj
| j t| jd dS )a=
Initialize a scope selector.
An example would be `ssh` in `ciphers@ssh = -NULL`.
When openssh backend will request the configuration,
it'll offer (`{'ssh', 'openssh'}`) as scopes
and the rule above will be taken into account.
Both patterns and scopes are cast to lowercase.
For more examples, refer to tests/unit/parsing/test_scope_selector.py
>>> ss = ScopeSelector('!{SSH,IPsec}')
>>> ss.matches({'ipsec', 'libreswan'})
False
>>> ss.matches({'tls', 'openssl'})
True
!r N)Zoriginal_pattern{,)lowerpattern
startswith _positiver scopeZillegal_charactersZcurly_bracketssplit_globsZresulting_globs
ALL_SCOPES)selfr" p r+ B/usr/share/crypto-policies/python/cryptopolicies/cryptopolicies.py__init__A s $zScopeSelector.__init__c C s d| j dS )Nz
)r" r) r+ r+ r, __str__\ s zScopeSelector.__str__c sh | j tkrdS dd D tdd D s2J | jrPt fdd| jD S t fdd| jD S )aE
Checks whether ScopeSelector matches one of the scopes.
For more examples, refer to tests/unit/parsing/test_scope_selector.py
>>> ScopeSelector('{SSH,IPsec}').matches({'ipsec', 'libreswan'})
True
>>> ScopeSelector('!{SSH,IPsec}').matches({'ipsec', 'libreswan'})
False
Tc S s g | ]}| qS r+ )r! .0sr+ r+ r,
j z)ScopeSelector.matches..c s s | ]}|t v V qd S N)r( r1 r+ r+ r, k r5 z(ScopeSelector.matches..c 3 s | ]}t |V qd S r6 fnmatchfilterr2 gscopesr+ r, r7 m r5 c 3 s | ]}t | V qd S r6 r8 r; r= r+ r, r7 n r5 )r" SCOPE_ANYallr$ anyr' r) r> r+ r= r, matches_ s
zScopeSelector.matchesN)__name__
__module____qualname__r? r- r0 rC r+ r+ r+ r, r @ s r c @ s0 e Zd ZdZdZdZdZdZdZdZ dd Z
d
S ) OperationzCAn operation that comes with the right-hand value of the directive.r c C s d| j S )Nz
Operation.)namer/ r+ r+ r, __repr__} s zOperation.__repr__N)rD rE rF __doc__RESETPREPENDAPPENDOMITSET_INTSET_ENUMrN r+ r+ r+ r, rG s s rG c s dd | rxtjvr2tv r2tjt| fgS tjv sDtv rPtj
tjvs^J tvsjJ tvsJ nHtv rtj tv r| t vrtj | t tj
| fgS | }t fdd|D sfdd|D }tjdfgdd |D S t fd d|D rg }|D ]}|d
rbtjt|dd ddd }n\|d
rtjt|dd ddd }n*|d
sJ tjt|dd }|fdd|D q,|S tj | dS )ae
Parses right-hand parts of the directives
into lists of operation/value pairs.
For more examples, refer to tests/unit/test_parsing.py
>>> parse_rhs('', 'cipher')
[(Operation.RESET, None)]
>>> parse_rhs('IDEA-CBC SEED-CBC', 'cipher')
[(Operation.RESET, None),
(Operation.APPEND, 'IDEA-CBC'),
(Operation.APPEND, 'SEED-CBC')]
>>> # 3DES-CBC gets prepended last for higher prio
>>> parse_rhs('+*DES-CBC', 'cipher')
[(Operation.PREPEND, 'DES-CBC'),
(Operation.PREPEND, '3DES-CBC')]
>>> parse_rhs('ENFORCE', '__ems')
[(Operation.SET_ENUM, 'ENFORCE')]
c S s | dp| dS )N)+-rV )r# endswith)vr+ r+ r, differential s zparse_rhs..differentialc 3 s | ]} |V qd S r6 r+ r2 rY rZ r+ r, r7 r5 zparse_rhs..c s" g | ]}t | D ]}|qqS r+ )r glob)r2 rY x prop_namer+ r, r4 r5 zparse_rhs..Nc S s g | ]}t j|fqS r+ )rG rR r[ r+ r+ r, r4 r5 c 3 s | ]} |V qd S r6 r+ r[ r\ r+ r, r7 r5 rV r r rW c s g | ]} |fqS r+ r+ r[ )opr+ r, r4 r5 )isdigitr ALLINT_DEFAULTSrG rT intENUMSr rulesZNonIntPropertyIntValueErrorZIntPropertyNonIntValueErrorZBadEnumValueErrorrU r&