libssh  0.7.3
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 dh_generate_e(ssh_session session);
29 int dh_generate_f(ssh_session session);
30 int dh_generate_x(ssh_session session);
31 int dh_generate_y(ssh_session session);
32 
33 int ssh_crypto_init(void);
34 void ssh_crypto_finalize(void);
35 
36 ssh_string dh_get_e(ssh_session session);
37 ssh_string dh_get_f(ssh_session session);
38 int dh_import_f(ssh_session session,ssh_string f_string);
39 int dh_import_e(ssh_session session, ssh_string e_string);
40 void dh_import_pubkey(ssh_session session,ssh_string pubkey_string);
41 int dh_build_k(ssh_session session);
42 int ssh_client_dh_init(ssh_session session);
43 int ssh_client_dh_reply(ssh_session session, ssh_buffer packet);
44 
45 int make_sessionid(ssh_session session);
46 /* add data for the final cookie */
47 int hashbufin_add_cookie(ssh_session session, unsigned char *cookie);
48 int hashbufout_add_cookie(ssh_session session);
49 int generate_session_keys(ssh_session session);
50 
51 #endif /* DH_H_ */