Ñò pØcJc @sídZddkZddkZddkZddkZddkZeZeZyddk Z e ZWn?e j o3yddk Z e ZWq¦e j oq¦XnXdZ dZdZd„Zd„Zd„Zd efd „ƒYZdS( sP Functions for communicating with Pageant, the basic windows ssh agent program. iÿÿÿÿNlºPœi iJcCs`to7ytiddƒ}|SWq\tij oq\XntotiiiddƒSdS(NtPageant( t _has_win32alltwin32guit FindWindowterrort _has_ctypestctypestwindlltuser32t FindWindowAtNone(thwnd((s8/usr/lib/python2.6/site-packages/paramiko/win_pageant.pyt_get_pageant_window_object5s cCs!tptotƒotStS(s Check to see if there is a "Pageant" agent we can talk to. This checks both if we have the required libraries (win32all or ctypes) and if there is a Pageant currently running. (RRR tTruetFalse(((s8/usr/lib/python2.6/site-packages/paramiko/win_pageant.pytcan_talk_to_agentBscCsÅtƒ}|pdStidƒ}tii|ƒ}t|dƒ}|i|ƒ|idt t |ƒƒt i |i ƒt d|dt i ƒ}ztid|dƒ}|iƒ\}}tidt||ƒ} to"ti|tt | ƒ| ƒ} nTtoFtid| ƒ} | iƒ\} } tiii|t| | ƒ} nd } | d jo7|id ƒ}tid |ƒd }||i|ƒSdSWd|iƒ|iƒti|ƒXdS( Ns.pagsw+btttagnametaccesstctLLPtBiis>I( R R ttempfiletmktemptostpathtbasenametopentwritet_AGENT_MAX_MSGLENtlentmmaptfilenot ACCESS_WRITEtarrayt buffer_infotstructtpackt_AGENT_COPYDATA_IDRRt SendMessagetwin32con_WM_COPYDATARRRRt SendMessageAtreadtunpacktclosetunlink(tmsgR tfilenamet map_filenametftpymapt char_buffertchar_buffer_addresstchar_buffer_sizetcdstresponset_buft_addrt_sizetdatalentretlen((s8/usr/lib/python2.6/site-packages/paramiko/win_pageant.pyt_query_pageantNs8  '""   tPageantConnectioncBs2eZdZd„Zd„Zd„Zd„ZRS(s Mock "connection" to an agent which roughly approximates the behavior of a unix local-domain socket (as used by Agent). Requests are sent to the pageant daemon via special Windows magick, and responses are buffered back for subsequent reads. cCs d|_dS(N(R t _response(tself((s8/usr/lib/python2.6/site-packages/paramiko/win_pageant.pyt__init__„scCst|ƒ|_dS(N(R=R?(R@tdata((s8/usr/lib/python2.6/site-packages/paramiko/win_pageant.pytsend‡scCsS|idjodS|i| }|i||_|idjo d|_n|S(Nt(R?R (R@tntret((s8/usr/lib/python2.6/site-packages/paramiko/win_pageant.pytrecvŠs  cCsdS(N((R@((s8/usr/lib/python2.6/site-packages/paramiko/win_pageant.pyR,“s(t__name__t __module__t__doc__RARCRGR,(((s8/usr/lib/python2.6/site-packages/paramiko/win_pageant.pyR>|s    (RJRR$RRR"RRRRR t ImportErrorRR&RR(R RR=tobjectR>(((s8/usr/lib/python2.6/site-packages/paramiko/win_pageant.pyts.           .