diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2018-11-06 21:44:46 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-01-24 11:56:23 +0100 |
commit | 574bfb54595870033af2927c692af5f0afd3073c (patch) | |
tree | 05171d2347d2255618ec0dd66811b738088c86b4 /include/libssh | |
parent | 154eb9191408a63483481efeafa633d3b467da18 (diff) | |
download | libssh-574bfb54595870033af2927c692af5f0afd3073c.tar.gz libssh-574bfb54595870033af2927c692af5f0afd3073c.tar.xz libssh-574bfb54595870033af2927c692af5f0afd3073c.zip |
dh-gex: Add client implementation
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include/libssh')
-rw-r--r-- | include/libssh/crypto.h | 3 | ||||
-rw-r--r-- | include/libssh/dh-gex.h | 37 | ||||
-rw-r--r-- | include/libssh/session.h | 1 |
3 files changed, 41 insertions, 0 deletions
diff --git a/include/libssh/crypto.h b/include/libssh/crypto.h index eb01ac28..72b6a1d6 100644 --- a/include/libssh/crypto.h +++ b/include/libssh/crypto.h @@ -58,6 +58,9 @@ enum ssh_key_exchange_e { SSH_KEX_DH_GROUP1_SHA1=1, /* diffie-hellman-group14-sha1 */ SSH_KEX_DH_GROUP14_SHA1, + /* diffie-hellman-group-exchange-sha1 */ + SSH_KEX_DH_GEX_SHA1, + SSH_KEX_DH_GEX_SHA256, /* ecdh-sha2-nistp256 */ SSH_KEX_ECDH_SHA2_NISTP256, /* ecdh-sha2-nistp384 */ diff --git a/include/libssh/dh-gex.h b/include/libssh/dh-gex.h new file mode 100644 index 00000000..ea93e6d1 --- /dev/null +++ b/include/libssh/dh-gex.h @@ -0,0 +1,37 @@ +/* + * This file is part of the SSH Library + * + * Copyright (c) 2016 by Aris Adamantiadis <aris@0xbadc0de.be> + * + * The SSH Library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * The SSH Library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with the SSH Library; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + + +#ifndef SRC_DH_GEX_H_ +#define SRC_DH_GEX_H_ + +/* Minimum, recommanded and maximum size of DH group */ +#define DH_PMIN 2048 +#define DH_PREQ 2048 +#define DH_PMAX 8192 + +int ssh_client_dhgex_init(ssh_session session); + +#ifdef WITH_SERVER +void ssh_server_dhgex_init(ssh_session session); +#endif /* WITH_SERVER */ + +#endif /* SRC_DH_GEX_H_ */ diff --git a/include/libssh/session.h b/include/libssh/session.h index 5761fa2d..5159f216 100644 --- a/include/libssh/session.h +++ b/include/libssh/session.h @@ -49,6 +49,7 @@ enum ssh_session_state_e { enum ssh_dh_state_e { DH_STATE_INIT=0, + DH_STATE_REQUEST_SENT, DH_STATE_INIT_SENT, DH_STATE_NEWKEYS_SENT, DH_STATE_FINISHED |