Reject multiple sessions with the same host key 45/88245/1
authorManoj Chokka <manoj.chokka@verizon.com>
Mon, 10 Feb 2020 18:15:34 +0000 (23:45 +0530)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 4 Mar 2020 11:13:07 +0000 (12:13 +0100)
SSH host key is supposed to be unique among devices. If there is an
attempt to establish a session with the same key, terminate the new
session.

Since that rules out the possibility of multiple remotes for a key,
refactor the code to use a ConcurrentMap instead of a Multimap --
removing the need for any locking.

As we really want to use CallHomeProtocolSessionContext in logging,
make it implement a toString() method and clean it up a bit.

JIRA: NETCONF-653
Change-Id: I2d78b9aa34ee4b16d0c6d2ed2ac172942c575851
Signed-off-by: Manoj Chokka <manoj.chokka@verizon.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 547c1ddb9d8794c4cd40b16a88a28e337dfb7730)


No differences found