From 21a7ce7a078dd89a2f9bfff649b58bad40e7ec63 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 20 Oct 2018 21:52:45 +0100 Subject: [PATCH] Server prep: reword messages to be client/server agnostic. Lots of user-facing messages that claim that the 'server' just did something or other unexpected will now need to be issued _by_ the server, when the client does the same unexpected thing. So I've reworded them all to talk about the 'remote side' instead of the 'server', and the SSH-2 key setup messages talk about initialising inbound and outbound crypto primitives rather than client->server and server->client. --- portfwd.c | 2 +- ssh1bpp.c | 6 +++--- ssh2bpp-bare.c | 4 ++-- ssh2bpp.c | 13 ++++++------- ssh2transport.c | 6 +++--- sshverstring.c | 2 +- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/portfwd.c b/portfwd.c index b7acc98b..99076b99 100644 --- a/portfwd.c +++ b/portfwd.c @@ -645,7 +645,7 @@ static void pfd_open_failure(Channel *chan, const char *errtext) PortForwarding *pf = container_of(chan, PortForwarding, chan); logeventf(pf->cl->logctx, - "Forwarded connection refused by server%s%s", + "Forwarded connection refused by remote%s%s", errtext ? ": " : "", errtext ? errtext : ""); } diff --git a/ssh1bpp.c b/ssh1bpp.c index 9ec22ce1..2f306dd0 100644 --- a/ssh1bpp.c +++ b/ssh1bpp.c @@ -116,7 +116,7 @@ static void ssh1_bpp_handle_input(BinaryPacketProtocol *bpp) if (s->len < 0 || s->len > 262144) { /* SSH1.5-mandated max size */ ssh_sw_abort(s->bpp.ssh, - "Extremely large packet length from server suggests" + "Extremely large packet length from remote suggests" " data stream corruption"); crStopV; } @@ -246,9 +246,9 @@ static void ssh1_bpp_handle_input(BinaryPacketProtocol *bpp) eof: if (!s->bpp.expect_close) { ssh_remote_error(s->bpp.ssh, - "Server unexpectedly closed network connection"); + "Remote side unexpectedly closed network connection"); } else { - ssh_remote_eof(s->bpp.ssh, "Server closed network connection"); + ssh_remote_eof(s->bpp.ssh, "Remote side closed network connection"); } return; /* avoid touching s now it's been freed */ diff --git a/ssh2bpp-bare.c b/ssh2bpp-bare.c index 7d3cfed9..e6dfb710 100644 --- a/ssh2bpp-bare.c +++ b/ssh2bpp-bare.c @@ -133,9 +133,9 @@ static void ssh2_bare_bpp_handle_input(BinaryPacketProtocol *bpp) eof: if (!s->bpp.expect_close) { ssh_remote_error(s->bpp.ssh, - "Server unexpectedly closed network connection"); + "Remote side unexpectedly closed network connection"); } else { - ssh_remote_eof(s->bpp.ssh, "Server closed network connection"); + ssh_remote_eof(s->bpp.ssh, "Remote side closed network connection"); } return; /* avoid touching s now it's been freed */ diff --git a/ssh2bpp.c b/ssh2bpp.c index 5b088676..225fed28 100644 --- a/ssh2bpp.c +++ b/ssh2bpp.c @@ -111,7 +111,7 @@ void ssh2_bpp_new_outgoing_crypto( (ssh2_cipher_alg(s->out.cipher)->flags & SSH_CIPHER_IS_CBC) && !(s->bpp.remote_bugs & BUG_CHOKES_ON_SSH2_IGNORE)); - bpp_logevent(("Initialised %.200s client->server encryption", + bpp_logevent(("Initialised %.200s outbound encryption", ssh2_cipher_alg(s->out.cipher)->text_name)); } else { s->out.cipher = NULL; @@ -122,8 +122,7 @@ void ssh2_bpp_new_outgoing_crypto( s->out.mac = ssh2_mac_new(mac, s->out.cipher); mac->setkey(s->out.mac, mac_key); - bpp_logevent(("Initialised %.200s client->server" - " MAC algorithm%s%s", + bpp_logevent(("Initialised %.200s outbound MAC algorithm%s%s", ssh2_mac_alg(s->out.mac)->text_name, etm_mode ? " (in ETM mode)" : "", (s->out.cipher && @@ -175,7 +174,7 @@ void ssh2_bpp_new_incoming_crypto( ssh2_cipher_setkey(s->in.cipher, ckey); ssh2_cipher_setiv(s->in.cipher, iv); - bpp_logevent(("Initialised %.200s server->client encryption", + bpp_logevent(("Initialised %.200s inbound encryption", ssh2_cipher_alg(s->in.cipher)->text_name)); } else { s->in.cipher = NULL; @@ -185,7 +184,7 @@ void ssh2_bpp_new_incoming_crypto( s->in.mac = ssh2_mac_new(mac, s->in.cipher); mac->setkey(s->in.mac, mac_key); - bpp_logevent(("Initialised %.200s server->client MAC algorithm%s%s", + bpp_logevent(("Initialised %.200s inbound MAC algorithm%s%s", ssh2_mac_alg(s->in.mac)->text_name, etm_mode ? " (in ETM mode)" : "", (s->in.cipher && @@ -628,9 +627,9 @@ static void ssh2_bpp_handle_input(BinaryPacketProtocol *bpp) eof: if (!s->bpp.expect_close) { ssh_remote_error(s->bpp.ssh, - "Server unexpectedly closed network connection"); + "Remote side unexpectedly closed network connection"); } else { - ssh_remote_eof(s->bpp.ssh, "Server closed network connection"); + ssh_remote_eof(s->bpp.ssh, "Remote side closed network connection"); } return; /* avoid touching s now it's been freed */ diff --git a/ssh2transport.c b/ssh2transport.c index 24597ece..22960f01 100644 --- a/ssh2transport.c +++ b/ssh2transport.c @@ -319,7 +319,7 @@ int ssh2_common_filter_queue(PacketProtocolLayer *ppl) msg = get_string(pktin); ssh_remote_error( - ppl->ssh, "Server sent disconnect message\n" + ppl->ssh, "Remote side sent disconnect message\n" "type %d (%s):\n\"%.*s\"", reason, ((reason > 0 && reason < lenof(ssh2_disconnect_reasons)) ? ssh2_disconnect_reasons[reason] : "unknown"), @@ -1400,7 +1400,7 @@ static void ssh2_transport_process_queue(PacketProtocolLayer *ppl) return; } pq_push_front(s->ppl.in_pq, pktin); - ppl_logevent(("Server initiated key re-exchange")); + ppl_logevent(("Remote side initiated key re-exchange")); s->rekey_class = RK_SERVER; } @@ -1445,7 +1445,7 @@ static void ssh2_transport_process_queue(PacketProtocolLayer *ppl) * rekey, we process it anyway!) */ if ((s->ppl.remote_bugs & BUG_SSH2_REKEY)) { - ppl_logevent(("Server bug prevents key re-exchange (%s)", + ppl_logevent(("Remote bug prevents key re-exchange (%s)", s->rekey_reason)); /* Reset the counters, so that at least this message doesn't * hit the event log _too_ often. */ diff --git a/sshverstring.c b/sshverstring.c index c9412a2f..d68954c7 100644 --- a/sshverstring.c +++ b/sshverstring.c @@ -392,7 +392,7 @@ void ssh_verstring_handle_input(BinaryPacketProtocol *bpp) eof: ssh_remote_error(s->bpp.ssh, - "Server unexpectedly closed network connection"); + "Remote side unexpectedly closed network connection"); return; /* avoid touching s now it's been freed */ crFinishV;