[PATCH] Branch and pull-- now with remote

Erik Bågfors zindar at gmail.com
Wed Jun 8 06:50:58 BST 2005


On 6/8/05, John A Meinel <john at arbash-meinel.com> wrote:
> John A Meinel wrote:
> > Erik Bågfors wrote:
> >
> ...
> >>
> >>I just took a look at it and it looks very good.  The one problem I
> >>saw is that I have a private key, and this key is locked. But I have
> >>it unlocked in my ssh-agent.
> >>
> >>I could see no way (if there even is one) to get to the key without
> >>entering my password again.  Is there such a thing?
> >>
> >>If so, this is ideal :)
> >>
> >
> >
> > I think it just requires having paramiko support communicating with
> > ssh-agent. I don't think the ssh-agent protocol is very formally
> > defined, but it probably isn't very hard to understand.
> >
> 
> Just to follow up on this, I'm looking through the ssh-agent source code
> and the protocol seems rather simple.
> 
> Every request is prefixed by the message length in a unsigned 32-bit
> big-endian number. The total length must be < 256k. The length does
> *not* include the 4-byte length portion.
> 
> The first byte of the message is the specific request, which can be one
> of about 30 possibilities.
> For a given request, it expects certain data. All integers are 32-bit
> unsigned big-endian integers. Strings are prefixed with an integer
> length, and can also be no longer than 256k.
> 
> There are some tricky bits, because certain functions expect BIGNUMs.
> But BIGNUM is an openssl data format, and since paramiko is already
> using pycrypto, I'm guessing they have access to a BIGNUM converter.
> 
> Anyway, I think all it would take is to analyze the protocol a little
> bit, and then paramiko could support ssh-agent pretty easily.

That would be excellent.  After reading Martin's mail, I did a new
implementation of remote ssh branches by just executing the openssh
sftp client, and then remote controlling it with pipes. The code is
terrible and not something I'm happy with.  But it proved to me how
much faster this was than running "ssh host cat file" (nut surprising
at all ofcourse).

Now I'll guess I rewrite this a third time, and then wait for your
ssh-agent support  :) I did try paramiko real quick and it looks
great!

I also had another idea. Support for gnomevfs! That would instantly
give us access to sftp, ftp, smb, etc.  However, that wouldn't be very
cross platform, but it would give us a way to support any protocol
that gnomevfs supports, at least on linux.

However, after already having http support, followed by sftp support. 
I guess ftp support will be very easy to do.  Then I don't think there
are any protocol in gnomevfs that we need.  So maybe it's just a waste
of time.

/Erik




More information about the bazaar mailing list