From 53c88375fe54c1f551151a61ff66ff108606dcc8 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Wed, 7 Nov 2018 16:15:50 +0100 Subject: dh-gex: Add server implementation Signed-off-by: Aris Adamantiadis Reviewed-by: Jakub Jelen Reviewed-by: Andreas Schneider --- include/libssh/crypto.h | 1 + include/libssh/dh-gex.h | 5 ----- include/libssh/dh.h | 1 + include/libssh/session.h | 1 + 4 files changed, 3 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/libssh/crypto.h b/include/libssh/crypto.h index 72b6a1d6..3ec0bc5a 100644 --- a/include/libssh/crypto.h +++ b/include/libssh/crypto.h @@ -98,6 +98,7 @@ struct ssh_crypto_struct { bignum e,f,x,k,y; bignum g, p; int dh_group_is_mutable; /* do free group parameters */ + size_t dh_pmin; int dh_pn; int dh_pmax; /* preferred group parameters */ #ifdef HAVE_ECDH #ifdef HAVE_OPENSSL_ECC EC_KEY *ecdh_privkey; diff --git a/include/libssh/dh-gex.h b/include/libssh/dh-gex.h index ea93e6d1..4fc23d82 100644 --- a/include/libssh/dh-gex.h +++ b/include/libssh/dh-gex.h @@ -23,11 +23,6 @@ #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 diff --git a/include/libssh/dh.h b/include/libssh/dh.h index 4b803f0b..25aad47e 100644 --- a/include/libssh/dh.h +++ b/include/libssh/dh.h @@ -47,5 +47,6 @@ void ssh_server_dh_init(ssh_session session); int ssh_dh_init_common(ssh_session session); void ssh_dh_cleanup(struct ssh_crypto_struct *crypto); int ssh_dh_generate_secret(ssh_session session, bignum dest); +int ssh_server_dh_process_init(ssh_session session, ssh_buffer packet); #endif /* DH_H_ */ diff --git a/include/libssh/session.h b/include/libssh/session.h index 5159f216..dfcb0cd6 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_GROUP_SENT, DH_STATE_REQUEST_SENT, DH_STATE_INIT_SENT, DH_STATE_NEWKEYS_SENT, -- cgit v1.2.3