Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
°‹EYc@sddlZddlZddlmZddlmZddlmZddlm	Z	m
Z
mZmZddl
mZddlmZddlmZmZdd	lmZdd
lmZddlmZdefd
„ƒYZdefd„ƒYZdfd„ƒYZdS(iÿÿÿÿN(tMutableMapping(tsha1(tHMAC(tbtutencodebytestdecodebytes(tDSSKey(tRSAKey(t
get_loggertconstant_time_bytes_eq(tECDSAKey(t
Ed25519Key(tSSHExceptiontHostKeyscBsªeZdZdd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd	„Zd
„Z
d„Zd„Zd
„Zd„Zd„Zedd„ƒZRS(sZ
    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
    cCs)g|_|dk	r%|j|ƒndS(s¿
        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(t_entriestNonetload(tselftfilename((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyt__init__1s	cCsexB|jD]7}||jkr
|jjƒ|kr
||_dSq
W|jjt|g|ƒƒdS(s.
        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(Rt	hostnamestkeytget_nametappendtHostKeyEntry(RthostnametkeytypeRte((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pytadd=s
	$	cCst|dƒû}xñt|dƒD]à\}}|jƒ}t|ƒdks"|ddkrbq"nytj||ƒ}Wntk
rŽq"nX|dk	r"|j}x6|D].}|j	||j
ƒr«|jj|ƒq«q«Wt|jƒr|jj
|ƒqq"q"WWdQXdS(s]
        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
        triit#N(topent	enumeratetstriptlenRt	from_lineR
RRtcheckRtremoveRR(RRtftlinenotlineRt
_hostnamesth((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyRLs "
	
cCsRt|dƒ=}x3|jD](}|jƒ}|r|j|ƒqqWWdQXdS(sç
        Save host keys into a file, in the format used by OpenSSH.  The order
        of keys in the file will be preserved when possible (if these keys were
        loaded from a file originally).  The single exception is that combined
        lines will be split into individual key lines, which is arguably a bug.

        :param str filename: name of the file to write

        :raises: ``IOError`` -- if there was an error writing the file

        .. versionadded:: 1.6.1
        twN(R Rtto_linetwrite(RRR'RR)((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pytsavels

cs~dtf‡fd†ƒY}g}x3|jD](}|jˆ|ƒr,|j|ƒq,q,Wt|ƒdkrndS|ˆ||ƒS(s’
        Find a hostkey entry for a given hostname or IP.  If no entry is found,
        ``None`` is returned.  Otherwise a dictionary of keytype to key is
        returned.  The keytype will be either ``"ssh-rsa"`` or ``"ssh-dss"``.

        :param str hostname: the hostname (or IP) to lookup
        :return: dict of `str` -> `.PKey` keys associated with this host
            (or ``None``)
        tSubDictcsMeZd„Zd„Zd„Zd„Zd„Z‡fd†Zd„ZRS(cSs||_||_||_dS(N(t	_hostnameRt	_hostkeys(RRtentriesthostkeys((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyRŠs		css x|jƒD]}|Vq
WdS(N(tkeys(Rtk((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyt__iter__scSst|jƒƒS(N(R#R5(R((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyt__len__“scSsRxKt|jƒD].}|jjƒ|kr|jj|ƒqqWt|ƒ‚dS(N(tlistRRRR&tKeyError(RRR((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyt__delitem__–scSs@x-|jD]"}|jjƒ|kr
|jSq
Wt|ƒ‚dS(N(RRRR:(RRR((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyt__getitem__scs„x}|jD]=}|jdkr%q
n|jjƒ|kr
||_Pq
q
Wtˆg|ƒ}|jj|ƒ|jjj|ƒdS(N(RRRRRRR2(RRtvalR(R(sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyt__setitem__£s	cSs2g|jD]$}|jdk	r
|jjƒ^q
S(N(RRRR(RR((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR5±s(	t__name__t
__module__RR7R8R;R<R>R5((R(sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR0‰s					iN(RRt_hostname_matchesRR#R(RRR0R3R((RsF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pytlookups
.cCsbx[|jD]P}||ksV|jdƒr
|jdƒr
t|j||ƒ|ƒr
tSq
WtS(sl
        Tests whether ``hostname`` string matches given SubDict ``entry``.

        :returns bool:
        s|1|(Rt
startswithR
t	hash_hosttTruetFalse(RRtentryR+((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyRA¿scCs]|j|ƒ}|dkrtS|j|jƒdƒ}|dkrGtS|jƒ|jƒkS(s=
        Return True if the given key is associated with the given hostname
        in this dictionary.

        :param str hostname: hostname (or IP) of the SSH server
        :param .PKey key: the key to check
        :return:
            ``True`` if the key is associated with the hostname; else ``False``
        N(RBRRFtgetRtasbytes(RRRR6thost_key((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR%Ïs
cCs
g|_dS(s;
        Remove all host keys from the dictionary.
        N(R(R((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pytclearásccs x|jƒD]}|Vq
WdS(N(R5(RR6((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR7çscCst|jƒƒS(N(R#R5(R((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR8ëscCs.|j|ƒ}|dkr*t|ƒ‚n|S(N(RBRR:(RRtret((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR<îscCsqd}x9t|jƒD](\}}|j||ƒr|}PqqW|dkr]t|ƒ‚n|jj|ƒdS(N(RR!RRAR:tpop(RRtindextiRG((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR;ôscCsÊt|ƒdkr2|jjt|gdƒƒdSx‘|jƒD]ƒ}t}xK|jD]@}||jkrU|jj	ƒ|krU|||_t
}qUqUW|s?|jjt|g||ƒƒq?q?WdS(Ni(R#RRRRR5RFRRRRE(RRRGtkey_typetfoundR((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR>þs$

cCsNg}xA|jD]6}x-|jD]"}||kr |j|ƒq q WqW|S(N(RRR(RRLRR+((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR5
scCs7g}x*|jƒD]}|j|j|ƒƒqW|S(N(R5RRB(RRLR6((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pytvaluesscCsÏ|dkr$tjtƒjƒ}n7|jdƒrI|jdƒd}ntt|ƒƒ}t	|ƒtƒjksyt
‚t|t|ƒtƒjƒ}dt
t|ƒƒt
t|ƒƒf}|jddƒS(sM
        Return a "hashed" form of the hostname, as used by OpenSSH when storing
        hashed hostnames in the known_hosts file.

        :param str hostname: the hostname to hash
        :param str salt: optional salt to use when hashing
            (must be 20 bytes long)
        :return: the hashed hostname as a `str`
        s|1|t|is|1|%s|%ss
tN(RtosturandomRtdigest_sizeRCtsplitRRR#tAssertionErrorRtdigestRRtreplace(Rtsaltthmacthostkey((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyRDs(N(R?R@t__doc__RRRRR/RBRAR%RKR7R8R<R;R>R5RRtstaticmethodRD(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR%s$
		 		@							
				tInvalidHostKeycBseZd„ZRS(cCs%||_||_||f|_dS(N(R)texctargs(RR)Rb((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR4s		(R?R@R(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyRa3sRcBsAeZdZddd„Zedd„ƒZd„Zd„ZRS(sJ
    Representation of a line in an OpenSSH-style "known hosts" file.
    cCs1|dk	o|dk	|_||_||_dS(N(RtvalidRR(RRR((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR?s	c	Csitdƒ}|jdƒ}t|ƒdkrH|jd||fƒdS|d }|\}}}|jdƒ}yÄt|ƒ}|dkr£tdt|ƒƒ}n|dkrÇtdt|ƒƒ}nl|t	j
ƒkr÷t	dt|ƒd	tƒ}n<|d
krtdt|ƒƒ}n|jd|fƒdSWn%t
jk
r[}t||ƒ‚nX|||ƒS(
så
        Parses the given line of text to find the names for the host,
        the type of key, and the key data. The line is expected to be in the
        format used by the OpenSSH known_hosts file.

        Lines are expected to not have leading or trailing whitespace.
        We don't bother to check for comments or empty lines.  All of
        that should be taken care of before sending the line to us.

        :param str line: a line from an OpenSSH known_hosts file
        sparamiko.hostkeyst is6Not enough fields found in known_hosts in line %s (%r)t,sssh-rsatdatasssh-dsstvalidate_pointsssh-ed25519sUnable to handle key of type %sN(R	RXR#tinfoRRRRRRt supported_key_format_identifiersRFRtbinasciitErrorRa(	tclsR)R(tlogtfieldstnamesRRR((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR$Ds0
	
cCs<|jr8ddj|jƒ|jjƒ|jjƒfSdS(s¦
        Returns a string in OpenSSH known_hosts file format, or None if
        the object is not in a valid state.  A trailing newline is
        included.
        s	%s %s %s
RfN(RdtjoinRRRt
get_base64R(R((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR-rs	cCsd|j|jfS(Ns<HostKeyEntry %r: %r>(RR(R((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyt__repr__sN(	R?R@R_RRtclassmethodR$R-Rs(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyR:s-	
(RkRUtcollectionsRthashlibRR]Rtparamiko.py3compatRRRRtparamiko.dsskeyRtparamiko.rsakeyRt
paramiko.utilR	R
tparamiko.ecdsakeyRtparamiko.ed25519keyRtparamiko.ssh_exceptionR
Rt	ExceptionRaR(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/hostkeys.pyt<module>s"ÿ