ssh agent support

John Arbash Meinel john at arbash-meinel.com
Thu Dec 8 21:36:16 GMT 2005


Robey Pointer wrote:
> 

...

>> Can you post a location where to find the sources in case I want to come
>> back and look at it?
> 
> I forgot who sent it to me originally -- whoever it was, thank you! :)
> 
> I reposted it here:
>     http://www.lag.net/paramiko/winpgnt.c
> 
> robey
> 
> 

Well, I'm looking at it, and it doesn't seem that tricky if you aren't
trying to do the Async stuff (which they seemed to recommend against).

It first gets a handle to the Pageant window using FindWindow.
Then it creates a named memory map (similar to mmap, just
CreateFileMapping without actually giving a file to map).
It then writes the IN message to this file, and uses SendMessage to send
the WM_COPYDATA message, to tell Pageant to run the AGENT_COPYDATA_ID
function the name of the mapped file.
I assume that the Pageant code checks for a WM_COPYDATA message, and the
AGENT_COPYDATA_ID opens the named memory map, reads the data from it,
and then writes back the response.

Just to say it isn't terrible, though it is completely win32 specific.
I'm looking through the win32all stuff to see if all of the functions
are available. (FindWindow, and SendMessage are, but I haven't found
COPYDATASTRUCT, which might be in ctypes, etc).

Which means that on Windows you could have paramiko see if win32all is
installed, and if so, then it could check to see if Pageant was running.

I've decided to look into it a bit deeper. I might actually get somewhere.

John
=:->


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051208/687dd24d/attachment.pgp 


More information about the bazaar mailing list