libssh 0.12.1 The SSH library

Loading...
Searching...
No Matches
kex.h
1/*
2 * This file is part of the SSH Library
3 *
4 * Copyright (c) 2009 by Aris Adamantiadis
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef KEX_H_
22#define KEX_H_
23
24#include "libssh/priv.h"
25#include "libssh/callbacks.h"
26
27#define SSH_KEX_METHODS 10
28
29 struct ssh_kex_struct {
30 unsigned char cookie[16];
31 char *methods[SSH_KEX_METHODS];
32};
33
34/* crypto.h needs ssh_kex_struct so it is included below the struct definition */
35#include "libssh/crypto.h"
36
37#ifdef __cplusplus
38 extern "C" {
39#endif
40
41 SSH_PACKET_CALLBACK(ssh_packet_kexinit);
42
43 int ssh_send_kex(ssh_session session);
44 void ssh_list_kex(struct ssh_kex_struct *kex);
45 int ssh_set_client_kex(ssh_session session);
46 int ssh_kex_append_extensions(ssh_session session, struct ssh_kex_struct *pkex);
47 int ssh_kex_select_methods(ssh_session session);
48 int ssh_verify_existing_algo(enum ssh_kex_types_e algo, const char *name);
49 char *ssh_keep_known_algos(enum ssh_kex_types_e algo, const char *list);
50 char *ssh_keep_fips_algos(enum ssh_kex_types_e algo, const char *list);
51 char *ssh_add_to_default_algos(enum ssh_kex_types_e algo, const char *list);
52 char *ssh_remove_from_default_algos(enum ssh_kex_types_e algo,
53 const char *list);
54 char *ssh_prefix_default_algos(enum ssh_kex_types_e algo, const char *list);
55 char **ssh_space_tokenize(const char *chain);
56 int ssh_get_kex1(ssh_session session);
57 char *ssh_find_matching(const char *in_d, const char *what_d);
58 const char *ssh_kex_get_supported_method(enum ssh_kex_types_e type);
59 const char *ssh_kex_get_default_methods(enum ssh_kex_types_e type);
60 const char *ssh_kex_get_fips_methods(enum ssh_kex_types_e type);
61 const char *ssh_kex_get_description(enum ssh_kex_types_e type);
62 char *ssh_client_select_hostkeys(ssh_session session);
63 int ssh_send_rekex(ssh_session session);
64 int server_set_kex(ssh_session session);
65 int ssh_make_sessionid(ssh_session session);
66/* add data for the final cookie */
67 int ssh_hashbufin_add_cookie(ssh_session session, unsigned char *cookie);
68 int ssh_hashbufout_add_cookie(ssh_session session);
69 int ssh_generate_session_keys(ssh_session session);
70 bool ssh_kex_is_gss(struct ssh_crypto_struct *crypto);
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif /* KEX_H_ */
SSH_PACKET_CALLBACK
#define SSH_PACKET_CALLBACK(name)
This macro declares a packet callback handler.
Definition callbacks.h:625