You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Lyor Goldstein (Jira)" <ji...@apache.org> on 2021/01/20 16:22:00 UTC

[jira] [Commented] (SSHD-1120) Taking considerable time before PublickeyAuthenticator being invoked

    [ https://issues.apache.org/jira/browse/SSHD-1120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17268673#comment-17268673 ] 

Lyor Goldstein commented on SSHD-1120:
--------------------------------------

{quote}
is causing to delay/stuck state. Am i doing anything wrong ?
{quote}
I pretty sure you are - but I cannot tell you what. From your description I would guess that you are calling some API that should not be called in the same thread as the incoming packet. Your description and the code you provided are very sketchy so I cannot venture and opinion as that you are doing wrong. Please note that you are undertaking to replace a vital part of the authentication code so I highly recommend doing it with extreme care and only after making 100% sure that you understand all its nuances and intricacies. It begs the question why are you even trying to replace this ?

> Taking considerable time before PublickeyAuthenticator being invoked
> --------------------------------------------------------------------
>
>                 Key: SSHD-1120
>                 URL: https://issues.apache.org/jira/browse/SSHD-1120
>             Project: MINA SSHD
>          Issue Type: Question
>            Reporter: Susmit Sarkar
>            Priority: Major
>
> {code:java}
> // code placeholder
> // Login via winscp
> final SSHDPasswordAuthenticator passwordAuthenticator = new SSHDPasswordAuthenticator(config,final SSHDPasswordAuthenticator passwordAuthenticator = new SSHDPasswordAuthenticator(config, policyInterface);
> // Login via ssh terminal like PUTTY
> SSHDPublicKeyAuthenticator publicKeyAuthenticator = new SSHDPublicKeyAuthenticator(config, policyInterface); sshdServer.setPublickeyAuthenticator(publicKeyAuthenticator); sshdServer.setPasswordAuthenticator(passwordAuthenticator);
> -------------------------------------------------------
> Case 1 // During winscp and filezilla
> public class SSHDPasswordAuthenticator extends UserAuthPassword implements PasswordAuthenticator {
> public boolean authenticate(String username, String password, ServerSession session)public boolean authenticate(String username, String password, ServerSession session) throws AsyncAuthException, PasswordChangeRequiredException {
> }
> }
> -------------------------------------------------------
> Case 2 // During SSH TERMINAL like PUTTY
> public class SSHDPublicKeyAuthenticator implements PublickeyAuthenticator {
> public boolean authenticate(String username, PublicKey key, ServerSession session) throws AsyncAuthException {public boolean authenticate(String username, PublicKey key, ServerSession session) throws AsyncAuthException { 
> -------------------------------------------------------------------
> Case 2 is quite slow it gets stuck before the authenticate is being called.
> On debugging found that:
>     @Override
>     public void messageReceived(IoSession ioSession, Object message) throws Exception{
>         org.apache.sshd.common.io.IoSession session = getSession(ioSession);
>         Readable ioBuffer = MinaSupport.asReadable((IoBuffer) message);
>         handler.messageReceived(session, ioBuffer);
>     }
> is causing to delay/stuck state. Am i doing anything wrong ?{code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org