libssh  0.8.3
The SSH library
dh.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 DH_H_
22 #define DH_H_
23 
24 #include "config.h"
25 
26 #include "libssh/crypto.h"
27 
28 int ssh_dh_generate_e(ssh_session session);
29 int ssh_dh_generate_f(ssh_session session);
30 int ssh_dh_generate_x(ssh_session session);
31 int ssh_dh_generate_y(ssh_session session);
32 
33 int ssh_dh_init(void);
34 void ssh_dh_finalize(void);
35 
36 ssh_string ssh_dh_get_e(ssh_session session);
37 ssh_string ssh_dh_get_f(ssh_session session);
38 int ssh_dh_import_f(ssh_session session,ssh_string f_string);
39 int ssh_dh_import_e(ssh_session session, ssh_string e_string);
40 
41 int ssh_dh_import_pubkey_blob(ssh_session session, ssh_string pubkey_blob);
42 int ssh_dh_import_next_pubkey_blob(ssh_session session, ssh_string pubkey_blob);
43 
44 int ssh_dh_build_k(ssh_session session);
45 int ssh_client_dh_init(ssh_session session);
46 int ssh_client_dh_reply(ssh_session session, ssh_buffer packet);
47 
48 ssh_key ssh_dh_get_current_server_publickey(ssh_session session);
49 int ssh_dh_get_current_server_publickey_blob(ssh_session session,
50  ssh_string *pubkey_blob);
51 ssh_key ssh_dh_get_next_server_publickey(ssh_session session);
52 int ssh_dh_get_next_server_publickey_blob(ssh_session session,
53  ssh_string *pubkey_blob);
54 
55 int ssh_make_sessionid(ssh_session session);
56 /* add data for the final cookie */
57 int ssh_hashbufin_add_cookie(ssh_session session, unsigned char *cookie);
58 int ssh_hashbufout_add_cookie(ssh_session session);
59 int ssh_generate_session_keys(ssh_session session);
60 
61 #endif /* DH_H_ */
Definition: pki.h:42
Definition: session.h:102
Definition: string.h:29
Definition: buffer.c:47