BUG 8839: Revert "Make netconf utilize encrypted passwords only"
[netconf.git] / netconf / netconf-netty-util / src / main / java / org / opendaylight / netconf / nettyutil / handler / ssh / authentication / LoginPassword.java
index 500791fc8280f234c11954d5a77a8d44f8645440..46cb2c717b314cb64548c553354087bf5df2f082 100644 (file)
@@ -11,45 +11,28 @@ package org.opendaylight.netconf.nettyutil.handler.ssh.authentication;
 import java.io.IOException;
 import org.apache.sshd.ClientSession;
 import org.apache.sshd.client.future.AuthFuture;
-import org.opendaylight.aaa.encrypt.AAAEncryptionService;
 
 /**
  * Class Providing username/password authentication option to
  * {@link org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandler}.
  */
 public class LoginPassword extends AuthenticationHandler {
-
     private final String username;
     private final String password;
-    private final AAAEncryptionService encryptionService;
 
     public LoginPassword(String username, String password) {
-        this(username, password, null);
-    }
-
-    public LoginPassword(final String username, final String password, final AAAEncryptionService encryptionService) {
         this.username = username;
         this.password = password;
-        this.encryptionService = encryptionService;
     }
 
     @Override
     public String getUsername() {
-        if (encryptionService != null) {
-            return encryptionService.decrypt(username);
-
-        }
         return username;
     }
 
     @Override
     public AuthFuture authenticate(final ClientSession session) throws IOException {
-        if (encryptionService != null) {
-            final String decryptedPassword = encryptionService.decrypt(password);
-            session.addPasswordIdentity(decryptedPassword);
-        } else {
-            session.addPasswordIdentity(password);
-        }
+        session.addPasswordIdentity(password);
         return session.auth();
     }
 }