X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/83372d79842f9a9c3debfb7a88456d24bfa34354..755e0524eb217ebed9f649405fa2624b26f0fb29:/ssh.c diff --git a/ssh.c b/ssh.c index 25c236ec..20be6985 100644 --- a/ssh.c +++ b/ssh.c @@ -5142,16 +5142,19 @@ static int do_ssh2_transport(Ssh ssh, void *vin, int inlen, /* * Now generate and send e for Diffie-Hellman. */ + set_busy_status(ssh->frontend, BUSY_CPU); /* this can take a while */ s->e = dh_create_e(ssh->kex_ctx, s->nbits * 2); s->pktout = ssh2_pkt_init(s->kex_init_value); ssh2_pkt_addmp(s->pktout, s->e); ssh2_pkt_send_noqueue(ssh, s->pktout); + set_busy_status(ssh->frontend, BUSY_WAITING); /* wait for server */ crWaitUntil(pktin); if (pktin->type != s->kex_reply_value) { bombout(("expected key exchange reply packet from server")); crStop(0); } + set_busy_status(ssh->frontend, BUSY_CPU); /* cogitate */ ssh_pkt_getstring(pktin, &s->hostkeydata, &s->hostkeylen); s->f = ssh2_pkt_getmp(pktin); if (!s->f) { @@ -5162,6 +5165,10 @@ static int do_ssh2_transport(Ssh ssh, void *vin, int inlen, s->K = dh_find_K(ssh->kex_ctx, s->f); + /* We assume everything from now on will be quick, and it might + * involve user interaction. */ + set_busy_status(ssh->frontend, BUSY_NOT); + sha_string(&ssh->exhash, s->hostkeydata, s->hostkeylen); if (ssh->kex == &ssh_diffiehellman_gex) { sha_uint32(&ssh->exhash, s->pbits);