aboutsummaryrefslogtreecommitdiff
path: root/include/libssh
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2018-11-07 16:15:50 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-01-24 13:06:33 +0100
commit53c88375fe54c1f551151a61ff66ff108606dcc8 (patch)
tree0be5b058a80315262daa585a92fb8d11455c158e /include/libssh
parent40faa98c5ee0c834879c1ea7a7b3e347893e8fed (diff)
downloadlibssh-53c88375fe54c1f551151a61ff66ff108606dcc8.tar.gz
libssh-53c88375fe54c1f551151a61ff66ff108606dcc8.tar.xz
libssh-53c88375fe54c1f551151a61ff66ff108606dcc8.zip
dh-gex: Add server 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.h1
-rw-r--r--include/libssh/dh-gex.h5
-rw-r--r--include/libssh/dh.h1
-rw-r--r--include/libssh/session.h1
4 files changed, 3 insertions, 5 deletions
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,