diff options
author | Daniel Stenberg <daniel@haxx.se> | 2009-07-22 22:49:01 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2009-07-22 22:49:01 +0000 |
commit | 47c392e135f17d400acc5d7e99b88d16578cb406 (patch) | |
tree | e4069b5c9fa7582f53ff88eb8c08f86d43f8ea55 /include/curl | |
parent | 9cff716925d8501992a10f09a53d4ad3ed3d919f (diff) | |
download | curl-47c392e135f17d400acc5d7e99b88d16578cb406.tar.gz |
- Added CURLOPT_SSH_KNOWNHOSTS, CURLOPT_SSH_KEYFUNCTION, CURLOPT_SSH_KEYDATA.
They introduce known_host support for SSH keys to libcurl. See docs for
details.
Diffstat (limited to 'include/curl')
-rw-r--r-- | include/curl/curl.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h index 970c11678..d261ce39b 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -493,6 +493,45 @@ typedef enum { #define CURL_ERROR_SIZE 256 +struct curl_khkey { + const char *key; /* points to a zero-terminated string encoded with base64 + if len is zero, otherwise to the "raw" data */ + size_t len; + enum type { + CURLKHTYPE_UNKNOWN, + CURLKHTYPE_RSA1, + CURLKHTYPE_RSA, + CURLKHTYPE_DSS + } keytype; +}; + +/* this is the set of return values expected from the curl_sshkeycallback + callback */ +enum curl_khstat { + CURLKHSTAT_FINE_ADD_TO_FILE, + CURLKHSTAT_FINE, + CURLKHSTAT_REJECT, /* reject the connection, return an error */ + CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so + this causes a CURLE_DEFER error but otherwise the + connection will be left intact etc */ + CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */ +}; + +/* this is the set of status codes pass in to the callback */ +enum curl_khmatch { + CURLKHMATCH_OK, /* match */ + CURLKHMATCH_MISMATCH, /* host found, key mismatch! */ + CURLKHMATCH_MISSING, /* no matching host/key found */ + CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */ +}; + +typedef int + (*curl_sshkeycallback) (CURL *easy, /* easy handle */ + const struct curl_khkey *knownkey, /* known */ + const struct curl_khkey *foundkey, /* found */ + enum curl_khmatch, /* libcurl's view on the keys */ + void *clientp); /* custom pointer passed from app */ + /* parameter for the CURLOPT_USE_SSL option */ typedef enum { CURLUSESSL_NONE, /* do not attempt to use SSL */ @@ -1214,6 +1253,16 @@ typedef enum { to all protocols except FILE and SCP. */ CINIT(REDIR_PROTOCOLS, LONG, 182), + /* set the SSH knownhost file name to use */ + CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183), + + /* set the SSH host key callback, must point to a curl_sshkeycallback + function */ + CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184), + + /* set the SSH host key callback custom pointer */ + CINIT(SSH_KEYDATA, OBJECTPOINT, 185), + CURLOPT_LASTENTRY /* the last unused */ } CURLoption; |