aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-09-17 12:10:34 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-09-18 21:37:17 +0200
commitd7fa15df83619dd300580a444ab330a2a8592d4a (patch)
treef739e3c116412465a2e295eebb166f188760188d /include
parent519291558d5c702775d60253e6b9d9ca9249b59a (diff)
downloadlibssh-d7fa15df83619dd300580a444ab330a2a8592d4a.tar.gz
libssh-d7fa15df83619dd300580a444ab330a2a8592d4a.tar.xz
libssh-d7fa15df83619dd300580a444ab330a2a8592d4a.zip
priv: Move kex functions to kex header.
Diffstat (limited to 'include')
-rw-r--r--include/libssh/crypto.h4
-rw-r--r--include/libssh/kex.h14
-rw-r--r--include/libssh/priv.h15
-rw-r--r--include/libssh/session.h1
4 files changed, 16 insertions, 18 deletions
diff --git a/include/libssh/crypto.h b/include/libssh/crypto.h
index dfdcac90..498835e2 100644
--- a/include/libssh/crypto.h
+++ b/include/libssh/crypto.h
@@ -80,8 +80,8 @@ struct ssh_crypto_struct {
void *compress_out_ctx; /* don't touch it */
void *compress_in_ctx; /* really, don't */
/* kex sent by server, client, and mutually elected methods */
- KEX server_kex;
- KEX client_kex;
+ struct ssh_kex_struct server_kex;
+ struct ssh_kex_struct client_kex;
char *kex_methods[SSH_KEX_METHODS];
enum ssh_key_exchange_e kex_type;
enum ssh_mac_e mac_type; /* Mac operations to use for key gen */
diff --git a/include/libssh/kex.h b/include/libssh/kex.h
index dbf69ab9..693d8006 100644
--- a/include/libssh/kex.h
+++ b/include/libssh/kex.h
@@ -27,14 +27,24 @@
#define SSH_KEX_METHODS 10
-typedef struct ssh_kex_struct {
+struct ssh_kex_struct {
unsigned char cookie[16];
char *methods[SSH_KEX_METHODS];
-} KEX;
+};
SSH_PACKET_CALLBACK(ssh_packet_kexinit);
#ifdef WITH_SSH1
SSH_PACKET_CALLBACK(ssh_packet_publickey1);
#endif
+extern const char *ssh_kex_nums[];
+int ssh_send_kex(ssh_session session, int server_kex);
+void ssh_list_kex(ssh_session session, struct ssh_kex_struct *kex);
+int set_client_kex(ssh_session session);
+int ssh_kex_select_methods(ssh_session session);
+int verify_existing_algo(int algo, const char *name);
+char **space_tokenize(const char *chain);
+int ssh_get_kex1(ssh_session session);
+char *ssh_find_matching(const char *in_d, const char *what_d);
+
#endif /* KEX_H_ */
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 9802e387..f399dc29 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -128,13 +128,12 @@ extern "C" {
#include <sys/time.h>
#endif
+/* error handling structure */
struct error_struct {
-/* error handling */
int error_code;
char error_buffer[ERROR_BUFFERLEN];
};
-struct ssh_message_struct;
struct ssh_common_struct;
struct ssh_kex_struct;
@@ -192,18 +191,6 @@ socket_t ssh_connect_host_nonblocking(ssh_session session, const char *host,
void ssh_sock_set_nonblocking(socket_t sock);
void ssh_sock_set_blocking(socket_t sock);
-/* in kex.c */
-extern const char *ssh_kex_nums[];
-int ssh_send_kex(ssh_session session, int server_kex);
-void ssh_list_kex(ssh_session session, struct ssh_kex_struct *kex);
-int set_client_kex(ssh_session session);
-int ssh_kex_select_methods(ssh_session session);
-int verify_existing_algo(int algo, const char *name);
-char **space_tokenize(const char *chain);
-int ssh_get_kex1(ssh_session session);
-char *ssh_find_matching(const char *in_d, const char *what_d);
-
-
/* in base64.c */
ssh_buffer base64_to_bin(const char *source);
unsigned char *bin_to_base64(const unsigned char *source, int len);
diff --git a/include/libssh/session.h b/include/libssh/session.h
index fd83ed0d..9d03f473 100644
--- a/include/libssh/session.h
+++ b/include/libssh/session.h
@@ -22,6 +22,7 @@
#ifndef SESSION_H_
#define SESSION_H_
#include "libssh/priv.h"
+#include "libssh/kex.h"
#include "libssh/packet.h"
#include "libssh/pcap.h"
#include "libssh/auth.h"