aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2018-11-06 16:12:20 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-01-24 11:56:23 +0100
commit9c88769707414dbadc7c8afd7070f035ccf30593 (patch)
tree25460137abde8b9471f8546fcaf09a40b42963b5 /include
parenta6c47099b7f042180bb712030519c116599352e4 (diff)
downloadlibssh-9c88769707414dbadc7c8afd7070f035ccf30593.tar.gz
libssh-9c88769707414dbadc7c8afd7070f035ccf30593.tar.xz
libssh-9c88769707414dbadc7c8afd7070f035ccf30593.zip
dh: Do some basic refactoring
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')
-rw-r--r--include/libssh/crypto.h2
-rw-r--r--include/libssh/dh.h16
2 files changed, 7 insertions, 11 deletions
diff --git a/include/libssh/crypto.h b/include/libssh/crypto.h
index 7358f3cc..eb01ac28 100644
--- a/include/libssh/crypto.h
+++ b/include/libssh/crypto.h
@@ -93,6 +93,8 @@ enum ssh_cipher_e {
struct ssh_crypto_struct {
bignum e,f,x,k,y;
+ bignum g, p;
+ int dh_group_is_mutable; /* do free group parameters */
#ifdef HAVE_ECDH
#ifdef HAVE_OPENSSL_ECC
EC_KEY *ecdh_privkey;
diff --git a/include/libssh/dh.h b/include/libssh/dh.h
index adc8c48f..4e477755 100644
--- a/include/libssh/dh.h
+++ b/include/libssh/dh.h
@@ -25,20 +25,9 @@
#include "libssh/crypto.h"
-int ssh_dh_generate_e(ssh_session session);
-int ssh_dh_generate_f(ssh_session session);
-int ssh_dh_generate_x(ssh_session session);
-int ssh_dh_generate_y(ssh_session session);
-
int ssh_dh_init(void);
void ssh_dh_finalize(void);
-ssh_string ssh_dh_get_e(ssh_session session);
-ssh_string ssh_dh_get_f(ssh_session session);
-int ssh_dh_import_f(ssh_session session,ssh_string f_string);
-int ssh_dh_import_e(ssh_session session, ssh_string e_string);
-
-int ssh_dh_import_pubkey_blob(ssh_session session, ssh_string pubkey_blob);
int ssh_dh_import_next_pubkey_blob(ssh_session session, ssh_string pubkey_blob);
int ssh_dh_build_k(ssh_session session);
@@ -54,4 +43,9 @@ int ssh_dh_get_next_server_publickey_blob(ssh_session session,
#ifdef WITH_SERVER
void ssh_server_dh_init(ssh_session session);
#endif /* WITH_SERVER */
+
+int ssh_dh_init_common(ssh_session session);
+void ssh_dh_cleanup(ssh_session session);
+int ssh_dh_generate_secret(ssh_session session, bignum dest);
+
#endif /* DH_H_ */