diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-04-28 19:33:28 +0000 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-04-28 19:33:28 +0000 |
commit | 2c75ad7e19dd79ef94e45788d8cfa94ca0844151 (patch) | |
tree | 9776307d79b0251313a657e2aa5c204e6fddafec /include | |
parent | 9f7d4d2d60b4f6ff2f2305b6db75dd85f82577f5 (diff) | |
download | libssh-2c75ad7e19dd79ef94e45788d8cfa94ca0844151.tar.gz libssh-2c75ad7e19dd79ef94e45788d8cfa94ca0844151.tar.xz libssh-2c75ad7e19dd79ef94e45788d8cfa94ca0844151.zip |
Improve auto public key authentication.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@636 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'include')
-rw-r--r-- | include/libssh/libssh.h | 6 | ||||
-rw-r--r-- | include/libssh/priv.h | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index ad3b8b1c..d2e6219b 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -82,6 +82,7 @@ typedef struct channel_struct CHANNEL; typedef struct agent_struct AGENT; typedef struct ssh_session SSH_SESSION; typedef struct ssh_kbdint SSH_KBDINT; +struct keys_struct; /* integer values */ typedef uint32_t u32; @@ -255,8 +256,9 @@ PUBLIC_KEY *publickey_from_privatekey(PRIVATE_KEY *prv); void privatekey_free(PRIVATE_KEY *prv); STRING *publickey_from_file(SSH_SESSION *session, const char *filename, int *type); -STRING *publickey_from_next_file(SSH_SESSION *session, const char **pub_keys_path, - const char **keys_path, char **privkeyfile, int *type, int *count); +STRING *publickey_from_next_file(SSH_SESSION *session, + struct keys_struct *keytab, size_t keytab_size, + char **privkeyfile, int *type, unsigned int *count); int ssh_is_server_known(SSH_SESSION *session); int ssh_write_knownhost(SSH_SESSION *session); diff --git a/include/libssh/priv.h b/include/libssh/priv.h index c54edef6..62f78ba1 100644 --- a/include/libssh/priv.h +++ b/include/libssh/priv.h @@ -299,6 +299,11 @@ struct agent_struct { unsigned int count; }; +struct keys_struct { + const char *private; + const char *public; +}; + struct ssh_session { struct error_struct error; struct socket *socket; @@ -719,6 +724,9 @@ int match_hostname(const char *host, const char *pattern, unsigned int len); /** Zero a structure given a pointer to the structure */ #define ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0) +/** Get the size of an array */ +#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) + #ifdef HAVE_LIBGCRYPT /* gcrypt_missing.c */ int my_gcry_dec2bn(bignum *bn, const char *data); |