Diffie-Hellman group exchange in SSH2. Currently #ifdeffed out
[u/mdw/putty] / sshdh.c
diff --git a/sshdh.c b/sshdh.c
index 35e6690..18749ec 100644 (file)
--- a/sshdh.c
+++ b/sshdh.c
@@ -4,6 +4,10 @@ struct ssh_kex ssh_diffiehellman = {
     "diffie-hellman-group1-sha1"
 };
 
+struct ssh_kex ssh_diffiehellman_gex = {
+    "diffie-hellman-group-exchange-sha1"
+};
+
 /*
  * The prime p used in the key exchange. 
  */
@@ -50,6 +54,15 @@ void dh_setup_group1(void) {
 }
 
 /*
+ * Initialise DH for an alternative group.
+ */
+void dh_setup_group(Bignum pval, Bignum gval) {
+    p = copybn(pval);
+    g = copybn(gval);
+    dh_init();
+}
+
+/*
  * Clean up.
  */
 void dh_cleanup(void) {