File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/ssh.cpython-310.pyc
o
�N�g�� � @ s d Z ddlZddlZddlZddlZddlZddlZddlZddlZ ddl
Z ddlZ ddlZ ddl
Z ddlZ ddlmZmZ e�e�ZdZdd� Zdd� Zd d
� Zdd� Zd
d� Z dEdd�Zdd� Zdd� ZdFdd�ZdGdd�ZdHdd�Z dId d!�Z! dJd"d#�Z" dId$d%�Z#dKd&d'�Z$ dId(d)�Z% dLd*d+�Z&d,d-� Z'dMd.d/�Z(e j)j*j+�,d0� dNd1d2��Z-e j)j*j+�,d3� 4 dOd5d6��Z. dPd7d8�Z/dQd9d:�Z0 4 dRd;d<�Z1dNd=d>�Z2e j)j*j+�,d0�dFd?d@��Z3efdAdB�Z4dCdD� Z5dS )Sz�
Manage client ssh components
.. note::
This module requires the use of MD5 hashing. Certain security audits may
not permit the use of MD5. For those cases, this module should be disabled
or removed.
� N)�CommandExecutionError�SaltInvocationError� c C s t jj�d�s dS dS )NZssh)Fz#The module requires the ssh binary.T)�salt�utils�path�which� r r �D/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/ssh.py�__virtual__ s r c C s� g d�}g d�}g d�}ddg}g d�}| |v rdS | |v r dS | |v r,| d v r*d
S | S | |v r2dS | |v r8| S t d| � d���)
z�
Return the properly formatted ssh value for the authorized encryption key
type. ecdsa defaults to 256 bits, must give full ecdsa enc schema string
if using higher enc. If the type is not found, raise CommandExecutionError.
)�r�rsa�ssh-rsa)�dZdsa�dss�ssh-dss)�e�ecdsazecdsa-sha2-nistp521zecdsa-sha2-nistp384�ecdsa-sha2-nistp256�ed25519zssh-ed25519)
zrsa-sha2-512zrsa-sha2-256z!rsa-sha2-512-cert-v01@openssh.comz!rsa-sha2-256-cert-v01@openssh.comzssh-rsa-cert-v01@openssh.comz(ecdsa-sha2-nistp256-cert-v01@openssh.comz(ecdsa-sha2-nistp384-cert-v01@openssh.comz(ecdsa-sha2-nistp521-cert-v01@openssh.comz"sk-ecdsa-sha2-nistp256@openssh.comz+sk-ecdsa-sha2-nistp256-cert-v01@openssh.comz ssh-ed25519-cert-v01@openssh.comzsk-ssh-ed25519@openssh.comz#sk-ssh-ed25519-cert-v01@openssh.comr r )r r r zIncorrect encryption key type 'z'.)r )�encr
r r r Zalso_allowedr r r
�_refine_enc&