libssh  0.5.4
dh.h
1 /*
2  * This file is part of the SSH Library
3  *
4  * Copyright (c) 2009 by Aris Adamantiadis
5  *
6  * The SSH Library is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or (at your
9  * option) any later version.
10  *
11  * The SSH Library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with the SSH Library; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19  * MA 02111-1307, USA.
20  */
21 
22 #ifndef DH_H_
23 #define DH_H_
24 #include "config.h"
25 
26 /* DH key generation */
27 #include "libssh/keys.h"
28 
29 void ssh_print_bignum(const char *which,bignum num);
30 int dh_generate_e(ssh_session session);
31 int dh_generate_f(ssh_session session);
32 int dh_generate_x(ssh_session session);
33 int dh_generate_y(ssh_session session);
34 
35 int ssh_crypto_init(void);
36 void ssh_crypto_finalize(void);
37 
38 ssh_string dh_get_e(ssh_session session);
39 ssh_string dh_get_f(ssh_session session);
40 int dh_import_f(ssh_session session,ssh_string f_string);
41 int dh_import_e(ssh_session session, ssh_string e_string);
42 void dh_import_pubkey(ssh_session session,ssh_string pubkey_string);
43 int dh_build_k(ssh_session session);
44 int make_sessionid(ssh_session session);
45 /* add data for the final cookie */
46 int hashbufin_add_cookie(ssh_session session, unsigned char *cookie);
47 int hashbufout_add_cookie(ssh_session session);
48 int generate_session_keys(ssh_session session);
49 int sig_verify(ssh_session session, ssh_public_key pubkey,
50  SIGNATURE *signature, unsigned char *digest, int size);
51 /* returns 1 if server signature ok, 0 otherwise. The NEXT crypto is checked, not the current one */
52 int signature_verify(ssh_session session,ssh_string signature);
53 bignum make_string_bn(ssh_string string);
54 ssh_string make_bignum_string(bignum num);
55 
56 
57 #endif /* DH_H_ */