a5959d2216
Openssh client sends two requests, one without a key signature to verify that the public key is acceptable and the second one with the signature after having loaded the private key and signed some data for actual verification. To prevent that the PublickeyAuthenticator#authenticate is called twice cache the authentication status for session and public key. Implement SessionListener to clean up the cache entry when session is destroyed. This is a workaround for SSHD bug [1]. [1] https://issues.apache.org/jira/browse/SSHD-300 Inspired-By: Guillaume Nodet <gnodet@apache.org> Change-Id: Ie8caebd6762125a754c46d821b3c7af2a10edd2b