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@sÛdZddlmZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZm
Z
ddlmZmZmZmZmZddlmZed„ZerÐendZerâe
nd	Zed
„Zdd„Zd
„Zd„Zd„Zd„Z d„Z!d„Z"d„Z#d„Z$d„Z%ia&da'ej(ƒa)d„Z*e
d„Z+de,fd„ƒYZ-e-ƒZ.d„Z/d„Z0d„Z1de,fd„ƒYZ2d„Z3dS( s0
Useful functions used by the rest of paramiko.
iÿÿÿÿ(t
generatorsN(tDEBUGt	zero_bytet	xfffffffftmax_byte(tPY2tlongtbyte_chrtbyte_ordtb(t	SSHConfigc
Cstdƒ}d}|rJt|ƒdkrJt|dƒdkrJd}nt|ƒdrŽt}|rot}n|dt|ƒd|}nxItdt|ƒdƒD]/}|d>tjd|||d!ƒd}q§W|r|tdƒdt|ƒ>8}n|S(sTturns a normalized byte string into a long-int
    (adapted from Crypto.Util.number)ii€iii s>Ii(RtlenRRRtrangetstructtunpack(tstalways_positivetouttnegativetfillerti((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytinflate_long%s/		-!iiÿcCsItƒ}t|ƒ}x@|dkrW|dkrWtjd|t@ƒ|}|dL}qWxut|ƒD]F}|dkr‹|dtkr‹Pn|dkre|dtkrePqeqeWd}|dkrÊt}nt	}||d}|rE|dkrt
|dƒdkrt|}n|dkrEt
|dƒdkrEt	|}qEn|S(sTturns a long-int into a normalized byte string
    (adapted from Crypto.Util.number)iiÿÿÿÿs>Ii ii€(i(tbytesRR
tpackRt	enumeratetdeflate_zerot
deflate_ffRRR(tntadd_sign_paddingRR((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytdeflate_long>s*		"
"tcCs˜d}g}xBt|ƒ|dkrP|jt|||d!ƒƒ|d7}qW|t|ƒkr}|jt||ƒƒng|D]}||^q„S(Nii(Rtappendtformat_binary_line(tdatatprefixtxRtline((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pyt
format_binary]scCsrdjg|D]}dt|ƒ^q
ƒ}djg|D]"}d|t|ƒdd^q9ƒ}d||fS(Nt s%02XRs.%c..i?i_s%-50s %s(tjoinR(R!tctlefttright((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pyR hs,8cCsptdƒ}x]|D]U}t|ƒ}d|ko<dknrT|t|ƒ7}q|td|ƒ7}qW|S(NRi is%%%02X(R	RR(RRR(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytsafe_stringns
cCs‹y|jƒSWnvtk
r†t|tƒ}t|dƒ}|dkrMdSt|ƒd}x"|d@s|dK}|d8}q`W|SXdS(Niiii€(t
bit_lengthtAttributeErrorRtFalseRR(Rtnormthbytetbitlen((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pyR,ys


cCs%djtjtjƒŒƒjdƒS(NRs
(R't	tracebacktformat_exceptiontsystexc_infotsplit(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pyt
tb_stringsˆscCsÌtƒ}tƒ}t|ƒdkr1|d }nx”|dkrÇ|ƒ}t|ƒdkrk|j|ƒn|jt|ƒƒ|j|ƒ|jƒ}t|t|ƒƒ}||| 7}||8}q4W|S(s
    Given a password, passphrase, or other human-source key, scramble it
    through a secure hash into some keyworthy bytes.  This specific algorithm
    is used for encrypting/decrypting private key files.

    :param function hash_alg: A function which creates a new hash object, such
        as ``hashlib.sha256``.
    :param salt: data to salt the hash with.
    :type salt: byte string
    :param str key: human-entered password or passphrase.
    :param int nbytes: number of bytes to generate.
    :return: Key data `str`
    ii(RRtupdateR	tdigesttmin(thash_algtsalttkeytnbytestkeydataR9thash_objtsize((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytgenerate_key_bytesŒs		
	
cCsddlm}||ƒS(sŽ
    Read a file of known SSH host keys, in the format used by openssh, and
    return a compound dict of ``hostname -> keytype ->`` `PKey
    <paramiko.pkey.PKey>`. The hostname may be an IP address or DNS name.  The
    keytype will be either ``"ssh-rsa"`` or ``"ssh-dss"``.

    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")``.

    Since 1.5.3, this is just a wrapper around `.HostKeys`.

    :param str filename: name of the file to read host keys from
    :return:
        nested dict of `.PKey` objects, indexed by hostname and then keytype
    iÿÿÿÿ(tHostKeys(tparamiko.hostkeysRC(tfilenameRC((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytload_host_keys«scCstƒ}|j|ƒ|S(sM
    Provided only as a backward-compatible wrapper around `.SSHConfig`.
    (R
tparse(tfile_objtconfig((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytparse_ssh_config¿s	
cCs
|j|ƒS(sM
    Provided only as a backward-compatible wrapper around `.SSHConfig`.
    (tlookup(thostnameRI((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytlookup_ssh_host_configÈsc	Cs¡dd|}}}dd|}}}xY|dkrƒ||}||||}}||||}}||||}}q+W|dkr||7}n|S(Nii((	R#tmtu1tu2tu3tv1tv2tv3tq((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytmod_inverseÏs

cCskttjƒƒ}yt|SWnFtk
rftjƒztd7at}t|<WdtjƒX|SXdS(Ni(	tidt	threadingt
currentThreadt
_g_thread_idstKeyErrort_g_thread_locktacquiret_g_thread_countertrelease(ttidtret((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pyt
get_thread_idãs


cCsƒtjdƒ}t|jƒdkr(dS|j|ƒt|dƒ}tj|ƒ}d}|jtj|dƒƒ|j	|ƒdS(sKsend paramiko logs to a logfile,
    if they're not already going somewheretparamikoiNtasT%(levelname)-.3s [%(asctime)s.%(msecs)03d] thr=%(_threadid)-3d %(name)s: %(message)ss%Y%m%d-%H:%M:%S(
tloggingt	getLoggerRthandlerstsetLeveltopent
StreamHandlertsetFormattert	Formattert
addHandler(REtleveltltftlhtfrm((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytlog_to_fileòs
tPFiltercBseZd„ZRS(cCstƒ|_tS(N(Rbt	_threadidtTrue(tselftrecord((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytfilters(t__name__t
__module__Ry(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pyRtscCs tj|ƒ}|jtƒ|S(N(ReRft	addFiltert_pfilter(tnameRo((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pyt
get_logger
s
cCsJxCtrEy|ƒSWqtk
rA}|jtjkrB‚qBqXqWdS(s6Retries function until it doesn't raise an EINTR errorN(RvtEnvironmentErrorterrnotEINTR(tfunctionte((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytretry_on_signals	cCswt|ƒt|ƒkrtSd}xHtr1tntt|ƒƒD](}|t||ƒt||ƒAO}qAW|dkS(Ni(RR.RtxrangeRR(RdR	tresR((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytconstant_time_bytes_eqs%&tClosingContextManagercBseZd„Zd„ZRS(cCs|S(N((Rw((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pyt	__enter__%scCs|jƒdS(N(tclose(RwttypetvalueR2((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pyt__exit__(s(RzR{RŠRŽ(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pyR‰$s	cCst|t||ƒƒS(N(tmaxR:(tminimumtvaltmaximum((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pytclamp_value,s(4t__doc__t
__future__RRR4R
R2RXRetparamiko.commonRRRRtparamiko.py3compatRRRRR	tparamiko.configR
R.RRRRvRR%R R+R,R7RBRFRJRMRVRZR^tLockR\RbRstobjectRtR}RR…RˆR‰R“(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/util.pyt<module>sH"(