cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] Support curl-7.19.6 SSH_KNOWNHOSTS and SSH_KEYFUNCTION in pycurl

From: Gary V. Vaughan <curl-library_at_mlists.thewrittenword.com>
Date: Sat, 19 Sep 2009 19:42:27 +0000

[Resend - apologies if the original arrives too]

The program I'm writing with pycurl needs access to
CURLOPT_SSH_KNOWNHOSTS and friends so I wrote this patch against
pycurl-7.19.0 to expose those interfaces.

A few notes:

 1. I'm not sure how pycurl uses the XXXDATA fields, and haven't been
    able to get them working, so SSH_KEYDATA is more or less a blind
    copy-and-paste... I can't figure out how to use it, so it's not
    tested.
 2. When calling SSH_KEYFUNCTION callback, the patch passes 3
    arguments: a pair of tuples consisting of '(base64-key key-type)'
    for each of the known and found keys, followed by libcurl's
    'match' parameter.
 3. I was surprised that libcurl doesn't seem to export any of the
    base64 encoding functions it uses internally, so I pasted in
    a copy of Curl_base64_encode, and tweaked it a little to remove
    dependencies on other libcurl internals. There has to be a
    better way to do it, but this was quick and easy, and it works.

It would be awesome to see this applied to the upstream CVS, and I'd
be happy to clean it up or make any adjustments necessary to see that
happen.

Cheers,
    Gary

-- 
Gary V. Vaughan (gary_at_thewrittenword.com)

Received on 2009-09-19