Preliminary support for RSA user authentication in SSH2! Most of the
[u/mdw/putty] / sshdh.c
diff --git a/sshdh.c b/sshdh.c
index 35e6690..f1d709f 100644 (file)
--- a/sshdh.c
+++ b/sshdh.c
@@ -1,9 +1,13 @@
 #include "ssh.h"
 
-struct ssh_kex ssh_diffiehellman = {
+const struct ssh_kex ssh_diffiehellman = {
     "diffie-hellman-group1-sha1"
 };
 
+const 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) {