summaryrefslogtreecommitdiffstats
path: root/kexgex.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-03-13 02:47:54 +0100
committerDamien Miller <djm@mindrot.org>2002-03-13 02:47:54 +0100
commit646e7cf3d7e7d4231c2d97d27c09fe5fe1d749e2 (patch)
treea693368c47d2d044514878fbb1516f87b487f78b /kexgex.c
parent[contrib/solaris/buildpkg.sh, contrib/solaris/README] Updated to (diff)
downloadopenssh-646e7cf3d7e7d4231c2d97d27c09fe5fe1d749e2.tar.xz
openssh-646e7cf3d7e7d4231c2d97d27c09fe5fe1d749e2.zip
Import of Niels Provos' 20020312 ssh-complete.diff
PAM, Cygwin and OSF SIA will not work for sure
Diffstat (limited to 'kexgex.c')
-rw-r--r--kexgex.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/kexgex.c b/kexgex.c
index 61896e6ed..3c811f337 100644
--- a/kexgex.c
+++ b/kexgex.c
@@ -38,6 +38,12 @@ RCSID("$OpenBSD: kexgex.c,v 1.20 2002/02/28 15:46:33 markus Exp $");
#include "dh.h"
#include "ssh2.h"
#include "compat.h"
+#include "monitor.h"
+#include "monitor_wrap.h"
+
+/* Imports */
+extern int use_privsep;
+extern int mm_recvfd;
static u_char *
kexgex_hash(
@@ -296,7 +302,11 @@ kexgex_server(Kex *kex)
fatal("DH_GEX_REQUEST, bad parameters: %d !< %d !< %d",
min, nbits, max);
- dh = choose_dh(min, nbits, max);
+ /* Contact privileged parent */
+ if (use_privsep)
+ dh = mm_choose_dh(mm_recvfd, min, nbits, max);
+ else
+ dh = choose_dh(min, nbits, max);
if (dh == NULL)
packet_disconnect("Protocol error: no matching DH grp found");
@@ -379,7 +389,11 @@ kexgex_server(Kex *kex)
/* sign H */
/* XXX hashlen depends on KEX */
- key_sign(server_host_key, &signature, &slen, hash, 20);
+ if (use_privsep)
+ mm_key_sign(mm_recvfd, kex->host_key_index(server_host_key),
+ &signature, &slen, hash, 20);
+ else
+ key_sign(server_host_key, &signature, &slen, hash, 20);
/* destroy_sensitive_data(); */
@@ -390,6 +404,7 @@ kexgex_server(Kex *kex)
packet_put_bignum2(dh->pub_key); /* f */
packet_put_string(signature, slen);
packet_send();
+
xfree(signature);
xfree(server_host_key_blob);
/* have keys, free DH */