U
    
W[1                     @   sF   d dl mZmZ d dlmZ d dlmZ d dlZG dd dejZ	dS )    )SSHClientTransport
SSHCiphers)usage)unicodeNc                   @   s@  e Zd Zddddgdddgdddgd	d
dgddddgddddgdddgddddgddddgddddgg
Zdddgdddgdd d!gd"d#d$gd%d&d'gd(d)d*gd+d,d-ggZejd.ge eje	j
 d/d0eje	j d1d0ejejd2d0d3e ejd4d0ejd5d6d7gd8Zd9d: Zd;d< Zd=d> Zd?d@ ZdAdB ZdCdD ZdS )EConchOptionsuserlNzLog in using this user name.ZidentityicipherscmacsmZportpz7Connect to this port.  Server must be on the same port.ZoptionozIgnored OpenSSH optionshost-key-algorithms zknown-hostszFile to check for host keysuser-authenticationsz%Types of user authentications to use.ZlogfilezFile to log to, or - for stdoutversionVzDisplay version number only.compressCzEnable compression.logvz#Enable logging (defaults to stderr)Znox11xz+Disable X11 connection forwarding (default)agentAz&Enable authentication agent forwardingnoagentaz1Disable authentication agent forwarding (default)Z	reconnectrz2Reconnect to the server if the connection is lost.)r   r   zciphers to choose from)descrzmacs to choose fromz"host key algorithms to choose from)r   r
   r   r   ZcommandZargumentT)r   repeat)ZmutuallyExclusiveZ
optActionsZextraActionsc                 O   s$   t jj| f|| g | _d | _d S )N)r   Options__init__	identitysZconns)selfargskw r'   >/usr/lib/python3/dist-packages/twisted/conch/client/options.pyr"   8   s    zConchOptions.__init__c                 C   s   | j | dS )z&Identity for public-key authenticationN)r#   append)r$   r	   r'   r'   r(   opt_identity=   s    zConchOptions.opt_identityc                 C   s8   | d}|D ]}|tjkrtd|  q|| d< dS )zSelect encryption algorithms,zUnknown cipher type '%s'r
   N)splitr   	cipherMapsysexit)r$   r
   Zcipherr'   r'   r(   opt_ciphersA   s
    

zConchOptions.opt_ciphersc                 C   sL   t |tr|d}|d}|D ]}|tjkr"td|  q"|| d< dS )zSpecify MAC algorithmsutf-8   ,zUnknown mac type '%r'r   N)
isinstancer   encoder,   r   macMapr.   r/   )r$   r   Zmacr'   r'   r(   opt_macsJ   s    



zConchOptions.opt_macsc                 C   sL   t |tr|d}|d}|D ]}|tjkr"td|  q"|| d< dS )zSelect host key algorithmsr1   r2   zUnknown host key type '%r'r   N)r3   r   r4   r,   r   supportedPublicKeysr.   r/   )r$   ZhkasZhkar'   r'   r(   opt_host_key_algorithmsT   s    



z$ConchOptions.opt_host_key_algorithmsc                 C   s&   t |tr|d}|d| d< dS )z/Choose how to authenticate to the remote serverr1   r2   r   N)r3   r   r4   r,   )r$   Zuasr'   r'   r(   opt_user_authentications^   s    

z%ConchOptions.opt_user_authentications)__name__
__module____qualname__ZoptParametersZoptFlagsr   ZCompletionsZCompleteUsernamesZCompleteMultiListr   r-   keysr5   r   r7   ZCompleteUserAtHostZ	CompleterZcompDatar"   r*   r0   r6   r8   r9   r'   r'   r'   r(   r      s`   





	
	

r   )
Ztwisted.conch.ssh.transportr   r   Ztwisted.pythonr   Ztwisted.python.compatr   r.   r!   r   r'   r'   r'   r(   <module>   s   